Added DESIGNATE:SetMission() method.

-- Allows to place the designate menu under the menu of the mission.
This commit is contained in:
FlightControl_Master 2017-07-19 18:45:48 +02:00
parent 2c16992b5c
commit 1206935886
13 changed files with 165 additions and 41 deletions

View File

@ -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. -- 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. -- 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 return self
end 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,7 +628,14 @@ do -- DESIGNATE
DesignateMenu = nil DesignateMenu = nil
self:E("Remove Menu") self:E("Remove Menu")
end end
DesignateMenu = MENU_GROUP:New( AttackGroup, "Designate" )
local MissionMenu = nil
if self.Mission then
MissionMenu = self.Mission:GetRootMenu( AttackGroup )
end
DesignateMenu = MENU_GROUP:New( AttackGroup, "Designate", MissionMenu )
self:E( DesignateMenu ) self:E( DesignateMenu )
AttackGroup:SetState( AttackGroup, "DesignateMenu", DesignateMenu ) AttackGroup:SetState( AttackGroup, "DesignateMenu", DesignateMenu )

View File

@ -475,7 +475,28 @@ function MISSION:RemoveTaskMenu( Task )
end 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 -- @param #MISSION self
-- @return Core.Menu#MENU_COALITION self -- @return Core.Menu#MENU_COALITION self
function MISSION:GetMenu( TaskGroup ) -- R2.1 -- Changed Menu Structure function MISSION:GetMenu( TaskGroup ) -- R2.1 -- Changed Menu Structure

View File

@ -575,7 +575,6 @@
<dl class="function"> <dl class="function">
<dt> <dt>
<em>#number</em>
<a id="#(AI_A2A).IdleCount" > <a id="#(AI_A2A).IdleCount" >
<strong>AI_A2A.IdleCount</strong> <strong>AI_A2A.IdleCount</strong>
</a> </a>

View File

@ -3697,8 +3697,6 @@ Provide a value of <strong>true</strong> to display every 30 seconds a tactical
<p>Enumerator for spawns at airbases</p> <p>Enumerator for spawns at airbases</p>
<h2><a id="#(AI_A2A_DISPATCHER_GCICAP)" >Type <code>AI_A2A_DISPATCHER_GCICAP</code></a></h2>
<h2><a id="#(AI_A2A_GCICAP)" >Type <code>AI_A2A_GCICAP</code></a></h2> <h2><a id="#(AI_A2A_GCICAP)" >Type <code>AI_A2A_GCICAP</code></a></h2>
<h3>Field(s)</h3> <h3>Field(s)</h3>
<dl class="function"> <dl class="function">
@ -3769,7 +3767,7 @@ For airplanes, 6000 (6km) is recommended, and is also the default value of this
</ul> </ul>
<h3>Return value</h3> <h3>Return value</h3>
<p><em><a href="##(AI_A2A_DISPATCHER_GCICAP)">#AI<em>A2A</em>DISPATCHER_GCICAP</a>:</em></p> <p><em><a href="##(AI_A2A_GCICAP)">#AI<em>A2A</em>GCICAP</a>:</em></p>
<h3>Usage:</h3> <h3>Usage:</h3>

View File

@ -3542,6 +3542,7 @@ The range till cargo will board.</p>
<dl class="function"> <dl class="function">
<dt> <dt>
<em>#number</em>
<a id="#(CARGO_UNIT).RunCount" > <a id="#(CARGO_UNIT).RunCount" >
<strong>CARGO_UNIT.RunCount</strong> <strong>CARGO_UNIT.RunCount</strong>
</a> </a>

View File

@ -292,6 +292,12 @@ each detected set of potential targets can be lased or smoked...</p>
<td class="name" nowrap="nowrap"><a href="##(DESIGNATE).MenuStatus">DESIGNATE:MenuStatus(AttackGroup, Duration)</a></td> <td class="name" nowrap="nowrap"><a href="##(DESIGNATE).MenuStatus">DESIGNATE:MenuStatus(AttackGroup, Duration)</a></td>
<td class="summary"> <td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DESIGNATE).Mission">DESIGNATE.Mission</a></td>
<td class="summary">
</td> </td>
</tr> </tr>
<tr> <tr>
@ -412,6 +418,12 @@ each detected set of potential targets can be lased or smoked...</p>
<td class="name" nowrap="nowrap"><a href="##(DESIGNATE).SetLaserCodes">DESIGNATE:SetLaserCodes(<, LaserCodes)</a></td> <td class="name" nowrap="nowrap"><a href="##(DESIGNATE).SetLaserCodes">DESIGNATE:SetLaserCodes(<, LaserCodes)</a></td>
<td class="summary"> <td class="summary">
<p>Set an array of possible laser codes.</p> <p>Set an array of possible laser codes.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DESIGNATE).SetMission">DESIGNATE:SetMission(Mission)</a></td>
<td class="summary">
<p>Set the MISSION object for which designate will function.</p>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -680,7 +692,12 @@ If not activated, Targets will be selected in a random order, but most like thos
<p>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.</p> <p>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.</p>
<h2>6. Status Report</h2> <h2>6. Designate Menu Location for a Mission</h2>
<p>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 <a href="##(DESIGNATE).SetMission">DESIGNATE.SetMission</a>() to set the MISSION object for the designate function.</p>
<h2>7. Status Report</h2>
<p>A status report is available that displays the current Targets detected, grouped per DetectionItem, and a list of which Targets are currently being marked.</p> <p>A status report is available that displays the current Targets detected, grouped per DetectionItem, and a list of which Targets are currently being marked.</p>
@ -900,7 +917,6 @@ function below will use the range 1-7 just in case</p>
<dl class="function"> <dl class="function">
<dt> <dt>
<em></em>
<a id="#(DESIGNATE).LaserCodes" > <a id="#(DESIGNATE).LaserCodes" >
<strong>DESIGNATE.LaserCodes</strong> <strong>DESIGNATE.LaserCodes</strong>
</a> </a>
@ -1095,6 +1111,20 @@ function below will use the range 1-7 just in case</p>
</li> </li>
</ul> </ul>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(DESIGNATE).Mission" >
<strong>DESIGNATE.Mission</strong>
</a>
</dt>
<dd>
</dd> </dd>
</dl> </dl>
<dl class="function"> <dl class="function">
@ -1711,6 +1741,36 @@ number> LaserCodes</p>
<p><em><a href="##(DESIGNATE)">#DESIGNATE</a>:</em></p> <p><em><a href="##(DESIGNATE)">#DESIGNATE</a>:</em></p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(DESIGNATE).SetMission" >
<strong>DESIGNATE:SetMission(Mission)</strong>
</a>
</dt>
<dd>
<p>Set the MISSION object for which designate will function.</p>
<p>When a MISSION object is assigned, the menu for the designation will be located at the Mission Menu.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em><a href="Tasking.Mission.html##(MISSION)">Tasking.Mission#MISSION</a> Mission </em></code>:
The MISSION object.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(DESIGNATE)">#DESIGNATE</a>:</em></p>
</dd> </dd>
</dl> </dl>
<dl class="function"> <dl class="function">

View File

