mirror of
https://github.com/Michatec/wk_wars2x.git
synced 2026-04-01 00:16:27 +02:00
Fixed menu button working when the power was off
This commit is contained in:
29
cl_radar.lua
29
cl_radar.lua
@@ -1332,20 +1332,23 @@ end )
|
|||||||
|
|
||||||
-- Runs when the user presses the menu button on the remote control
|
-- Runs when the user presses the menu button on the remote control
|
||||||
RegisterNUICallback( "menu", function()
|
RegisterNUICallback( "menu", function()
|
||||||
-- As the menu button is a multipurpose button, we first check to see if the menu is already open
|
-- Only run the codw if the radar has power
|
||||||
if ( RADAR:IsMenuOpen() ) then
|
if ( RADAR:IsPowerOn() ) then
|
||||||
-- As the menu is already open, we then iterate to the next option in the settings list
|
-- As the menu button is a multipurpose button, we first check to see if the menu is already open
|
||||||
RADAR:ChangeMenuIndex()
|
if ( RADAR:IsMenuOpen() ) then
|
||||||
else
|
-- As the menu is already open, we then iterate to the next option in the settings list
|
||||||
-- Set the menu state to open, which will prevent anything else within the radar from working
|
RADAR:ChangeMenuIndex()
|
||||||
RADAR:SetMenuState( true )
|
else
|
||||||
|
-- Set the menu state to open, which will prevent anything else within the radar from working
|
||||||
-- Send an update to the NUI side
|
RADAR:SetMenuState( true )
|
||||||
RADAR:SendMenuUpdate()
|
|
||||||
end
|
-- Send an update to the NUI side
|
||||||
|
RADAR:SendMenuUpdate()
|
||||||
|
end
|
||||||
|
|
||||||
-- Play the standard audio beep
|
-- Play the standard audio beep
|
||||||
SendNUIMessage( { _type = "audio", name = "beep", vol = RADAR:GetSettingValue( "beep" ) } )
|
SendNUIMessage( { _type = "audio", name = "beep", vol = RADAR:GetSettingValue( "beep" ) } )
|
||||||
|
end
|
||||||
end )
|
end )
|
||||||
|
|
||||||
-- Runs when the JavaScript side sends the UI data for saving
|
-- Runs when the JavaScript side sends the UI data for saving
|
||||||
|
|||||||
Reference in New Issue
Block a user