mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
[Added] OPSZONE:SetDrawZoneForCoalition to set if zone is drawn on the F10 map for the owner coalition only instead for all. Useful for recon tasking and fog of war.
This commit is contained in:
parent
46d2c9c196
commit
93cff96794
@ -490,6 +490,19 @@ function OPSZONE:SetDrawZone(Switch)
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Set if zone is drawn on the F10 map for the owner coalition only.
|
||||||
|
-- @param #OPSZONE self
|
||||||
|
-- @param #boolean Switch If `false` or `nil`, draw zone for all coalitions. If `true`, zone is drawn for the owning coalition only if drawZone is true.
|
||||||
|
-- @return #OPSZONE self
|
||||||
|
function OPSZONE:SetDrawZoneForCoalition(Switch)
|
||||||
|
if Switch==true then
|
||||||
|
self.drawZoneForCoalition=true
|
||||||
|
else
|
||||||
|
self.drawZoneForCoalition=false
|
||||||
|
end
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- Set if a marker on the F10 map shows the current zone status.
|
--- Set if a marker on the F10 map shows the current zone status.
|
||||||
-- @param #OPSZONE self
|
-- @param #OPSZONE self
|
||||||
-- @param #boolean Switch If `true`, zone is marked. If `false` or `nil`, zone is not marked.
|
-- @param #boolean Switch If `true`, zone is marked. If `false` or `nil`, zone is not marked.
|
||||||
@ -838,7 +851,11 @@ function OPSZONE:onafterCaptured(From, Event, To, NewOwnerCoalition)
|
|||||||
|
|
||||||
local color=self:_GetZoneColor()
|
local color=self:_GetZoneColor()
|
||||||
|
|
||||||
self.zone:DrawZone(nil, color, 1.0, color, 0.5)
|
local coalition = nil
|
||||||
|
if self.drawZoneForCoalition then
|
||||||
|
coalition = self.ownerCurrent
|
||||||
|
end
|
||||||
|
self.zone:DrawZone(coalition, color, 1.0, color, 0.5)
|
||||||
end
|
end
|
||||||
|
|
||||||
for _,_chief in pairs(self.chiefs) do
|
for _,_chief in pairs(self.chiefs) do
|
||||||
@ -914,7 +931,11 @@ function OPSZONE:onenterGuarded(From, Event, To)
|
|||||||
|
|
||||||
local color=self:_GetZoneColor()
|
local color=self:_GetZoneColor()
|
||||||
|
|
||||||
self.zone:DrawZone(nil, color, 1.0, color, 0.5)
|
local coalition = nil
|
||||||
|
if self.drawZoneForCoalition then
|
||||||
|
coalition = self.ownerCurrent
|
||||||
|
end
|
||||||
|
self.zone:DrawZone(coalition, color, 1.0, color, 0.5)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
@ -955,8 +976,12 @@ function OPSZONE:onenterAttacked(From, Event, To, AttackerCoalition)
|
|||||||
-- Color.
|
-- Color.
|
||||||
local color={1, 204/255, 204/255}
|
local color={1, 204/255, 204/255}
|
||||||
|
|
||||||
|
local coalition = nil
|
||||||
|
if self.drawZoneForCoalition then
|
||||||
|
coalition = self.ownerCurrent
|
||||||
|
end
|
||||||
-- Draw zone.
|
-- Draw zone.
|
||||||
self.zone:DrawZone(nil, color, 1.0, color, 0.5)
|
self.zone:DrawZone(coalition, color, 1.0, color, 0.5)
|
||||||
end
|
end
|
||||||
|
|
||||||
self:_CleanMissionTable()
|
self:_CleanMissionTable()
|
||||||
@ -988,7 +1013,11 @@ function OPSZONE:onenterEmpty(From, Event, To)
|
|||||||
|
|
||||||
local color=self:_GetZoneColor()
|
local color=self:_GetZoneColor()
|
||||||
|
|
||||||
self.zone:DrawZone(nil, color, 1.0, color, 0.2)
|
local coalition = nil
|
||||||
|
if self.drawZoneForCoalition then
|
||||||
|
coalition = self.ownerCurrent
|
||||||
|
end
|
||||||
|
self.zone:DrawZone(coalition, color, 1.0, color, 0.2)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user