diff --git a/Moose Development/Moose/Tasking/CommandCenter.lua b/Moose Development/Moose/Tasking/CommandCenter.lua index a3a965aab..1c03860e8 100644 --- a/Moose Development/Moose/Tasking/CommandCenter.lua +++ b/Moose Development/Moose/Tasking/CommandCenter.lua @@ -146,7 +146,7 @@ function COMMANDCENTER:New( CommandCenterPositionable, CommandCenterName ) local Mission = Mission -- Tasking.Mission#MISSION local PlayerGroup = EventData.IniGroup -- The GROUP object should be filled! Mission:JoinUnit( PlayerUnit, PlayerGroup ) - Mission:ReportDetails() + Mission:ReportDetails( PlayerGroup ) end end ) diff --git a/Moose Development/Moose/Tasking/Mission.lua b/Moose Development/Moose/Tasking/Mission.lua index 9c84e182c..27da36054 100644 --- a/Moose Development/Moose/Tasking/Mission.lua +++ b/Moose Development/Moose/Tasking/Mission.lua @@ -220,6 +220,33 @@ function MISSION:New( CommandCenter, MissionName, MissionPriority, MissionBriefi -- @param #MISSION self -- @param #number Delay The delay in seconds. + + self:AddTransition( "*", "MissionGoals", "*" ) + + --- MissionGoals Handler OnBefore for MISSION + -- @function [parent=#MISSION] OnBeforeMissionGoals + -- @param #MISSION self + -- @param #string From + -- @param #string Event + -- @param #string To + -- @return #boolean + + --- MissionGoals Handler OnAfter for MISSION + -- @function [parent=#MISSION] OnAfterMissionGoals + -- @param #MISSION self + -- @param #string From + -- @param #string Event + -- @param #string To + + --- MissionGoals Trigger for MISSION + -- @function [parent=#MISSION] MissionGoals + -- @param #MISSION self + + --- MissionGoals Asynchronous Trigger for MISSION + -- @function [parent=#MISSION] __MissionGoals + -- @param #MISSION self + -- @param #number Delay + -- Private implementations CommandCenter:SetMenu() @@ -780,14 +807,14 @@ function MISSION:ReportOverview( ReportGroup, TaskStatus ) local Status = self:GetState() local TasksRemaining = self:GetTasksRemaining() - Report:Add( string.format( '%s - Status "%s"', Name, Status ) ) + Report:Add( string.format( '%s - %s - %s Tasks', Name, Status, TaskStatus ) ) -- Determine how many tasks are remaining. local TasksRemaining = 0 for TaskID, Task in pairs( self:GetTasks() ) do local Task = Task -- Tasking.Task#TASK if Task:Is( TaskStatus ) then - Report:Add( "\n - " .. Task:ReportOverview( ReportGroup ) ) + Report:Add( " - " .. Task:ReportOverview( ReportGroup ) ) end end diff --git a/Moose Development/Moose/Tasking/Task.lua b/Moose Development/Moose/Tasking/Task.lua index ac84be507..2a6bc2a2f 100644 --- a/Moose Development/Moose/Tasking/Task.lua +++ b/Moose Development/Moose/Tasking/Task.lua @@ -1174,7 +1174,7 @@ function TASK:onenterSuccess( From, Event, To ) self:GetMission():GetCommandCenter():MessageToCoalition( "Task " .. self:GetName() .. " is successful! Good job!" ) self:UnAssignFromGroups() - --self:GetMission():__Complete( 1 ) + self:GetMission():__MissionGoals( 1 ) end @@ -1312,14 +1312,14 @@ function TASK:ReportOverview( ReportGroup ) --R2.1 fixed report. Now nicely form -- List the name of the Task. local Name = self:GetName() - local Report = REPORT:New( "Task " .. Name ) + local Report = REPORT:New( Name ) -- Determine the status of the Task. local State = self:GetState() for TaskInfoID, TaskInfo in pairs( self.TaskInfo ) do - local TaskInfoIDText = string.format( " - %s: ", TaskInfoID ) + local TaskInfoIDText = string.format( "%s: ", TaskInfoID ) if type(TaskInfo) == "string" then Report:Add( TaskInfoIDText .. TaskInfo ) @@ -1327,8 +1327,8 @@ function TASK:ReportOverview( ReportGroup ) --R2.1 fixed report. Now nicely form if TaskInfoID == "Coordinates" then local FromCoordinate = ReportGroup:GetUnit(1):GetCoordinate() local ToCoordinate = TaskInfo -- Core.Point#COORDINATE - Report:Add( TaskInfoIDText ) - Report:AddIndent( ToCoordinate:ToStringBRA( FromCoordinate ) .. ", " .. TaskInfo:ToStringAspect( FromCoordinate ) ) + --Report:Add( TaskInfoIDText ) + Report:Add( ToCoordinate:ToString( ReportGroup ) ) --Report:AddIndent( ToCoordinate:ToStringBULLS( ReportGroup:GetCoalition() ) ) else end diff --git a/Moose Development/Moose/Tasking/Task_A2A.lua b/Moose Development/Moose/Tasking/Task_A2A.lua index aa9092ab1..2590a06f9 100644 --- a/Moose Development/Moose/Tasking/Task_A2A.lua +++ b/Moose Development/Moose/Tasking/Task_A2A.lua @@ -373,7 +373,7 @@ do -- TASK_A2A_INTERCEPT local TargetCoordinate = TargetSetUnit:GetFirst():GetCoordinate() self:SetInfo( "Coordinates", TargetCoordinate ) - self:SetInfo( "ThreatLevel", "[" .. string.rep( "■", TargetSetUnit:CalculateThreatLevelA2G() ) .. "]" ) + self:SetInfo( "Threat", "[" .. string.rep( "■", TargetSetUnit:CalculateThreatLevelA2G() ) .. "]" ) local DetectedItemsCount = TargetSetUnit:Count() local DetectedItemsTypes = TargetSetUnit:GetTypeNames() self:SetInfo( "Targets", string.format( "%d of %s", DetectedItemsCount, DetectedItemsTypes ) ) @@ -420,7 +420,7 @@ do -- TASK_A2A_ENGAGE local TargetCoordinate = TargetSetUnit:GetFirst():GetCoordinate() self:SetInfo( "Coordinates", TargetCoordinate ) - self:SetInfo( "ThreatLevel", "[" .. string.rep( "■", TargetSetUnit:CalculateThreatLevelA2G() ) .. "]" ) + self:SetInfo( "Threat", "[" .. string.rep( "■", TargetSetUnit:CalculateThreatLevelA2G() ) .. "]" ) local DetectedItemsCount = TargetSetUnit:Count() local DetectedItemsTypes = TargetSetUnit:GetTypeNames() self:SetInfo( "Targets", string.format( "%d of %s", DetectedItemsCount, DetectedItemsTypes ) ) diff --git a/Moose Development/Moose/Tasking/Task_A2G.lua b/Moose Development/Moose/Tasking/Task_A2G.lua index 9ad9ca03e..2a387ffef 100644 --- a/Moose Development/Moose/Tasking/Task_A2G.lua +++ b/Moose Development/Moose/Tasking/Task_A2G.lua @@ -383,7 +383,7 @@ do -- TASK_SEAD local TargetCoordinate = TargetSetUnit:GetFirst():GetCoordinate() self:SetInfo( "Coordinates", TargetCoordinate ) - self:SetInfo( "ThreatLevel", "[" .. string.rep( "■", TargetSetUnit:CalculateThreatLevelA2G() ) .. "]" ) + self:SetInfo( "Threat", "[" .. string.rep( "■", TargetSetUnit:CalculateThreatLevelA2G() ) .. "]" ) local DetectedItemsCount = TargetSetUnit:Count() local DetectedItemsTypes = TargetSetUnit:GetTypeNames() self:SetInfo( "Targets", string.format( "%d of %s", DetectedItemsCount, DetectedItemsTypes ) ) @@ -425,7 +425,7 @@ do -- TASK_BAI local TargetCoordinate = TargetSetUnit:GetFirst():GetCoordinate() self:SetInfo( "Coordinates", TargetCoordinate ) - self:SetInfo( "ThreatLevel", "[" .. string.rep( "■", TargetSetUnit:CalculateThreatLevelA2G() ) .. "]" ) + self:SetInfo( "Threat", "[" .. string.rep( "■", TargetSetUnit:CalculateThreatLevelA2G() ) .. "]" ) local DetectedItemsCount = TargetSetUnit:Count() local DetectedItemsTypes = TargetSetUnit:GetTypeNames() self:SetInfo( "Targets", string.format( "%d of %s", DetectedItemsCount, DetectedItemsTypes ) ) @@ -468,7 +468,7 @@ do -- TASK_CAS local TargetCoordinate = TargetSetUnit:GetFirst():GetCoordinate() self:SetInfo( "Coordinates", TargetCoordinate ) - self:SetInfo( "ThreatLevel", "[" .. string.rep( "■", TargetSetUnit:CalculateThreatLevelA2G() ) .. "]" ) + self:SetInfo( "Threat", "[" .. string.rep( "■", TargetSetUnit:CalculateThreatLevelA2G() ) .. "]" ) local DetectedItemsCount = TargetSetUnit:Count() local DetectedItemsTypes = TargetSetUnit:GetTypeNames() self:SetInfo( "Targets", string.format( "%d of %s", DetectedItemsCount, DetectedItemsTypes ) ) diff --git a/Moose Development/Moose/Wrapper/Group.lua b/Moose Development/Moose/Wrapper/Group.lua index 3f48805c4..1f63046ff 100644 --- a/Moose Development/Moose/Wrapper/Group.lua +++ b/Moose Development/Moose/Wrapper/Group.lua @@ -426,6 +426,24 @@ function GROUP:GetTypeName() return nil end +--- Gets the player name of the group. +-- @param #GROUP self +-- @return #string The player name of the group. +function GROUP:GetPlayerName() + self:F2( self.GroupName ) + + local DCSGroup = self:GetDCSObject() + + if DCSGroup then + local PlayerName = DCSGroup:getUnit(1):getPlayerName() + self:T3( PlayerName ) + return( PlayerName ) + end + + return nil +end + + --- Gets the CallSign of the first DCS Unit of the DCS Group. -- @param #GROUP self -- @return #string The CallSign of the first DCS Unit of the DCS Group.