mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Fixed bug in MENU_GROUP_COMMAND
This commit is contained in:
@@ -140,8 +140,9 @@ do -- MENU_COMMAND_BASE
|
||||
local self = BASE:Inherit( self, MENU_BASE:New( MenuText, ParentMenu ) )
|
||||
|
||||
self.CommandMenuFunction = CommandMenuFunction
|
||||
self.MenuCallHandler = function( CommandMenuArguments )
|
||||
self.CommandMenuFunction( unpack( CommandMenuArguments ) )
|
||||
self.CommandMenuArguments = CommandMenuArguments
|
||||
self.MenuCallHandler = function()
|
||||
self.CommandMenuFunction( unpack( self.CommandMenuArguments ) )
|
||||
end
|
||||
|
||||
return self
|
||||
@@ -893,28 +894,30 @@ do
|
||||
if MenuGroup._Menus[Path] then
|
||||
self = MenuGroup._Menus[Path]
|
||||
self:F2( { "Re-using Group Command Menu:", MenuGroup:GetName(), MenuText } )
|
||||
else
|
||||
self = BASE:Inherit( self, MENU_COMMAND_BASE:New( MenuText, ParentMenu, CommandMenuFunction, arg ) )
|
||||
missionCommands.removeItemForGroup( self.MenuGroupID, self.MenuPath )
|
||||
|
||||
--if MenuGroup:IsAlive() then
|
||||
MenuGroup._Menus[Path] = self
|
||||
--end
|
||||
|
||||
self.Path = Path
|
||||
self.MenuGroup = MenuGroup
|
||||
self.MenuGroupID = MenuGroup:GetID()
|
||||
self.MenuText = MenuText
|
||||
self.ParentMenu = ParentMenu
|
||||
|
||||
self:F( { "Adding Group Command Menu:", MenuGroup = MenuGroup:GetName(), MenuText = MenuText, MenuPath = self.MenuParentPath } )
|
||||
self.MenuPath = missionCommands.addCommandForGroup( self.MenuGroupID, MenuText, self.MenuParentPath, self.MenuCallHandler, arg )
|
||||
|
||||
if self.ParentMenu and self.ParentMenu.Menus then
|
||||
self.ParentMenu.Menus[MenuText] = self
|
||||
self.ParentMenu.MenuCount = self.ParentMenu.MenuCount + 1
|
||||
self:F2( { ParentMenu.Menus, MenuText } )
|
||||
end
|
||||
end
|
||||
self = BASE:Inherit( self, MENU_COMMAND_BASE:New( MenuText, ParentMenu, CommandMenuFunction, arg ) )
|
||||
|
||||
--if MenuGroup:IsAlive() then
|
||||
MenuGroup._Menus[Path] = self
|
||||
--end
|
||||
|
||||
self.Path = Path
|
||||
self.MenuGroup = MenuGroup
|
||||
self.MenuGroupID = MenuGroup:GetID()
|
||||
self.MenuText = MenuText
|
||||
self.ParentMenu = ParentMenu
|
||||
|
||||
self:F( { "Adding Group Command Menu:", MenuGroup = MenuGroup:GetName(), MenuText = MenuText, MenuPath = self.MenuParentPath } )
|
||||
self.MenuPath = missionCommands.addCommandForGroup( self.MenuGroupID, MenuText, self.MenuParentPath, self.MenuCallHandler, arg )
|
||||
|
||||
if self.ParentMenu and self.ParentMenu.Menus then
|
||||
self.ParentMenu.Menus[MenuText] = self
|
||||
self.ParentMenu.MenuCount = self.ParentMenu.MenuCount + 1
|
||||
self:F2( { ParentMenu.Menus, MenuText } )
|
||||
end
|
||||
-- end
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user