* 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:
FlightControl_Master
2017-10-10 11:06:05 +02:00
parent 9bfca83804
commit 6f151a6c5d
8 changed files with 287 additions and 40 deletions

View File

@@ -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