mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
- pushing fix for issue with command center reporting.
- pushing fix for issue with markings in cargo tasking not displayed. - i have removed the workaround for the DCS bug workaround, get the DCS API (getPlayerName()) for a unit is returning "" or nil.
This commit is contained in:
parent
dc41852e45
commit
a84f0e228a
@ -670,7 +670,7 @@ function COMMANDCENTER:ReportSummary( ReportGroup )
|
||||
|
||||
for MissionID, Mission in pairs( self.Missions ) do
|
||||
local Mission = Mission -- Tasking.Mission#MISSION
|
||||
Report:Add( " - " .. Mission:ReportSummary() )
|
||||
Report:Add( " - " .. Mission:ReportSummary( ReportGroup ) )
|
||||
end
|
||||
|
||||
self:MessageToGroup( Report:Text(), ReportGroup )
|
||||
|
||||
@ -1200,15 +1200,27 @@ function TASK:MenuMarkToGroup( TaskGroup )
|
||||
|
||||
self:UpdateTaskInfo( self.DetectedItem )
|
||||
|
||||
local TargetCoordinates = self.TaskInfo:GetData( "Coordinates" ) -- Core.Point#COORDINATE
|
||||
if TargetCoordinates then
|
||||
for TargetCoordinateID, TargetCoordinate in pairs( TargetCoordinates ) do
|
||||
local Report = REPORT:New():SetIndent( 0 )
|
||||
|
||||
self.TaskInfo:Report( Report, "M", TaskGroup )
|
||||
|
||||
local TargetCoordinate = self.TaskInfo:GetData( "Coordinate" ) -- Core.Point#COORDINATE
|
||||
self.TaskInfo:Report( Report, "M", TaskGroup, TargetCoordinateID )
|
||||
local MarkText = Report:Text( ", " )
|
||||
self:F( { Coordinate = TargetCoordinate, MarkText = MarkText } )
|
||||
TargetCoordinate:MarkToGroup( MarkText, TaskGroup )
|
||||
--Coordinate:MarkToAll( Briefing )
|
||||
end
|
||||
else
|
||||
local TargetCoordinate = self.TaskInfo:GetData( "Coordinate" ) -- Core.Point#COORDINATE
|
||||
if TargetCoordinate then
|
||||
local Report = REPORT:New():SetIndent( 0 )
|
||||
self.TaskInfo:Report( Report, "M", TaskGroup )
|
||||
local MarkText = Report:Text( ", " )
|
||||
self:F( { Coordinate = TargetCoordinate, MarkText = MarkText } )
|
||||
TargetCoordinate:MarkToGroup( MarkText, TaskGroup )
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
--- Report the task status.
|
||||
|
||||
@ -85,7 +85,7 @@ end
|
||||
-- @return Data The data of the info.
|
||||
function TASKINFO:GetData( Key )
|
||||
local Object = self.Info:Get( Key )
|
||||
return Object.Data
|
||||
return Object and Object.Data
|
||||
end
|
||||
|
||||
|
||||
@ -130,6 +130,19 @@ function TASKINFO:AddCoordinate( Coordinate, Order, Detail, Keep )
|
||||
end
|
||||
|
||||
|
||||
--- Add Coordinates.
|
||||
-- @param #TASKINFO self
|
||||
-- @param #list<Core.Point#COORDINATE> Coordinates
|
||||
-- @param #number Order The display order, which is a number from 0 to 100.
|
||||
-- @param #TASKINFO.Detail Detail The detail Level.
|
||||
-- @param #boolean Keep (optional) If true, this would indicate that the planned taskinfo would be persistent when the task is completed, so that the original planned task info is used at the completed reports.
|
||||
-- @return #TASKINFO self
|
||||
function TASKINFO:AddCoordinates( Coordinates, Order, Detail, Keep )
|
||||
self:AddInfo( "Coordinates", Coordinates, Order, Detail, Keep )
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
|
||||
--- Add Threat.
|
||||
-- @param #TASKINFO self
|
||||
@ -260,6 +273,7 @@ function TASKINFO:AddCargoSet( SetCargo, Order, Detail, Keep )
|
||||
|
||||
self:AddInfo( "Cargo", CargoReport:Text(), Order, Detail, Keep )
|
||||
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
@ -1361,10 +1361,19 @@ do -- TASK_CARGO
|
||||
end
|
||||
|
||||
--- @param #TASK_CARGO self
|
||||
function TASK_CARGO:UpdateTaskInfo( DetectedItem )
|
||||
function TASK_CARGO:UpdateTaskInfo()
|
||||
|
||||
if self:IsStatePlanned() or self:IsStateAssigned() then
|
||||
self.TaskInfo:AddTaskName( 0, "MSOD" )
|
||||
self.TaskInfo:AddCargoSet( self.SetCargo, 10, "SOD", true )
|
||||
local Coordinates = {}
|
||||
for CargoName, Cargo in pairs( self.SetCargo:GetSet() ) do
|
||||
local Cargo = Cargo -- Cargo.Cargo#CARGO
|
||||
if not Cargo:IsLoaded() then
|
||||
Coordinates[#Coordinates+1] = Cargo:GetCoordinate()
|
||||
end
|
||||
end
|
||||
self.TaskInfo:AddCoordinates( Coordinates, 1, "M" )
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@ -332,12 +332,12 @@ function UNIT:GetPlayerName()
|
||||
|
||||
local PlayerName = DCSUnit:getPlayerName()
|
||||
-- TODO Workaround DCS-BUG-3 - https://github.com/FlightControl-Master/MOOSE/issues/696
|
||||
if PlayerName == nil or PlayerName == "" then
|
||||
local PlayerCategory = DCSUnit:getDesc().category
|
||||
if PlayerCategory == Unit.Category.GROUND_UNIT or PlayerCategory == Unit.Category.SHIP then
|
||||
PlayerName = "Player" .. DCSUnit:getID()
|
||||
end
|
||||
end
|
||||
-- if PlayerName == nil or PlayerName == "" then
|
||||
-- local PlayerCategory = DCSUnit:getDesc().category
|
||||
-- if PlayerCategory == Unit.Category.GROUND_UNIT or PlayerCategory == Unit.Category.SHIP then
|
||||
-- PlayerName = "Player" .. DCSUnit:getID()
|
||||
-- end
|
||||
-- end
|
||||
-- -- Good code
|
||||
-- if PlayerName == nil then
|
||||
-- PlayerName = nil
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user