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
|
self.Group[MenuGroupName].Menus[Path] = nil
|
||||||
end
|
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
|
do -- MENU_BASE
|
||||||
@ -342,12 +368,24 @@ do -- MENU_MISSION
|
|||||||
local self = BASE:Inherit( self, MENU_BASE:New( MenuText, ParentMenu ) )
|
local self = BASE:Inherit( self, MENU_BASE:New( MenuText, ParentMenu ) )
|
||||||
MENU_INDEX:SetMissionMenu( Path, self )
|
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 )
|
self:SetParentMenu( self.MenuText, self )
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
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!
|
--- Removes the sub menus recursively of this MENU_MISSION. Note that the main menu is kept!
|
||||||
-- @param #MENU_MISSION self
|
-- @param #MENU_MISSION self
|
||||||
@ -432,6 +470,18 @@ do -- MENU_MISSION_COMMAND
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
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
|
--- Removes a radio command item for a coalition
|
||||||
-- @param #MENU_MISSION_COMMAND self
|
-- @param #MENU_MISSION_COMMAND self
|
||||||
@ -540,6 +590,18 @@ do -- MENU_COALITION
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
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!
|
--- Removes the sub menus recursively of this MENU_COALITION. Note that the main menu is kept!
|
||||||
-- @param #MENU_COALITION self
|
-- @param #MENU_COALITION self
|
||||||
@ -627,6 +689,19 @@ do -- MENU_COALITION_COMMAND
|
|||||||
end
|
end
|
||||||
|
|
||||||
end
|
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
|
--- Removes a radio command item for a coalition
|
||||||
-- @param #MENU_COALITION_COMMAND self
|
-- @param #MENU_COALITION_COMMAND self
|
||||||
@ -740,7 +815,7 @@ do
|
|||||||
|
|
||||||
MENU_INDEX:PrepareGroup( Group )
|
MENU_INDEX:PrepareGroup( Group )
|
||||||
local Path = MENU_INDEX:ParentPath( ParentMenu, MenuText )
|
local Path = MENU_INDEX:ParentPath( ParentMenu, MenuText )
|
||||||
local GroupMenu = MENU_INDEX:HasGroupMenu( Group, Path )
|
local GroupMenu = MENU_INDEX:HasGroupMenu( Group, Path )
|
||||||
|
|
||||||
if GroupMenu then
|
if GroupMenu then
|
||||||
return GroupMenu
|
return GroupMenu
|
||||||
@ -757,6 +832,22 @@ do
|
|||||||
end
|
end
|
||||||
|
|
||||||
end
|
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.
|
--- Removes the sub menus recursively of this MENU_GROUP.
|
||||||
-- @param #MENU_GROUP self
|
-- @param #MENU_GROUP self
|
||||||
@ -851,6 +942,18 @@ do
|
|||||||
end
|
end
|
||||||
|
|
||||||
end
|
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.
|
--- Removes a menu structure for a group.
|
||||||
-- @param #MENU_GROUP_COMMAND self
|
-- @param #MENU_GROUP_COMMAND self
|
||||||
@ -876,6 +979,8 @@ do
|
|||||||
|
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -1 +1,4 @@
|
|||||||
|
MOOSE = {}
|
||||||
|
function MOOSE.Include()
|
||||||
|
|
||||||
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user