Fixes a crash that comes from toggling the editors on and off, then clicking a menubar item

Fixes the menubar not resizing with the Window
Fixes the Editors Menubar item not being repopulated if the editor was closed/reopened
Fixes the Physics menubar item not appearing if the editor was closed/reopened
Fixes issue where findMenu could fail if the StringTableEntry happened to trip against a different capitalization.
This commit is contained in:
Areloch 2019-03-16 02:38:40 -05:00
parent e0627973fb
commit 7b01b42e15
8 changed files with 113 additions and 54 deletions

View file

@ -64,28 +64,6 @@ function destroyPhysicsTools()
function PhysicsEditorPlugin::onWorldEditorStartup( %this )
{
new PopupMenu( PhysicsToolsMenu )
{
superClass = "MenuBuilder";
//class = "PhysXToolsMenu";
barTitle = "Physics";
item[0] = "Start Simulation" TAB "Ctrl-Alt P" TAB "physicsStartSimulation( \"client\" );physicsStartSimulation( \"server\" );";
//item[1] = "Stop Simulation" TAB "" TAB "physicsSetTimeScale( 0 );";
item[1] = "-";
item[2] = "Speed 25%" TAB "" TAB "physicsSetTimeScale( 0.25 );";
item[3] = "Speed 50%" TAB "" TAB "physicsSetTimeScale( 0.5 );";
item[4] = "Speed 100%" TAB "" TAB "physicsSetTimeScale( 1.0 );";
item[5] = "-";
item[6] = "Reload NXBs" TAB "" TAB "";
};
// Add our menu.
EditorGui.menuBar.insert( PhysicsToolsMenu, EditorGui.menuBar.dynamicItemInsertPos );
// Add ourselves to the window menu.
//EditorGui.addToWindowMenu( "Road and Path Editor", "", "RoadEditor" );
}
function PhysicsToolsMenu::onMenuSelect(%this)