@ -2393,6 +2393,7 @@ The index of the DetectedItem.</p>
<dl class="function"> <dl class="function">
<dt> <dt>
<em>#number</em>
<a id="#(DETECTION_BASE).DetectedItemCount" > <a id="#(DETECTION_BASE).DetectedItemCount" >
<strong>DETECTION_BASE.DetectedItemCount</strong> <strong>DETECTION_BASE.DetectedItemCount</strong>
</a> </a>
@ -2406,6 +2407,7 @@ The index of the DetectedItem.</p>
<dl class="function"> <dl class="function">
<dt> <dt>
<em>#number</em>
<a id="#(DETECTION_BASE).DetectedItemMax" > <a id="#(DETECTION_BASE).DetectedItemMax" >
<strong>DETECTION_BASE.DetectedItemMax</strong> <strong>DETECTION_BASE.DetectedItemMax</strong>
</a> </a>
@ -2563,7 +2565,7 @@ The index of the DetectedItem.</p>
<dl class="function"> <dl class="function">
<dt> <dt>
<em></em> <em>#number</em>
<a id="#(DETECTION_BASE).DetectionInterval" > <a id="#(DETECTION_BASE).DetectionInterval" >
<strong>DETECTION_BASE.DetectionInterval</strong> <strong>DETECTION_BASE.DetectionInterval</strong>
</a> </a>

View File

@ -1598,7 +1598,7 @@ A string defining the start state.</p>
<dl class="function"> <dl class="function">
<dt> <dt>
<em></em> <em>#string</em>
<a id="#(FSM)._StartState" > <a id="#(FSM)._StartState" >
<strong>FSM._StartState</strong> <strong>FSM._StartState</strong>
</a> </a>
@ -1897,7 +1897,6 @@ A string defining the start state.</p>
<dl class="function"> <dl class="function">
<dt> <dt>
<em></em>
<a id="#(FSM).current" > <a id="#(FSM).current" >
<strong>FSM.current</strong> <strong>FSM.current</strong>
</a> </a>

View File

@ -204,7 +204,7 @@
<tr> <tr>
<td class="name" nowrap="nowrap"><a href="##(MISSION).GetMenu">MISSION:GetMenu(TaskGroup)</a></td> <td class="name" nowrap="nowrap"><a href="##(MISSION).GetMenu">MISSION:GetMenu(TaskGroup)</a></td>
<td class="summary"> <td class="summary">
<p>Gets the mission menu for the coalition.</p> <p>Gets the mission menu for the TaskGroup.</p>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -223,6 +223,12 @@
<td class="name" nowrap="nowrap"><a href="##(MISSION).GetPlayerNames">MISSION:GetPlayerNames()</a></td> <td class="name" nowrap="nowrap"><a href="##(MISSION).GetPlayerNames">MISSION:GetPlayerNames()</a></td>
<td class="summary"> <td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(MISSION).GetRootMenu">MISSION:GetRootMenu(TaskGroup)</a></td>
<td class="summary">
<p>Gets the root mission menu for the TaskGroup.</p>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -900,7 +906,7 @@ The CLIENT or UNIT of the Player crashing.</p>
</dt> </dt>
<dd> <dd>
<p>Gets the mission menu for the coalition.</p> <p>Gets the mission menu for the TaskGroup.</p>
<h3>Parameter</h3> <h3>Parameter</h3>
<ul> <ul>
@ -973,6 +979,32 @@ The task added.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(MISSION).GetRootMenu" >
<strong>MISSION:GetRootMenu(TaskGroup)</strong>
</a>
</dt>
<dd>
<p>Gets the root mission menu for the TaskGroup.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> TaskGroup </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="Core.Menu.html##(MENU_COALITION)">Core.Menu#MENU_COALITION</a>:</em>
self</p>
</dd> </dd>
</dl> </dl>
<dl class="function"> <dl class="function">

View File

@ -227,6 +227,7 @@ on defined intervals (currently every minute).</p>
<dl class="function"> <dl class="function">
<dt> <dt>
<em>#number</em>
<a id="#(MOVEMENT).AliveUnits" > <a id="#(MOVEMENT).AliveUnits" >
<strong>MOVEMENT.AliveUnits</strong> <strong>MOVEMENT.AliveUnits</strong>
</a> </a>
@ -235,6 +236,9 @@ on defined intervals (currently every minute).</p>
<p> Contains the counter how many units are currently alive</p>
</dd> </dd>
</dl> </dl>
<dl class="function"> <dl class="function">

View File

