mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-16 00:54:54 +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
2 changed files with 19 additions and 17 deletions
|
|
@ -99,7 +99,9 @@ void PopupMenu::createPlatformMenu()
|
||||||
S32 PopupMenu::insertItem(S32 pos, const char *title, const char* accelerator, const char* cmd)
|
S32 PopupMenu::insertItem(S32 pos, const char *title, const char* accelerator, const char* cmd)
|
||||||
{
|
{
|
||||||
GuiMenuBar::MenuItem *item = GuiMenuBar::findMenuItem( mData->mMenuGui, title );
|
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);
|
setItem( pos, title, accelerator, cmd);
|
||||||
return pos;
|
return pos;
|
||||||
|
|
|
||||||
|
|
@ -1619,7 +1619,7 @@ function EditorTree::onRightMouseUp( %this, %itemId, %mouse, %obj )
|
||||||
}
|
}
|
||||||
|
|
||||||
// Open context menu if this is a SimGroup
|
// Open context menu if this is a SimGroup
|
||||||
else if( %obj.isMemberOfClass( "SimGroup" ) )
|
else if( !%obj.isMemberOfClass( "SceneObject" ) )
|
||||||
{
|
{
|
||||||
%popup = ETSimGroupContextPopup;
|
%popup = ETSimGroupContextPopup;
|
||||||
if( !isObject( %popup ) )
|
if( !isObject( %popup ) )
|
||||||
|
|
@ -1644,20 +1644,6 @@ function EditorTree::onRightMouseUp( %this, %itemId, %mouse, %obj )
|
||||||
object = -1;
|
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;
|
%popup.object = %obj;
|
||||||
|
|
||||||
%hasChildren = %obj.getCount() > 0;
|
%hasChildren = %obj.getCount() > 0;
|
||||||
|
|
@ -1690,8 +1676,22 @@ function EditorTree::onRightMouseUp( %this, %itemId, %mouse, %obj )
|
||||||
object = -1;
|
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.
|
// Specialized version for ConvexShapes.
|
||||||
if( %obj.isMemberOfClass( "ConvexShape" ) )
|
else if( %obj.isMemberOfClass( "ConvexShape" ) )
|
||||||
{
|
{
|
||||||
%popup = ETConvexShapeContextPopup;
|
%popup = ETConvexShapeContextPopup;
|
||||||
if( !isObject( %popup ) )
|
if( !isObject( %popup ) )
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue