mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-19 20:24:49 +00:00
Fixes the member-of-class check order to properly sort the context. Also fixes a bug with the spacer entries being filtered from the popup menu, which threw off the selection.
This commit is contained in:
parent
906cc0ef39
commit
51049b6e8c
|
|
@ -99,7 +99,9 @@ void PopupMenu::createPlatformMenu()
|
|||
S32 PopupMenu::insertItem(S32 pos, const char *title, const char* accelerator, const char* cmd)
|
||||
{
|
||||
GuiMenuBar::MenuItem *item = GuiMenuBar::findMenuItem( mData->mMenuGui, title );
|
||||
if(item)
|
||||
|
||||
//We'll make a special exception for the spacer items
|
||||
if(item && dStrcmp(title, ""))
|
||||
{
|
||||
setItem( pos, title, accelerator, cmd);
|
||||
return pos;
|
||||
|
|
|
|||
|
|
@ -1619,7 +1619,7 @@ function EditorTree::onRightMouseUp( %this, %itemId, %mouse, %obj )
|
|||
}
|
||||
|
||||
// Open context menu if this is a SimGroup
|
||||
else if( %obj.isMemberOfClass( "SimGroup" ) )
|
||||
else if( !%obj.isMemberOfClass( "SceneObject" ) )
|
||||
{
|
||||
%popup = ETSimGroupContextPopup;
|
||||
if( !isObject( %popup ) )
|
||||
|
|
@ -1643,20 +1643,6 @@ function EditorTree::onRightMouseUp( %this, %itemId, %mouse, %obj )
|
|||
|
||||
object = -1;
|
||||
};
|
||||
|
||||
if(%obj.isMemberOfClass("Entity"))
|
||||
{
|
||||
%popup = ETEntityContextPopup;
|
||||
if( !isObject( %popup ) )
|
||||
%popup = new PopupMenu( ETEntityContextPopup : ETSimGroupContextPopup )
|
||||
{
|
||||
superClass = "MenuBuilder";
|
||||
isPopup = "1";
|
||||
|
||||
item[ 12 ] = "-";
|
||||
item[ 13 ] = "Convert to Game Object" TAB "" TAB "EWorldEditor.createGameObject( %this.object );";
|
||||
};
|
||||
}
|
||||
|
||||
%popup.object = %obj;
|
||||
|
||||
|
|
@ -1689,9 +1675,23 @@ function EditorTree::onRightMouseUp( %this, %itemId, %mouse, %obj )
|
|||
|
||||
object = -1;
|
||||
};
|
||||
|
||||
if(%obj.isMemberOfClass("Entity"))
|
||||
{
|
||||
%popup = ETEntityContextPopup;
|
||||
if( !isObject( %popup ) )
|
||||
%popup = new PopupMenu( ETEntityContextPopup : ETSimGroupContextPopup )
|
||||
{
|
||||
superClass = "MenuBuilder";
|
||||
isPopup = "1";
|
||||
|
||||
item[ 12 ] = "-";
|
||||
item[ 13 ] = "Convert to Game Object" TAB "" TAB "EWorldEditor.createGameObject( %this.object );";
|
||||
};
|
||||
}
|
||||
|
||||
// Specialized version for ConvexShapes.
|
||||
if( %obj.isMemberOfClass( "ConvexShape" ) )
|
||||
else if( %obj.isMemberOfClass( "ConvexShape" ) )
|
||||
{
|
||||
%popup = ETConvexShapeContextPopup;
|
||||
if( !isObject( %popup ) )
|
||||
|
|
|
|||
Loading…
Reference in a new issue