mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
DESIGNATE Class Fix
DESIGNATE - GetRootMenu() function seems obsolete and caused a crash in DESIGNATE class. Needs to be replaced by GetMenu() Function. This bug only appeared when a mission is given in DESIGNATE:New(...)
This commit is contained in:
parent
dc39107daa
commit
3526203ccb
@ -89,12 +89,15 @@ function MENU_INDEX:PrepareCoalition( CoalitionSide )
|
|||||||
self.Coalition[CoalitionSide].Menus = self.Coalition[CoalitionSide].Menus or {}
|
self.Coalition[CoalitionSide].Menus = self.Coalition[CoalitionSide].Menus or {}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---
|
||||||
|
-- @param Wrapper.Group#GROUP Group
|
||||||
function MENU_INDEX:PrepareGroup( Group )
|
function MENU_INDEX:PrepareGroup( Group )
|
||||||
|
if Group and Group:IsAlive() then
|
||||||
local GroupName = Group:GetName()
|
local GroupName = Group:GetName()
|
||||||
self.Group[GroupName] = self.Group[GroupName] or {}
|
self.Group[GroupName] = self.Group[GroupName] or {}
|
||||||
self.Group[GroupName].Menus = self.Group[GroupName].Menus or {}
|
self.Group[GroupName].Menus = self.Group[GroupName].Menus or {}
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -133,10 +136,12 @@ end
|
|||||||
|
|
||||||
|
|
||||||
function MENU_INDEX:HasGroupMenu( Group, Path )
|
function MENU_INDEX:HasGroupMenu( Group, Path )
|
||||||
|
if Group and Group:IsAlive() then
|
||||||
local MenuGroupName = Group:GetName()
|
local MenuGroupName = Group:GetName()
|
||||||
return self.Group[MenuGroupName].Menus[Path]
|
return self.Group[MenuGroupName].Menus[Path]
|
||||||
end
|
end
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
function MENU_INDEX:SetGroupMenu( Group, Path, Menu )
|
function MENU_INDEX:SetGroupMenu( Group, Path, Menu )
|
||||||
|
|
||||||
|
|||||||
@ -798,6 +798,7 @@ function SET_GROUP:GetAliveSet()
|
|||||||
|
|
||||||
-- Clean the Set before returning with only the alive Groups.
|
-- Clean the Set before returning with only the alive Groups.
|
||||||
for GroupName, GroupObject in pairs( self.Set ) do
|
for GroupName, GroupObject in pairs( self.Set ) do
|
||||||
|
local GroupObject=GroupObject --Wrapper.Group#GROUP
|
||||||
if GroupObject then
|
if GroupObject then
|
||||||
if GroupObject:IsAlive() then
|
if GroupObject:IsAlive() then
|
||||||
AliveSet:Add( GroupName, GroupObject )
|
AliveSet:Add( GroupName, GroupObject )
|
||||||
|
|||||||
@ -175,7 +175,7 @@ do -- DESIGNATE
|
|||||||
-- Smoke will fire for 5 minutes.
|
-- Smoke will fire for 5 minutes.
|
||||||
-- Each available recce within range will smoke a target.
|
-- Each available recce within range will smoke a target.
|
||||||
-- Smoking can be requested while lasing targets.
|
-- Smoking can be requested while lasing targets.
|
||||||
-- Smoke will appear “around” the targets, because of accuracy limitations.
|
-- Smoke will appear "around" the targets, because of accuracy limitations.
|
||||||
--
|
--
|
||||||
--
|
--
|
||||||
-- Have FUN!
|
-- Have FUN!
|
||||||
@ -952,7 +952,8 @@ do -- DESIGNATE
|
|||||||
local MissionMenu = nil
|
local MissionMenu = nil
|
||||||
|
|
||||||
if self.Mission then
|
if self.Mission then
|
||||||
MissionMenu = self.Mission:GetRootMenu( AttackGroup )
|
--MissionMenu = self.Mission:GetRootMenu( AttackGroup )
|
||||||
|
MissionMenu = self.Mission:GetMenu( AttackGroup )
|
||||||
end
|
end
|
||||||
|
|
||||||
local MenuTime = timer.getTime()
|
local MenuTime = timer.getTime()
|
||||||
|
|||||||
@ -426,6 +426,7 @@ end
|
|||||||
|
|
||||||
--- Gets the commandcenter menu structure governed by the HQ command center.
|
--- Gets the commandcenter menu structure governed by the HQ command center.
|
||||||
-- @param #COMMANDCENTER self
|
-- @param #COMMANDCENTER self
|
||||||
|
-- @param Wrapper.Group#Group TaskGroup Task Group.
|
||||||
-- @return Core.Menu#MENU_COALITION
|
-- @return Core.Menu#MENU_COALITION
|
||||||
function COMMANDCENTER:GetMenu( TaskGroup )
|
function COMMANDCENTER:GetMenu( TaskGroup )
|
||||||
|
|
||||||
|
|||||||
@ -611,13 +611,14 @@ function MISSION:RemoveTaskMenu( Task )
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Gets the root mission menu for the TaskGroup.
|
--- Gets the root mission menu for the TaskGroup. Obsolete?! Originally no reference to TaskGroup parameter!
|
||||||
-- @param #MISSION self
|
-- @param #MISSION self
|
||||||
|
-- @param Wrapper.Group#GROUP TaskGroup Task group.
|
||||||
-- @return Core.Menu#MENU_COALITION self
|
-- @return Core.Menu#MENU_COALITION self
|
||||||
function MISSION:GetRootMenu( TaskGroup ) -- R2.2
|
function MISSION:GetRootMenu( TaskGroup ) -- R2.2
|
||||||
|
|
||||||
local CommandCenter = self:GetCommandCenter()
|
local CommandCenter = self:GetCommandCenter()
|
||||||
local CommandCenterMenu = CommandCenter:GetMenu()
|
local CommandCenterMenu = CommandCenter:GetMenu( TaskGroup )
|
||||||
|
|
||||||
local MissionName = self:GetText()
|
local MissionName = self:GetText()
|
||||||
--local MissionMenu = CommandCenterMenu:GetMenu( MissionName )
|
--local MissionMenu = CommandCenterMenu:GetMenu( MissionName )
|
||||||
@ -629,6 +630,7 @@ end
|
|||||||
|
|
||||||
--- Gets the mission menu for the TaskGroup.
|
--- Gets the mission menu for the TaskGroup.
|
||||||
-- @param #MISSION self
|
-- @param #MISSION self
|
||||||
|
-- @param Wrapper.Group#GROUP TaskGroup Task group.
|
||||||
-- @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
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user