mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-29 16:25:42 +00:00
add a generic fallback for gamebaseObject spawning via the "add" menu that fills in a generalized datablkock dropdown popup based on class name if a specified one does not exist
This commit is contained in:
parent
fbcfe02098
commit
373508f622
2 changed files with 16 additions and 3 deletions
|
|
@ -1079,6 +1079,14 @@ function ObjectBuilderGui::buildObject(%this, %className)
|
||||||
%this.process();
|
%this.process();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function ObjectBuilderGui::buildGameBaseObject(%this, %className)
|
||||||
|
{
|
||||||
|
%this.objectClassName = %className;
|
||||||
|
//assumes we fgollow the pattern of class is instance, classData is datablock
|
||||||
|
%this.addField("dataBlock", "TypeDataBlock", "Data block", %className @"Data");
|
||||||
|
|
||||||
|
%this.process();
|
||||||
|
}
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// Environment
|
// Environment
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -507,10 +507,15 @@ function EditorGui::buildMenus(%this)
|
||||||
%class = %class;
|
%class = %class;
|
||||||
%method = "build" @ %buildfunc;
|
%method = "build" @ %buildfunc;
|
||||||
if( !ObjectBuilderGui.isMethod( %method ) )
|
if( !ObjectBuilderGui.isMethod( %method ) )
|
||||||
%method = "build" @ %class;
|
%method = "build" @ %class;
|
||||||
|
|
||||||
if( !ObjectBuilderGui.isMethod( %method ) )
|
if( !ObjectBuilderGui.isMethod( %method ) )
|
||||||
%cmd = "return new " @ %class @ "();";
|
{
|
||||||
|
if (isMemberOfClass(%class,"gameBase"))
|
||||||
|
%cmd = "ObjectBuilderGui.buildGameBaseObject("@ %class @");";
|
||||||
|
else
|
||||||
|
%cmd = "return new " @ %class @ "();";
|
||||||
|
}
|
||||||
else
|
else
|
||||||
%cmd = "ObjectBuilderGui." @ %method @ "();";
|
%cmd = "ObjectBuilderGui." @ %method @ "();";
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue