Stress test menus made me realize about the Path ...

This commit is contained in:
FlightControl_Master 2017-12-15 19:58:25 +01:00
parent b8c1135b3b
commit c018a6e13f
2 changed files with 4 additions and 4 deletions

View File

@ -741,7 +741,7 @@ function DATABASE:_EventOnBirth( Event )
end end
local Settings = SETTINGS:Set( PlayerName ) local Settings = SETTINGS:Set( PlayerName )
Settings:SetPlayerMenu( Event.IniUnit ) Settings:SetPlayerMenu( Event.IniUnit )
MENU_INDEX:Refresh( Event.IniGroup ) --MENU_INDEX:Refresh( Event.IniGroup )
end end
end end
end end

View File

@ -49,21 +49,21 @@ function MENU_INDEX:ParentPath( ParentMenu, MenuText )
local Path = ParentMenu and "@" .. table.concat( ParentMenu.MenuPath or {}, "@" ) or "" local Path = ParentMenu and "@" .. table.concat( ParentMenu.MenuPath or {}, "@" ) or ""
if ParentMenu then if ParentMenu then
if BASE:IsInstanceOf( "MENU_GROUP" ) or BASE:IsInstanceOf( "MENU_GROUP_COMMAND" ) then if ParentMenu:IsInstanceOf( "MENU_GROUP" ) or ParentMenu:IsInstanceOf( "MENU_GROUP_COMMAND" ) then
local GroupName = ParentMenu.Group:GetName() local GroupName = ParentMenu.Group:GetName()
if not self.Group[GroupName].Menus[Path] then if not self.Group[GroupName].Menus[Path] then
BASE:E( { Path = Path, GroupName = GroupName } ) BASE:E( { Path = Path, GroupName = GroupName } )
error( "Parent path not found in menu index for group menu" ) error( "Parent path not found in menu index for group menu" )
return nil return nil
end end
elseif BASE:IsInstanceOf( "MENU_COALITION" ) or BASE:IsInstanceOf( "MENU_COALITION_COMMAND" ) then elseif ParentMenu:IsInstanceOf( "MENU_COALITION" ) or ParentMenu:IsInstanceOf( "MENU_COALITION_COMMAND" ) then
local Coalition = ParentMenu.Coalition local Coalition = ParentMenu.Coalition
if not self.Coalition[Coalition].Menus[Path] then if not self.Coalition[Coalition].Menus[Path] then
BASE:E( { Path = Path, Coalition = Coalition } ) BASE:E( { Path = Path, Coalition = Coalition } )
error( "Parent path not found in menu index for coalition menu" ) error( "Parent path not found in menu index for coalition menu" )
return nil return nil
end end
elseif BASE:IsInstanceOf( "MENU_MISSION" ) or BASE:IsInstanceOf( "MENU_MISSION_COMMAND" ) then elseif ParentMenu:IsInstanceOf( "MENU_MISSION" ) or ParentMenu:IsInstanceOf( "MENU_MISSION_COMMAND" ) then
if not self.MenuMission.Menus[Path] then if not self.MenuMission.Menus[Path] then
BASE:E( { Path = Path } ) BASE:E( { Path = Path } )
error( "Parent path not found in menu index for mission menu" ) error( "Parent path not found in menu index for mission menu" )