Merge branch 'develop' into FF/Ops

This commit is contained in:
Frank 2024-04-04 09:34:37 +02:00
commit cec02bc44f
4 changed files with 22 additions and 21 deletions

View File

@ -1150,7 +1150,7 @@ end
-- @return #string Text
function BASE:_Serialize(Arguments)
local text = UTILS.PrintTableToLog({Arguments}, 0, true)
text = string.gsub(text,"\n","")
text = string.gsub(text,"(\n+)","")
text = string.gsub(text,"%(%(","%(")
text = string.gsub(text,"%)%)","%)")
text = string.gsub(text,"(%s+)","")

View File

@ -3148,17 +3148,18 @@ do -- COORDINATE
-- @param #string Northing Meters northing - string in order to allow for leading zeros, e.g. "12340". Should be 5 digits.
-- @return #COORDINATE self
function COORDINATE:NewFromMGRS( UTMZone, MGRSDigraph, Easting, Northing )
if string.len(Easting) < 5 then Easting = Easting..string.rep("0",5-string.len(Easting) )end
if string.len(Northing) < 5 then Northing = Northing..string.rep("0",5-string.len(Northing) )end
if string.len(Easting) < 5 then Easting = tostring(Easting..string.rep("0",5-string.len(Easting) )) end
if string.len(Northing) < 5 then Northing = tostring(Northing..string.rep("0",5-string.len(Northing) )) end
local MGRS = {
UTMZone = UTMZone,
MGRSDigraph = MGRSDigraph,
Easting = Easting,
Northing = Northing,
Easting = tostring(Easting),
Northing = tostring(Northing),
}
local lat, lon = coord.MGRStoLL(MGRS)
local point = coord.LLtoLO(lat, lon, 0)
local coord = COORDINATE:NewFromVec2({x=point.x,y=point.z})
return coord
end
--- Provides a coordinate string of the point, based on a coordinate format system:

View File

@ -597,7 +597,7 @@ function OPSGROUP:New(group)
if units then
local masterunit=units[1] --Wrapper.Unit#UNIT
if unit then
if masterunit then
-- Get Descriptors.
self.descriptors=masterunit:GetDesc()

View File

