mirror of
https://github.com/Michatec/wk_wars2x.git
synced 2026-04-01 08:26:27 +02:00
Return callbacks with 'ok' instead of an empty object
This commit is contained in:
@@ -177,14 +177,14 @@ end )
|
||||
RegisterNUICallback( "togglePlateReaderDisplay", function( data, cb )
|
||||
-- Toggle the display state
|
||||
READER:ToggleDisplayState()
|
||||
cb({})
|
||||
cb('ok')
|
||||
end )
|
||||
|
||||
-- Runs when the "Set BOLO Plate" button is pressed on the plate reader box
|
||||
RegisterNUICallback( "setBoloPlate", function( plate, cb )
|
||||
-- Set the BOLO plate
|
||||
READER:SetBoloPlate( plate )
|
||||
cb({})
|
||||
cb('ok')
|
||||
end )
|
||||
|
||||
-- This is the main function that runs and scans all vehicles in front and behind the patrol vehicle
|
||||
|
||||
16
cl_radar.lua
16
cl_radar.lua
@@ -1422,21 +1422,21 @@ end
|
||||
RegisterNUICallback( "toggleRadarDisplay", function( data, cb )
|
||||
-- Toggle the display state
|
||||
RADAR:ToggleDisplayState()
|
||||
cb({})
|
||||
cb('ok')
|
||||
end )
|
||||
|
||||
-- Runs when the user presses the power button on the radar ui
|
||||
RegisterNUICallback( "togglePower", function( data, cb )
|
||||
-- Toggle the radar's power
|
||||
RADAR:TogglePower()
|
||||
cb({})
|
||||
cb('ok')
|
||||
end )
|
||||
|
||||
-- Runs when the user presses the ESC or RMB when the remote is open
|
||||
RegisterNUICallback( "closeRemote", function( data, cb )
|
||||
-- Remove focus to the NUI side
|
||||
SetNuiFocus( false, false )
|
||||
cb({})
|
||||
cb('ok')
|
||||
end )
|
||||
|
||||
-- Runs when the user presses any of the antenna mode buttons on the remote
|
||||
@@ -1468,7 +1468,7 @@ RegisterNUICallback( "setAntennaMode", function( data, cb )
|
||||
end )
|
||||
end
|
||||
end
|
||||
cb({})
|
||||
cb('ok')
|
||||
end )
|
||||
|
||||
-- Runs when the user presses either of the XMIT/HOLD buttons on the remote
|
||||
@@ -1493,7 +1493,7 @@ RegisterNUICallback( "toggleAntenna", function( data, cb )
|
||||
end )
|
||||
end
|
||||
end
|
||||
cb({})
|
||||
cb('ok')
|
||||
end )
|
||||
|
||||
-- Runs when the user presses the menu button on the remote control
|
||||
@@ -1515,20 +1515,20 @@ RegisterNUICallback( "menu", function( data, cb )
|
||||
-- Play the standard audio beep
|
||||
SendNUIMessage( { _type = "audio", name = "beep", vol = RADAR:GetSettingValue( "beep" ) } )
|
||||
end
|
||||
cb({})
|
||||
cb('ok')
|
||||
end )
|
||||
|
||||
-- Runs when the JavaScript side sends the UI data for saving
|
||||
RegisterNUICallback( "saveUiData", function( data, cb )
|
||||
UTIL:Log( "Saving updated UI settings data." )
|
||||
SetResourceKvp( "wk_wars2x_ui_data", json.encode( data ) )
|
||||
cb({})
|
||||
cb('ok')
|
||||
end )
|
||||
|
||||
-- Runs when the JavaScript side sends the quick start video has been watched
|
||||
RegisterNUICallback( "qsvWatched", function( data, cb )
|
||||
SetResourceKvpInt( "wk_wars2x_new_user", 1 )
|
||||
cb({})
|
||||
cb('ok')
|
||||
end )
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user