This commit is contained in:
FlightControl 2016-11-27 20:06:49 +01:00
parent 28802ba276
commit 68e3472c49
7 changed files with 26 additions and 26 deletions

View File

@ -111,6 +111,17 @@ function COMMANDCENTER:RemoveMission( Mission )
return Mission return Mission
end end
--- Sets the menu structure of the Missions governed by the HQ command center.
-- @param #COMMANDCENTER self
function COMMANDCENTER:SetMenu()
for MissionID, Mission in pairs( self.Missions ) do
local Mission = Mission -- Tasking.Mission#MISSION
Mission:SetMenu()
end
end
--- Checks of the COMMANDCENTER has a GROUP. --- Checks of the COMMANDCENTER has a GROUP.
-- @param #COMMANDCENTER self -- @param #COMMANDCENTER self
-- @param Wrapper.Group#GROUP -- @param Wrapper.Group#GROUP

View File

@ -1,4 +1,4 @@
--- This module contains the DETECTION_MANAGER class and derived classes. -- This module contains the DETECTION_MANAGER class and derived classes.
-- --
-- === -- ===
-- --
@ -426,7 +426,7 @@ do -- DETECTION_DISPATCHER
end end
if SEADTask and SEADTask:IsStatePlanned() then if SEADTask and SEADTask:IsStatePlanned() then
self:E( "Planned" ) self:E( "Planned" )
SEADTask:SetPlannedMenu() --SEADTask:SetPlannedMenu()
TaskMsg[#TaskMsg+1] = " - " .. SEADTask:GetStateString() .. " SEAD " .. AreaID .. " - " .. SEADTask.TargetSetUnit:GetUnitTypesText() TaskMsg[#TaskMsg+1] = " - " .. SEADTask:GetStateString() .. " SEAD " .. AreaID .. " - " .. SEADTask.TargetSetUnit:GetUnitTypesText()
end end
@ -440,7 +440,7 @@ do -- DETECTION_DISPATCHER
end end
end end
if CASTask and CASTask:IsStatePlanned() then if CASTask and CASTask:IsStatePlanned() then
CASTask:SetPlannedMenu() --CASTask:SetPlannedMenu()
TaskMsg[#TaskMsg+1] = " - " .. CASTask:GetStateString() .. " CAS " .. AreaID .. " - " .. CASTask.TargetSetUnit:GetUnitTypesText() TaskMsg[#TaskMsg+1] = " - " .. CASTask:GetStateString() .. " CAS " .. AreaID .. " - " .. CASTask.TargetSetUnit:GetUnitTypesText()
end end
@ -454,7 +454,7 @@ do -- DETECTION_DISPATCHER
end end
end end
if BAITask and BAITask:IsStatePlanned() then if BAITask and BAITask:IsStatePlanned() then
BAITask:SetPlannedMenu() --BAITask:SetPlannedMenu()
TaskMsg[#TaskMsg+1] = " - " .. BAITask:GetStateString() .. " BAI " .. AreaID .. " - " .. BAITask.TargetSetUnit:GetUnitTypesText() TaskMsg[#TaskMsg+1] = " - " .. BAITask:GetStateString() .. " BAI " .. AreaID .. " - " .. BAITask.TargetSetUnit:GetUnitTypesText()
end end
@ -486,7 +486,7 @@ do -- DETECTION_DISPATCHER
end end
-- TODO set menus using the HQ coordinator -- TODO set menus using the HQ coordinator
--Mission:SetMenu() Mission:SetMenu()
if #AreaMsg > 0 then if #AreaMsg > 0 then
for TaskGroupID, TaskGroup in pairs( self.SetGroup:GetSet() ) do for TaskGroupID, TaskGroup in pairs( self.SetGroup:GetSet() ) do

View File

@ -118,15 +118,13 @@ end
--- Sets the Planned Task menu. --- Sets the Planned Task menu.
-- @param #MISSION self -- @param #MISSION self
function MISSION:SetPlannedMenu() function MISSION:SetMenu()
self:E( self.Tasks ) for _, Task in pairs( self.Tasks ) do
for _, TaskData in pairs( self.Tasks ) do local Task = Task -- Tasking.Task#TASK_BASE
local Task = TaskData -- Tasking.Task#TASK_BASE
Task:RemoveMenu() Task:RemoveMenu()
Task:SetPlannedMenu() Task:SetMenu()
end end
end end
--- Sets the Assigned Task menu. --- Sets the Assigned Task menu.

View File

@ -142,7 +142,6 @@ function TASK_BASE:AssignToGroup( TaskGroup )
TaskGroup:SetState( TaskGroup, "Assigned", self ) TaskGroup:SetState( TaskGroup, "Assigned", self )
self:RemoveMenuForGroup( TaskGroup )
self:SetAssignedMenuForGroup( TaskGroup ) self:SetAssignedMenuForGroup( TaskGroup )
local TaskUnits = TaskGroup:GetUnits() local TaskUnits = TaskGroup:GetUnits()
@ -288,23 +287,13 @@ end
--- Set the menu options of the @{Task} to all the groups in the SetGroup. --- Set the menu options of the @{Task} to all the groups in the SetGroup.
-- @param #TASK_BASE self -- @param #TASK_BASE self
-- @return #TASK_BASE self -- @return #TASK_BASE self
function TASK_BASE:SetPlannedMenu() function TASK_BASE:SetMenu()
local MenuText = self:GetPlannedMenuText()
for TaskGroupID, TaskGroup in pairs( self.SetGroup:GetSet() ) do for TaskGroupID, TaskGroup in pairs( self.SetGroup:GetSet() ) do
if not self:IsAssignedToGroup( TaskGroup ) then if not self:IsAssignedToGroup( TaskGroup ) then
local MenuText = self:GetPlannedMenuText()
self:SetPlannedMenuForGroup( TaskGroup, MenuText ) self:SetPlannedMenuForGroup( TaskGroup, MenuText )
end else
end
end
--- Set the menu options of the @{Task} to all the groups in the SetGroup.
-- @param #TASK_BASE self
-- @return #TASK_BASE self
function TASK_BASE:SetAssignedMenu()
for TaskGroupID, TaskGroup in pairs( self.SetGroup:GetSet() ) do
if self:IsAssignedToGroup( TaskGroup ) then
self:SetAssignedMenuForGroup( TaskGroup ) self:SetAssignedMenuForGroup( TaskGroup )
end end
end end
@ -320,6 +309,8 @@ function TASK_BASE:RemoveMenu()
end end
end end
--- Set the planned menu option of the @{Task}. --- Set the planned menu option of the @{Task}.
-- @param #TASK_BASE self -- @param #TASK_BASE self
-- @param Group#GROUP TaskGroup -- @param Group#GROUP TaskGroup