@ -175,19 +175,19 @@ do -- TASK_A2G
end
--- @param #TASK_A2G self
-- @param #TASK_A2G self
-- @param Core.Set#SET_UNIT TargetSetUnit The set of targets.
function TASK_A2G:SetTargetSetUnit( TargetSetUnit )
self.TargetSetUnit = TargetSetUnit
end
--- @param #TASK_A2G self
-- @param #TASK_A2G self
function TASK_A2G:GetPlannedMenuText()
return self:GetStateString() .. " - " .. self:GetTaskName() .. " ( " .. self.TargetSetUnit:GetUnitTypesText() .. " )"
end
--- @param #TASK_A2G self
-- @param #TASK_A2G self
-- @param Core.Point#COORDINATE RendezVousCoordinate The Coordinate object referencing to the 2D point where the RendezVous point is located on the map.
-- @param #number RendezVousRange The RendezVousRange that defines when the player is considered to have arrived at the RendezVous point.
-- @param Wrapper.Unit#UNIT TaskUnit
@ -200,7 +200,7 @@ do -- TASK_A2G
ActRouteRendezVous:SetRange( RendezVousRange )
end
--- @param #TASK_A2G self
-- @param #TASK_A2G self
-- @param Wrapper.Unit#UNIT TaskUnit
-- @return Core.Point#COORDINATE The Coordinate object referencing to the 2D point where the RendezVous point is located on the map.
-- @return #number The RendezVousRange that defines when the player is considered to have arrived at the RendezVous point.
@ -212,7 +212,7 @@ do -- TASK_A2G
return ActRouteRendezVous:GetCoordinate(), ActRouteRendezVous:GetRange()
end
--- @param #TASK_A2G self
-- @param #TASK_A2G self
-- @param Core.Zone#ZONE_BASE RendezVousZone The Zone object where the RendezVous is located on the map.
-- @param Wrapper.Unit#UNIT TaskUnit
function TASK_A2G:SetRendezVousZone( RendezVousZone, TaskUnit )
@ -223,7 +223,7 @@ do -- TASK_A2G
ActRouteRendezVous:SetZone( RendezVousZone )
end
--- @param #TASK_A2G self
-- @param #TASK_A2G self
-- @param Wrapper.Unit#UNIT TaskUnit
-- @return Core.Zone#ZONE_BASE The Zone object where the RendezVous is located on the map.
function TASK_A2G:GetRendezVousZone( TaskUnit )
@ -234,7 +234,7 @@ do -- TASK_A2G
return ActRouteRendezVous:GetZone()
end
--- @param #TASK_A2G self
-- @param #TASK_A2G self
-- @param Core.Point#COORDINATE TargetCoordinate The Coordinate object where the Target is located on the map.
-- @param Wrapper.Unit#UNIT TaskUnit
function TASK_A2G:SetTargetCoordinate( TargetCoordinate, TaskUnit )
@ -245,7 +245,7 @@ do -- TASK_A2G
ActRouteTarget:SetCoordinate( TargetCoordinate )
end
--- @param #TASK_A2G self
-- @param #TASK_A2G self
-- @param Wrapper.Unit#UNIT TaskUnit
-- @return Core.Point#COORDINATE The Coordinate object where the Target is located on the map.
function TASK_A2G:GetTargetCoordinate( TaskUnit )
@ -256,7 +256,7 @@ do -- TASK_A2G
return ActRouteTarget:GetCoordinate()
end
--- @param #TASK_A2G self
-- @param #TASK_A2G self
-- @param Core.Zone#ZONE_BASE TargetZone The Zone object where the Target is located on the map.
-- @param Wrapper.Unit#UNIT TaskUnit
function TASK_A2G:SetTargetZone( TargetZone, TaskUnit )
@ -267,7 +267,7 @@ do -- TASK_A2G
ActRouteTarget:SetZone( TargetZone )
end
--- @param #TASK_A2G self
-- @param #TASK_A2G self
-- @param Wrapper.Unit#UNIT TaskUnit
-- @return Core.Zone#ZONE_BASE The Zone object where the Target is located on the map.
function TASK_A2G:GetTargetZone( TaskUnit )
@ -280,7 +280,7 @@ do -- TASK_A2G
function TASK_A2G:SetGoalTotal()
self.GoalTotal = self.TargetSetUnit:Count()
self.GoalTotal = self.TargetSetUnit:CountAlive()
end
function TASK_A2G:GetGoalTotal()
@ -304,14 +304,14 @@ do -- TASK_A2G
function TASK_A2G:onafterGoal( TaskUnit, From, Event, To )
local TargetSetUnit = self.TargetSetUnit -- Core.Set#SET_UNIT
if TargetSetUnit:Count() == 0 then
if TargetSetUnit:CountAlive() == 0 then
self:Success()
end
self:__Goal( -10 )
end
--- @param #TASK_A2G self
-- @param #TASK_A2G self
function TASK_A2G:UpdateTaskInfo( DetectedItem )
if self:IsStatePlanned() or self:IsStateAssigned() then
@ -328,7 +328,7 @@ do -- TASK_A2G
self.TaskInfo:AddThreat( ThreatText, ThreatLevel, 10, "MOD", true )
if self.Detection then
local DetectedItemsCount = self.TargetSetUnit:Count()
local DetectedItemsCount = self.TargetSetUnit:CountAlive()
local ReportTypes = REPORT:New()
local TargetTypes = {}
for TargetUnitName, TargetUnit in pairs( self.TargetSetUnit:GetSet() ) do
@ -341,7 +341,7 @@ do -- TASK_A2G
self.TaskInfo:AddTargetCount( DetectedItemsCount, 11, "O", true )
self.TaskInfo:AddTargets( DetectedItemsCount, ReportTypes:Text( ", " ), 20, "D", true )
else
local DetectedItemsCount = self.TargetSetUnit:Count()
local DetectedItemsCount = self.TargetSetUnit:CountAlive()
local DetectedItemsTypes = self.TargetSetUnit:GetTypeNames()
self.TaskInfo:AddTargetCount( DetectedItemsCount, 11, "O", true )
self.TaskInfo:AddTargets( DetectedItemsCount, DetectedItemsTypes, 20, "D", true )