diff --git a/Moose Development/Moose/Functional/Designate.lua b/Moose Development/Moose/Functional/Designate.lua index 14b8fbb03..f73ebd462 100644 --- a/Moose Development/Moose/Functional/Designate.lua +++ b/Moose Development/Moose/Functional/Designate.lua @@ -167,7 +167,12 @@ do -- DESIGNATE -- -- The example will activate the threat level prioritization for this the Designate object. Threats will be marked based on the threat level of the Target. -- - -- ## 6. Status Report + -- ## 6. Designate Menu Location for a Mission + -- + -- You can make DESIGNATE work for a MISSION object. In this way, the Designate menu will not appear in the root of the radio menu, but in the menu of the Mission. + -- Use the method @{#DESIGNATE.SetMission}() to set the MISSION object for the designate function. + -- + -- ## 7. Status Report -- -- A status report is available that displays the current Targets detected, grouped per DetectionItem, and a list of which Targets are currently being marked. -- @@ -501,6 +506,17 @@ do -- DESIGNATE return self end + --- Set the MISSION object for which designate will function. + -- When a MISSION object is assigned, the menu for the designation will be located at the Mission Menu. + -- @param #DESIGNATE self + -- @param Tasking.Mission#MISSION Mission The MISSION object. + -- @return #DESIGNATE + function DESIGNATE:SetMission( Mission ) --R2.2 + + self.Mission = Mission + + return self + end --- @@ -612,8 +628,15 @@ do -- DESIGNATE DesignateMenu = nil self:E("Remove Menu") end - DesignateMenu = MENU_GROUP:New( AttackGroup, "Designate" ) - self:E(DesignateMenu) + + local MissionMenu = nil + + if self.Mission then + MissionMenu = self.Mission:GetRootMenu( AttackGroup ) + end + + DesignateMenu = MENU_GROUP:New( AttackGroup, "Designate", MissionMenu ) + self:E( DesignateMenu ) AttackGroup:SetState( AttackGroup, "DesignateMenu", DesignateMenu ) -- Set Menu option for auto lase diff --git a/Moose Development/Moose/Tasking/Mission.lua b/Moose Development/Moose/Tasking/Mission.lua index d50ec823b..07133d305 100644 --- a/Moose Development/Moose/Tasking/Mission.lua +++ b/Moose Development/Moose/Tasking/Mission.lua @@ -475,7 +475,28 @@ function MISSION:RemoveTaskMenu( Task ) end ---- Gets the mission menu for the coalition. +--- Gets the root mission menu for the TaskGroup. +-- @param #MISSION self +-- @return Core.Menu#MENU_COALITION self +function MISSION:GetRootMenu( TaskGroup ) -- R2.2 + + local CommandCenter = self:GetCommandCenter() + local CommandCenterMenu = CommandCenter:GetMenu() + + local MissionName = self:GetName() + --local MissionMenu = CommandCenterMenu:GetMenu( MissionName ) + + self.MissionMenu = self.MissionMenu or {} + self.MissionMenu[TaskGroup] = self.MissionMenu[TaskGroup] or {} + + local Menu = self.MissionMenu[TaskGroup] + + Menu.MainMenu = Menu.MainMenu or MENU_GROUP:New( TaskGroup, self:GetName(), CommandCenterMenu ) + + return Menu.MainMenu +end + +--- Gets the mission menu for the TaskGroup. -- @param #MISSION self -- @return Core.Menu#MENU_COALITION self function MISSION:GetMenu( TaskGroup ) -- R2.1 -- Changed Menu Structure diff --git a/docs/Documentation/AI_A2A.html b/docs/Documentation/AI_A2A.html index 2a24504d1..ee2dc9007 100644 --- a/docs/Documentation/AI_A2A.html +++ b/docs/Documentation/AI_A2A.html @@ -575,7 +575,6 @@
Enumerator for spawns at airbases
-AI_A2A_DISPATCHER_GCICAPAI_A2A_GCICAPSet an array of possible laser codes.
+Set the MISSION object for which designate will function.
The example will activate the threat level prioritization for this the Designate object. Threats will be marked based on the threat level of the Target.
-You can make DESIGNATE work for a MISSION object. In this way, the Designate menu will not appear in the root of the radio menu, but in the menu of the Mission. +Use the method DESIGNATE.SetMission() to set the MISSION object for the designate function.
+ +A status report is available that displays the current Targets detected, grouped per DetectionItem, and a list of which Targets are currently being marked.
@@ -900,7 +917,6 @@ function below will use the range 1-7 just in caseSet the MISSION object for which designate will function.
+ + +When a MISSION object is assigned, the menu for the designation will be located at the Mission Menu.
+ +Tasking.Mission#MISSION Mission :
+The MISSION object.
Gets the mission menu for the coalition.
+Gets the mission menu for the TaskGroup.
Gets the root mission menu for the TaskGroup.
Gets the mission menu for the coalition.
+Gets the mission menu for the TaskGroup.
Gets the root mission menu for the TaskGroup.
+ + TaskGroup :
Core.Menu#MENU_COALITION: +self
+Contains the counter how many units are currently alive
+Don't repeat the group from Take-Off till Landing and back Take-Off by ReSpawning.
+By default, no InitLimit
+When the first Spawn executes, all the Groups need to be made visible before start.
+Flag that indicates if all the Groups of the SpawnGroup need to be visible when Spawned.