mirror of
https://github.com/Michatec/wk_wars2x.git
synced 2026-04-01 08:26:27 +02:00
State fix for Lua side
This commit is contained in:
@@ -208,7 +208,7 @@ end
|
|||||||
|
|
||||||
function RADAR:ToggleDisplayState()
|
function RADAR:ToggleDisplayState()
|
||||||
self.vars.displayed = not self.vars.displayed
|
self.vars.displayed = not self.vars.displayed
|
||||||
SendNUIMessage( { _type = "toggleDisplay" } )
|
SendNUIMessage( { _type = "toggleDisplay", state = self:GetDisplayState() } )
|
||||||
end
|
end
|
||||||
|
|
||||||
function RADAR:GetDisplayState()
|
function RADAR:GetDisplayState()
|
||||||
@@ -1039,10 +1039,10 @@ end )
|
|||||||
function RADAR:RunDisplayValidationCheck()
|
function RADAR:RunDisplayValidationCheck()
|
||||||
if ( ( ( PLY.veh == 0 or ( PLY.veh > 0 and not PLY.vehClassValid ) ) and self:GetDisplayState() and not self:GetDisplayHidden() ) or IsPauseMenuActive() and self:GetDisplayState() ) then
|
if ( ( ( PLY.veh == 0 or ( PLY.veh > 0 and not PLY.vehClassValid ) ) and self:GetDisplayState() and not self:GetDisplayHidden() ) or IsPauseMenuActive() and self:GetDisplayState() ) then
|
||||||
self:SetDisplayHidden( true )
|
self:SetDisplayHidden( true )
|
||||||
SendNUIMessage( { _type = "hideDisplay", state = true } )
|
SendNUIMessage( { _type = "toggleDisplay", state = false } )
|
||||||
elseif ( PLY.veh > 0 and PLY.vehClassValid and self:GetDisplayState() and self:GetDisplayHidden() ) then
|
elseif ( PLY.veh > 0 and PLY.vehClassValid and self:GetDisplayState() and self:GetDisplayHidden() ) then
|
||||||
self:SetDisplayHidden( false )
|
self:SetDisplayHidden( false )
|
||||||
SendNUIMessage( { _type = "hideDisplay", state = false } )
|
SendNUIMessage( { _type = "toggleDisplay", state = true } )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user