mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge pull request #471 from FlightControl-Master/386-ai-designate
386 ai designate
This commit is contained in:
commit
292642c1f5
@ -1777,9 +1777,12 @@ do -- DETECTION_TYPES
|
||||
|
||||
local DetectedItemCoordinate = DetectedItemUnit:GetCoordinate()
|
||||
local DetectedItemCoordText = DetectedItemCoordinate:ToString()
|
||||
|
||||
self:E( { DetectedItemID,
|
||||
DetectedItemCoordText } )
|
||||
|
||||
local ReportSummary = string.format(
|
||||
"%S - %s",
|
||||
"%s - %s",
|
||||
DetectedItemID,
|
||||
DetectedItemCoordText
|
||||
)
|
||||
@ -1813,7 +1816,7 @@ do -- DETECTION_TYPES
|
||||
local DetectedItemCoordText = DetectedItemCoordinate:ToString()
|
||||
|
||||
local ReportSummary = string.format(
|
||||
"%S - %s - Threat:[%s](%2d) - %2d of %s",
|
||||
"%s - %s - Threat:[%s](%2d) - %2d of %s",
|
||||
DetectedItemID,
|
||||
DetectedItemCoordText,
|
||||
string.rep( "■", ThreatLevelA2G ),
|
||||
|
||||
@ -17,7 +17,7 @@ REPORT = {
|
||||
-- @return #REPORT
|
||||
function REPORT:New( Title )
|
||||
|
||||
local self = BASE:Inherit( self, BASE:New() )
|
||||
local self = BASE:Inherit( self, BASE:New() ) -- #REPORT
|
||||
|
||||
self.Report = {}
|
||||
if Title then
|
||||
@ -27,13 +27,32 @@ function REPORT:New( Title )
|
||||
return self
|
||||
end
|
||||
|
||||
--- Set indent of a REPORT.
|
||||
-- @param #REPORT self
|
||||
-- @param #number Indent
|
||||
-- @return #REPORT
|
||||
function REPORT:SetIndent( Indent )
|
||||
self.Indent = Indent
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
--- Add a new line to a REPORT.
|
||||
-- @param #REPORT self
|
||||
-- @param #string Text
|
||||
-- @return #REPORT
|
||||
function REPORT:Add( Text )
|
||||
self.Report[#self.Report+1] = Text
|
||||
return self.Report[#self.Report]
|
||||
return self
|
||||
end
|
||||
|
||||
--- Add a new line to a REPORT.
|
||||
-- @param #REPORT self
|
||||
-- @param #string Text
|
||||
-- @return #REPORT
|
||||
function REPORT:AddIndent( Text )
|
||||
self.Report[#self.Report+1] = string.rep(" ", self.Indent ) .. Text
|
||||
return self
|
||||
end
|
||||
|
||||
--- Produces the text of the report, taking into account an optional delimeter, which is \n by default.
|
||||
|
||||
@ -563,7 +563,7 @@ function TASK:SetMenu( MenuTime )
|
||||
MENU_GROUP_COMMAND:New( TaskGroup, "Report Failed Tasks", TaskGroup.MenuReports, Mission.MenuReportOverview, Mission, TaskGroup, "Failed" )
|
||||
MENU_GROUP_COMMAND:New( TaskGroup, "Report Held Tasks", TaskGroup.MenuReports, Mission.MenuReportOverview, Mission, TaskGroup, "Hold" )
|
||||
end
|
||||
|
||||
|
||||
if self:IsStatePlanned() or self:IsStateReplanned() then
|
||||
self:SetMenuForGroup( TaskGroup, MenuTime )
|
||||
end
|
||||
@ -1196,7 +1196,7 @@ end
|
||||
-- @return #string
|
||||
function TASK:ReportDetails()
|
||||
|
||||
local Report = REPORT:New()
|
||||
local Report = REPORT:New():SetIndent( 3 )
|
||||
|
||||
-- List the name of the Task.
|
||||
local Name = self:GetName()
|
||||
@ -1206,23 +1206,29 @@ function TASK:ReportDetails()
|
||||
|
||||
-- Loop each Unit active in the Task, and find Player Names.
|
||||
local PlayerNames = {}
|
||||
local PlayerReport = REPORT:New( "\n Players:" )
|
||||
local PlayerReport = REPORT:New()
|
||||
for PlayerGroupID, PlayerGroupData in pairs( self:GetGroups():GetSet() ) do
|
||||
|
||||
local PlayerGroup = PlayerGroupData -- Wrapper.Group#GROUP
|
||||
|
||||
PlayerNames = PlayerGroup:GetPlayerNames()
|
||||
if PlayerNames then
|
||||
PlayerReport:Add( " Group " .. PlayerGroup:GetCallsign() .. ": " .. table.concat( PlayerNames, ", " ) )
|
||||
PlayerReport:Add( "Group " .. PlayerGroup:GetCallsign() .. ": " .. table.concat( PlayerNames, ", " ) )
|
||||
end
|
||||
end
|
||||
|
||||
local Detection = self.TaskInfo["Detection"] and "\n Detection: " .. self.TaskInfo["Detection"] or ""
|
||||
local Changes = self.TaskInfo["Changes"] and "\n Changes: " .. self.TaskInfo["Changes"] or ""
|
||||
local Players = PlayerReport:Text()
|
||||
|
||||
Report:Add( "Task " .. Name .. Players .. Detection .. Changes )
|
||||
local Detection = self.TaskInfo["Detection"] or ""
|
||||
local Changes = self.TaskInfo["Changes"] or ""
|
||||
|
||||
Report:Add( "Task: " .. Name .. " - " .. State .. " - Detailed Report" )
|
||||
Report:Add( " - Players: " )
|
||||
Report:AddIndent( Players )
|
||||
Report:Add( " - Detection: " )
|
||||
Report:AddIndent( Detection )
|
||||
Report:Add( " - Detection Changes: \n" )
|
||||
Report:AddIndent( Changes )
|
||||
|
||||
-- Loop each Process in the Task, and find Reporting Details.
|
||||
Report:Add( string.format( "Task %s\n -- State '%s'\n%s", Name, State, PlayerReport:Text() ) )
|
||||
return Report:Text()
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user