mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Changes
This commit is contained in:
parent
b7183023c9
commit
057e528947
@ -149,6 +149,32 @@ function MENU_INDEX:ClearGroupMenu( Group, Path )
|
||||
self.Group[MenuGroupName].Menus[Path] = nil
|
||||
end
|
||||
|
||||
function MENU_INDEX:Refresh( Group )
|
||||
|
||||
for MenuID, Menu in pairs( self.MenuMission.Menus ) do
|
||||
Menu:Refresh()
|
||||
end
|
||||
|
||||
for MenuID, Menu in pairs( self.Coalition[coalition.side.BLUE].Menus ) do
|
||||
Menu:Refresh()
|
||||
end
|
||||
|
||||
for MenuID, Menu in pairs( self.Coalition[coalition.side.RED].Menus ) do
|
||||
Menu:Refresh()
|
||||
end
|
||||
|
||||
local GroupName = Group:GetName()
|
||||
for MenuID, Menu in pairs( self.Group[GroupName].Menus ) do
|
||||
Menu:Refresh()
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
do -- MENU_BASE
|
||||
@ -342,13 +368,25 @@ do -- MENU_MISSION
|
||||
local self = BASE:Inherit( self, MENU_BASE:New( MenuText, ParentMenu ) )
|
||||
MENU_INDEX:SetMissionMenu( Path, self )
|
||||
|
||||
self.MenuPath = missionCommands.addSubMenu( MenuText, self.MenuParentPath )
|
||||
self.MenuPath = missionCommands.addSubMenu( self.MenuText, self.MenuParentPath )
|
||||
self:SetParentMenu( self.MenuText, self )
|
||||
return self
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
--- Refreshes a radio item for a mission
|
||||
-- @param #MENU_MISSION self
|
||||
-- @return #MENU_MISSION
|
||||
function MENU_MISSION:Refresh()
|
||||
|
||||
do
|
||||
missionCommands.removeItem( self.MenuPath )
|
||||
self.MenuPath = missionCommands.addSubMenu( self.MenuText, self.MenuParentPath )
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
--- Removes the sub menus recursively of this MENU_MISSION. Note that the main menu is kept!
|
||||
-- @param #MENU_MISSION self
|
||||
-- @return #MENU_MISSION
|
||||
@ -433,6 +471,18 @@ do -- MENU_MISSION_COMMAND
|
||||
end
|
||||
end
|
||||
|
||||
--- Refreshes a radio item for a mission
|
||||
-- @param #MENU_MISSION_COMMAND self
|
||||
-- @return #MENU_MISSION_COMMAND
|
||||
function MENU_MISSION_COMMAND:Refresh()
|
||||
|
||||
do
|
||||
missionCommands.removeItem( self.MenuPath )
|
||||
missionCommands.addCommand( self.MenuText, self.MenuParentPath, self.MenuCallHandler )
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
--- Removes a radio command item for a coalition
|
||||
-- @param #MENU_MISSION_COMMAND self
|
||||
-- @return #nil
|
||||
@ -541,6 +591,18 @@ do -- MENU_COALITION
|
||||
end
|
||||
end
|
||||
|
||||
--- Refreshes a radio item for a coalition
|
||||
-- @param #MENU_COALITION self
|
||||
-- @return #MENU_COALITION
|
||||
function MENU_COALITION:Refresh()
|
||||
|
||||
do
|
||||
missionCommands.removeItemForCoalition( self.Coalition, self.MenuPath )
|
||||
missionCommands.addSubMenuForCoalition( self.Coalition, self.MenuText, self.MenuParentPath )
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
--- Removes the sub menus recursively of this MENU_COALITION. Note that the main menu is kept!
|
||||
-- @param #MENU_COALITION self
|
||||
-- @return #MENU_COALITION
|
||||
@ -628,6 +690,19 @@ do -- MENU_COALITION_COMMAND
|
||||
|
||||
end
|
||||
|
||||
|
||||
--- Refreshes a radio item for a coalition
|
||||
-- @param #MENU_COALITION_COMMAND self
|
||||
-- @return #MENU_COALITION_COMMAND
|
||||
function MENU_COALITION_COMMAND:Refresh()
|
||||
|
||||
do
|
||||
missionCommands.removeItemForCoalition( self.Coalition, self.MenuPath )
|
||||
missionCommands.addCommandForCoalition( self.Coalition, self.MenuText, self.MenuParentPath, self.MenuCallHandler )
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
--- Removes a radio command item for a coalition
|
||||
-- @param #MENU_COALITION_COMMAND self
|
||||
-- @return #nil
|
||||
@ -758,6 +833,22 @@ do
|
||||
|
||||
end
|
||||
|
||||
--- Refreshes a new radio item for a group and submenus
|
||||
-- @param #MENU_GROUP self
|
||||
-- @return #MENU_GROUP
|
||||
function MENU_GROUP:Refresh()
|
||||
|
||||
do
|
||||
missionCommands.removeItemForGroup( self.GroupID, self.MenuPath )
|
||||
missionCommands.addSubMenuForGroup( self.GroupID, self.MenuText, self.MenuParentPath )
|
||||
|
||||
for MenuText, Menu in pairs( self.Menus or {} ) do
|
||||
Menu:Refresh()
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
--- Removes the sub menus recursively of this MENU_GROUP.
|
||||
-- @param #MENU_GROUP self
|
||||
-- @param MenuTime
|
||||
@ -852,6 +943,18 @@ do
|
||||
|
||||
end
|
||||
|
||||
--- Refreshes a radio item for a group
|
||||
-- @param #MENU_GROUP_COMMAND self
|
||||
-- @return #MENU_GROUP_COMMAND
|
||||
function MENU_GROUP_COMMAND:Refresh()
|
||||
|
||||
do
|
||||
missionCommands.removeItemForGroup( self.GroupID, self.MenuPath )
|
||||
missionCommands.addCommandForGroup( self.GroupID, self.MenuText, self.MenuParentPath, self.MenuCallHandler )
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
--- Removes a menu structure for a group.
|
||||
-- @param #MENU_GROUP_COMMAND self
|
||||
-- @param MenuTime
|
||||
@ -877,5 +980,7 @@ do
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
@ -1 +1,4 @@
|
||||
MOOSE = {}
|
||||
function MOOSE.Include()
|
||||
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user