mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-19 20:24:49 +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
|
|
@ -1079,6 +1079,14 @@ function ObjectBuilderGui::buildObject(%this, %className)
|
|||
%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
|
||||
//------------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -507,10 +507,15 @@ function EditorGui::buildMenus(%this)
|
|||
%class = %class;
|
||||
%method = "build" @ %buildfunc;
|
||||
if( !ObjectBuilderGui.isMethod( %method ) )
|
||||
%method = "build" @ %class;
|
||||
|
||||
%method = "build" @ %class;
|
||||
|
||||
if( !ObjectBuilderGui.isMethod( %method ) )
|
||||
%cmd = "return new " @ %class @ "();";
|
||||
{
|
||||
if (isMemberOfClass(%class,"gameBase"))
|
||||
%cmd = "ObjectBuilderGui.buildGameBaseObject("@ %class @");";
|
||||
else
|
||||
%cmd = "return new " @ %class @ "();";
|
||||
}
|
||||
else
|
||||
%cmd = "ObjectBuilderGui." @ %method @ "();";
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue