mirror of
https://github.com/Michatec/wk_wars2x.git
synced 2026-04-01 00:16:27 +02:00
feat: operator menu settings sent to passenger on change
This commit is contained in:
10
cl_radar.lua
10
cl_radar.lua
@@ -335,6 +335,10 @@ function RADAR:GetRadarDataForSync()
|
||||
}
|
||||
end
|
||||
|
||||
function RADAR:GetOMTableData()
|
||||
return self.vars.settings
|
||||
end
|
||||
|
||||
-- Sets the operator menu settings table within the radar's main variables table
|
||||
function RADAR:SetOMTableData( data )
|
||||
if ( type( data ) == "table" ) then
|
||||
@@ -772,6 +776,12 @@ function RADAR:CloseMenu( playAudio )
|
||||
-- Save the operator menu values
|
||||
local omData = json.encode( RADAR.vars.settings )
|
||||
SetResourceKvp( "wk_wars2x_om_data", omData )
|
||||
|
||||
-- Send the operator menu to the passenger if allowed
|
||||
if ( self:IsPassengerViewAllowed() ) then
|
||||
local updatedOMData = self:GetOMTableData()
|
||||
SYNC:SendUpdatedOMData( updatedOMData )
|
||||
end
|
||||
end
|
||||
|
||||
-- Returns if the operator menu is open
|
||||
|
||||
Reference in New Issue
Block a user