mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Progress
* Added USERFLAG class to manage user flags * Added USERSOUND class to manage sounds * Added SET_BASE:GetSetNames() to return an array of the object names of a Set. (Created dynamic lists based on mission editor groups defined). * Added SET_BASE:GetSetObjects() * Revised the Messages * Optimized the code for GetScannedCoalition * Markings text optimized for ZONE_CAPTURE_COALITION. Now the owning coalition is also shown. * Removed the stupid naming of messages to coalitions.
This commit is contained in:
@@ -634,8 +634,31 @@ function ZONE_RADIUS:CountScannedCoalitions()
|
||||
end
|
||||
|
||||
|
||||
--- Get Coalitions of the units in the Zone, or Check if there are units of the given Coalition in the Zone.
|
||||
-- Returns nil if there are none ot two Coalitions in the zone!
|
||||
-- Returns one Coalition if there are only Units of one Coalition in the Zone.
|
||||
-- Returns the Coalition for the given Coalition if there are units of the Coalition in the Zone
|
||||
-- @param #ZONE_RADIUS self
|
||||
-- @return #table
|
||||
function ZONE_RADIUS:GetScannedCoalition( Coalition )
|
||||
return self.ScanData.Coalitions[Coalition]
|
||||
|
||||
if Coalition then
|
||||
return self.ScanData.Coalitions[Coalition]
|
||||
else
|
||||
local Count = 0
|
||||
local ReturnCoalition = nil
|
||||
|
||||
for CoalitionID, Coalition in pairs( self.ScanData.Coalitions ) do
|
||||
Count = Count + 1
|
||||
ReturnCoalition = CoalitionID
|
||||
end
|
||||
|
||||
if Count ~= 1 then
|
||||
ReturnCoalition = nil
|
||||
end
|
||||
|
||||
return ReturnCoalition
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -699,26 +722,6 @@ function ZONE_RADIUS:IsNoneInZone()
|
||||
end
|
||||
|
||||
|
||||
--- Get the Zone Coalitions.
|
||||
-- Returns nil if there are none ot two coalitions in the zone!
|
||||
-- @param #ZONE_RADIUS self
|
||||
-- @return Coalitions
|
||||
function ZONE_RADIUS:GetCoalition()
|
||||
|
||||
local Count = 0
|
||||
local ReturnCoalition = nil
|
||||
|
||||
for CoalitionID, Coalition in pairs( self.Coalitions ) do
|
||||
Count = Count + 1
|
||||
ReturnCoalition = CoalitionID
|
||||
end
|
||||
|
||||
if Count ~= 1 then
|
||||
ReturnCoalition = nil
|
||||
end
|
||||
|
||||
return ReturnCoalition
|
||||
end
|
||||
|
||||
|
||||
--- Searches the zone
|
||||
|
||||
Reference in New Issue
Block a user