mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-25 01:23:52 +00:00
Added refactor of Editor Settings window
Various fixes for asset handling. WIP of crash tracking
This commit is contained in:
parent
691d3f501e
commit
ff871f37e3
30 changed files with 662 additions and 273 deletions
|
|
@ -27,6 +27,7 @@
|
|||
#include "gui/editor/guiInspector.h"
|
||||
#include "core/util/safeDelete.h"
|
||||
#include "gfx/gfxDrawUtil.h"
|
||||
#include "util/settings.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// GuiInspectorVariableField
|
||||
|
|
@ -104,7 +105,17 @@ void GuiInspectorVariableField::setData( const char* data, bool callbacks )
|
|||
{
|
||||
if (mOwnerObject != nullptr)
|
||||
{
|
||||
mOwnerObject->setDataField(mVariableName, NULL, data);
|
||||
//Special case: if our object is a Settings class, we'll assume that we're trying to get/set the fields via the Setting class's normal behavior
|
||||
//otherwise, use fields as normal
|
||||
Settings* setting = dynamic_cast<Settings*>(mOwnerObject);
|
||||
if (setting)
|
||||
{
|
||||
setting->setValue(mVariableName, data);
|
||||
}
|
||||
else
|
||||
{
|
||||
mOwnerObject->setDataField(mVariableName, NULL, data);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -121,8 +132,16 @@ const char* GuiInspectorVariableField::getData( U32 inspectObjectIndex )
|
|||
{
|
||||
if ( !mCaption || mCaption[0] == 0 )
|
||||
return "";
|
||||
|
||||
return Con::getVariable( mCaption );
|
||||
|
||||
Settings* setting = dynamic_cast<Settings*>(mOwnerObject);
|
||||
if (setting)
|
||||
{
|
||||
return setting->value(mVariableName);
|
||||
}
|
||||
else
|
||||
{
|
||||
return Con::getVariable(mCaption);
|
||||
}
|
||||
}
|
||||
|
||||
void GuiInspectorVariableField::setValue( const char* newValue )
|
||||
|
|
@ -138,4 +157,4 @@ void GuiInspectorVariableField::updateValue()
|
|||
return;
|
||||
|
||||
setValue( getData() );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,7 +60,10 @@ void GuiVariableInspector::loadVars( String searchStr )
|
|||
|
||||
void GuiVariableInspector::update()
|
||||
{
|
||||
clearGroups();
|
||||
for (U32 g = 0; g < mGroups.size(); g++)
|
||||
{
|
||||
mGroups[g]->clearFields();
|
||||
}
|
||||
|
||||
for (U32 i = 0; i < mFields.size(); i++)
|
||||
{
|
||||
|
|
@ -149,6 +152,8 @@ void GuiVariableInspector::addField(const char* name, const char* label, const c
|
|||
fieldTypeMask = TypeF32;
|
||||
else if (newField.mFieldTypeName == StringTable->insert("vector"))
|
||||
fieldTypeMask = TypePoint3F;
|
||||
else if (newField.mFieldTypeName == StringTable->insert("vector2"))
|
||||
fieldTypeMask = TypePoint2F;
|
||||
//else if (fieldType == StringTable->insert("material"))
|
||||
// fieldTypeMask = TypeMaterialName;
|
||||
else if (newField.mFieldTypeName == StringTable->insert("image"))
|
||||
|
|
@ -264,4 +269,4 @@ DefineEngineMethod(GuiVariableInspector, setFieldEnabled, void, (const char* fie
|
|||
DefineEngineMethod( GuiVariableInspector, loadVars, void, ( const char * searchString ), , "loadVars( searchString )" )
|
||||
{
|
||||
object->loadVars( searchString );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue