mirror of
https://github.com/Michatec/wk_wars2x.git
synced 2026-04-01 00:16:27 +02:00
Moved plate NUI callbacks
This commit is contained in:
@@ -39,17 +39,6 @@ READER.vars =
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Runs when the "Toggle Display" button is pressed on the plate reder box
|
|
||||||
RegisterNUICallback( "togglePlateReaderDisplay", function()
|
|
||||||
-- Toggle the display state
|
|
||||||
READER:ToggleDisplayState()
|
|
||||||
end )
|
|
||||||
|
|
||||||
-- Runs when the "Toggle Display" button is pressed on the plate reder box
|
|
||||||
RegisterNUICallback( "setBoloPlate", function( plate, cb )
|
|
||||||
READER:SetBoloPlate( plate )
|
|
||||||
end )
|
|
||||||
|
|
||||||
-- Gets the display state
|
-- Gets the display state
|
||||||
function READER:GetDisplayState()
|
function READER:GetDisplayState()
|
||||||
return self.vars.displayed
|
return self.vars.displayed
|
||||||
@@ -96,6 +85,7 @@ end
|
|||||||
|
|
||||||
function READER:SetBoloPlate( plate )
|
function READER:SetBoloPlate( plate )
|
||||||
self.vars.boloPlate = plate
|
self.vars.boloPlate = plate
|
||||||
|
UTIL:Notify( "BOLO plate set to: " .. plate )
|
||||||
end
|
end
|
||||||
|
|
||||||
function READER:GetCamLocked( cam )
|
function READER:GetCamLocked( cam )
|
||||||
@@ -123,6 +113,17 @@ function READER:GetCamFromNum( relPos )
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Runs when the "Toggle Display" button is pressed on the plate reder box
|
||||||
|
RegisterNUICallback( "togglePlateReaderDisplay", function()
|
||||||
|
-- Toggle the display state
|
||||||
|
READER:ToggleDisplayState()
|
||||||
|
end )
|
||||||
|
|
||||||
|
-- Runs when the "Toggle Display" button is pressed on the plate reder box
|
||||||
|
RegisterNUICallback( "setBoloPlate", function( plate, cb )
|
||||||
|
READER:SetBoloPlate( plate )
|
||||||
|
end )
|
||||||
|
|
||||||
function READER:Main()
|
function READER:Main()
|
||||||
if ( PLY:VehicleStateValid() and self:CanPerformMainTask() ) then
|
if ( PLY:VehicleStateValid() and self:CanPerformMainTask() ) then
|
||||||
for i = 1, -1, -2 do
|
for i = 1, -1, -2 do
|
||||||
@@ -141,7 +142,6 @@ function READER:Main()
|
|||||||
self:SetIndex( cam, index )
|
self:SetIndex( cam, index )
|
||||||
|
|
||||||
if ( plate == self:GetBoloPlate() ) then
|
if ( plate == self:GetBoloPlate() ) then
|
||||||
UTIL:Notify( "DEBUG: BOLO plate hit!" )
|
|
||||||
self:LockCam( cam )
|
self:LockCam( cam )
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user