diff --git a/cl_plate_reader.lua b/cl_plate_reader.lua index 87b43ac..f1d5b65 100644 --- a/cl_plate_reader.lua +++ b/cl_plate_reader.lua @@ -48,7 +48,7 @@ READER.vars = hidden = false, -- The BOLO plate - boloPlate = "", + boloPlates = {}, -- Cameras, this table contains all of the data needed for operation of the front and rear plate reader cams = { @@ -99,22 +99,19 @@ function READER:GetIndex( cam ) return self.vars.cams[cam].index end function READER:SetIndex( cam, index ) self.vars.cams[cam].index = index end -- Returns the bolo plate -function READER:GetBoloPlate() - if ( self.vars.boloPlate ~= nil ) then - return self.vars.boloPlate +function READER:GetBoloPlate( plate ) + for _,v in ipairs(self.vars.boloPlates) do + if v == plate then + return true + end end + return false end -- Sets the bolo plate to the given plate -function READER:SetBoloPlate( plate ) - self.vars.boloPlate = plate - UTIL:Notify( "BOLO plate set to: ~b~" .. plate ) -end - --- Clears the BOLO plate -function READER:ClearBoloPlate() - self.vars.boloPlate = nil - UTIL:Notify( "~b~BOLO plate cleared!" ) +function READER:SetBoloPlate( plates ) + self.vars.boloPlates = plates + UTIL:Notify( "~b~BOLO plates updated" ) end -- Returns if the given reader is locked @@ -216,13 +213,6 @@ RegisterNUICallback( "setBoloPlate", function( plate, cb ) cb( "ok" ) end ) --- Runs when the "Clear BOLO Plate" button is pressed on the plate reader box -RegisterNUICallback( "clearBoloPlate", function( plate, cb ) - -- Clear the BOLO plate - READER:ClearBoloPlate() - cb( "ok" ) -end ) - --[[---------------------------------------------------------------------------------- Plate reader threads @@ -275,7 +265,7 @@ function READER:Main() self:SetIndex( cam, index ) -- Automatically lock the plate if the scanned plate matches the BOLO - if ( plate == self:GetBoloPlate() ) then + if ( self:GetBoloPlate( plate ) ) then self:LockCam( cam, false, true ) SYNC:LockReaderCam( cam, READER:GetCameraDataPacket( cam ) ) diff --git a/nui/radar.css b/nui/radar.css index 742d102..70163a1 100644 --- a/nui/radar.css +++ b/nui/radar.css @@ -777,8 +777,8 @@ button:focus { outline: none; } } #plateReaderBox { - width: 225px; - height: 330px; + width: 235px; + height: min-content; position: absolute; margin: auto; @@ -807,10 +807,8 @@ button:focus { outline: none; } #plateReaderBox .container { width: 100%; - height: 200px; display: grid; - grid-template-rows: 60px 70px 60px; align-items: center; justify-items: center; } @@ -820,6 +818,7 @@ button:focus { outline: none; } border-radius: 10px; font-size: 16px; border: none; + margin: 10px 0px; } #plateReaderBox .container .btn:hover { background-color: rgb( 255, 255, 255 ); @@ -829,6 +828,21 @@ button:focus { outline: none; } background-color: rgb( 190, 190, 190 ); padding: 0; } + + #plateReaderBox .container #boloPlates { + border-spacing: 15px 5px; + } + + #plateReaderBox .container .plate_text { + width: 75%; + font-family: "Plate-Font"; + text-align: center; + font-size: 30px; + text-transform: uppercase; + padding: 0; + padding-bottom: 10px; + background-color: white; + } #plateReaderBox .container .plate_input { width: 75%; @@ -839,18 +853,15 @@ button:focus { outline: none; } text-transform: uppercase; padding: 0; padding-bottom: 15px; - margin-bottom: -15px; + margin: 10px 0px; } #plateReaderBox .close { width: 80px; height: 20px; - position: absolute; - left: 0; - right: 0; - bottom: 10px; - margin: auto; + + margin: 10px 0px; border-radius: 10px; border: none; diff --git a/nui/radar.html b/nui/radar.html index 77a92c2..9b2ba35 100644 --- a/nui/radar.html +++ b/nui/radar.html @@ -242,14 +242,17 @@