mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Stress test menus made me realize about the Path ...
This commit is contained in:
parent
b8c1135b3b
commit
c018a6e13f
@ -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
|
||||||
|
|||||||
@ -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" )
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user