@ -2829,7 +2829,6 @@ The y coordinate.</p>
<dl class="function"> <dl class="function">
<dt> <dt>
<em></em>
<a id="#(POINT_VEC2).z" > <a id="#(POINT_VEC2).z" >
<strong>POINT_VEC2.z</strong> <strong>POINT_VEC2.z</strong>
</a> </a>

View File

@ -822,12 +822,6 @@ and any spaces before and after the resulting name are removed.</p>
<td class="name" nowrap="nowrap"><a href="##(SPAWN)._TranslateRotate">SPAWN:_TranslateRotate(SpawnIndex, SpawnRootX, SpawnRootY, SpawnX, SpawnY, SpawnAngle)</a></td> <td class="name" nowrap="nowrap"><a href="##(SPAWN)._TranslateRotate">SPAWN:_TranslateRotate(SpawnIndex, SpawnRootX, SpawnRootY, SpawnX, SpawnY, SpawnAngle)</a></td>
<td class="summary"> <td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).uncontrolled">SPAWN.uncontrolled</a></td>
<td class="summary">
</td> </td>
</tr> </tr>
</table> </table>
@ -2200,6 +2194,9 @@ The group that was spawned. You can use this group for further actions.</p>
<p> Don't repeat the group from Take-Off till Landing and back Take-Off by ReSpawning.</p>
</dd> </dd>
</dl> </dl>
<dl class="function"> <dl class="function">
@ -2749,6 +2746,9 @@ when nothing was spawned.</p>
<p> By default, no InitLimit</p>
</dd> </dd>
</dl> </dl>
<dl class="function"> <dl class="function">
@ -2784,7 +2784,7 @@ when nothing was spawned.</p>
<dl class="function"> <dl class="function">
<dt> <dt>
<em></em> <em>#number</em>
<a id="#(SPAWN).SpawnMaxGroups" > <a id="#(SPAWN).SpawnMaxGroups" >
<strong>SPAWN.SpawnMaxGroups</strong> <strong>SPAWN.SpawnMaxGroups</strong>
</a> </a>
@ -2801,7 +2801,7 @@ when nothing was spawned.</p>
<dl class="function"> <dl class="function">
<dt> <dt>
<em></em> <em>#number</em>
<a id="#(SPAWN).SpawnMaxUnitsAlive" > <a id="#(SPAWN).SpawnMaxUnitsAlive" >
<strong>SPAWN.SpawnMaxUnitsAlive</strong> <strong>SPAWN.SpawnMaxUnitsAlive</strong>
</a> </a>
@ -3129,7 +3129,7 @@ Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
<dl class="function"> <dl class="function">
<dt> <dt>
<em></em> <em>#boolean</em>
<a id="#(SPAWN).SpawnUnControlled" > <a id="#(SPAWN).SpawnUnControlled" >
<strong>SPAWN.SpawnUnControlled</strong> <strong>SPAWN.SpawnUnControlled</strong>
</a> </a>
@ -3153,7 +3153,7 @@ Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
<p> When the first Spawn executes, all the Groups need to be made visible before start.</p> <p> Flag that indicates if all the Groups of the SpawnGroup need to be visible when Spawned.</p>
</dd> </dd>
</dl> </dl>
@ -3733,20 +3733,6 @@ True = Continue Scheduler</p>
</li> </li>
</ul> </ul>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(SPAWN).uncontrolled" >
<strong>SPAWN.uncontrolled</strong>
</a>
</dt>
<dd>
</dd> </dd>
</dl> </dl>

View File

@ -630,7 +630,7 @@ based on the tasking capabilities defined in <a href="Task.html##(TASK)">Task#TA
<dl class="function"> <dl class="function">
<dt> <dt>
<em>#number</em> <em></em>
<a id="#(TASK_CARGO).CargoLimit" > <a id="#(TASK_CARGO).CargoLimit" >
<strong>TASK_CARGO.CargoLimit</strong> <strong>TASK_CARGO.CargoLimit</strong>
</a> </a>