mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
Add getScriptPath console function to GUIAsset
Shifted tracking of importing asset status to an enum for more robust handling Added logic to properly init freshly created shapeConstructors with the newly imported shapeAsset Fixed handling of assets that have been marked to be skipped, but needed to fill in the parent's dependencies(UseForDependencies enum value) Cleaned up redundant recursive logic for importing assets Disable Create Game Objects button in inspector Fixed material assignment for convex proxies Updated asset icons for AB with WIP images to be more clear Fixed issue where type-generic icons in the creator items in the AB weren't showing correctly. Force AB to show creator entries in list mode for efficiency and avoid icon scaling issues Moved creator functions for AB to separate file for convenience Filled out GUIControls in the AB's creator mode, and context world editor and GUI creator entries based on active editor Added drag-n-drop handling for guiControls via AB creator in guiEditor mode Added more types' profiles in the AB gui profiles to give more unique border colors for better visual clarity of asset type Added editor setting to indicate if the editor should load into the last edited level, or the editor default scene Fixed setting of highlight material overlay in shapeEditor Added global keybind for GUIEditor so space also toggles assetbrowser Fixed up binding/finding of shapeConstructor by assetId, which also fixed displaying of shape's material listing
This commit is contained in:
parent
ce476f5e07
commit
8781f2ab55
44 changed files with 695 additions and 748 deletions
|
|
@ -1015,7 +1015,7 @@ U32 TSStatic::packUpdate(NetConnection* con, U32 mask, BitStream* stream)
|
|||
con->packNetStringHandleU(stream, matNameStr);
|
||||
}
|
||||
|
||||
mChangingMaterials.clear();
|
||||
//mChangingMaterials.clear();
|
||||
}
|
||||
|
||||
return retMask;
|
||||
|
|
@ -1670,53 +1670,49 @@ void TSStatic::onInspect(GuiInspector* inspector)
|
|||
{
|
||||
StringTableEntry materialname = StringTable->insert(mShapeAsset->getShape()->materialList->getMaterialName(i).c_str());
|
||||
|
||||
//Iterate through our assetList to find the compliant entry in our matList
|
||||
for (U32 m = 0; m < mShapeAsset->getMaterialCount(); m++)
|
||||
AssetPtr<MaterialAsset> matAsset;
|
||||
if(MaterialAsset::getAssetByMaterialName(materialname, &matAsset) == MaterialAsset::Ok)
|
||||
{
|
||||
AssetPtr<MaterialAsset> matAsset = mShapeAsset->getMaterialAsset(m);
|
||||
dSprintf(matFieldName, 128, "MaterialSlot%d", i);
|
||||
|
||||
if (matAsset->getMaterialDefinitionName() == materialname)
|
||||
//addComponentField(matFieldName, "A material used in the shape file", "Material", matAsset->getAssetId(), "");
|
||||
//Con::executef(this, "onConstructComponentField", mTargetComponent, field->mFieldName);
|
||||
Con::printf("Added material field for MaterialSlot %d", i);
|
||||
|
||||
GuiInspectorField* fieldGui = materialGroup->constructField(TypeMaterialAssetPtr);
|
||||
fieldGui->init(inspector, materialGroup);
|
||||
|
||||
fieldGui->setSpecialEditField(true);
|
||||
fieldGui->setTargetObject(this);
|
||||
|
||||
StringTableEntry fldnm = StringTable->insert(matFieldName);
|
||||
|
||||
fieldGui->setSpecialEditVariableName(fldnm);
|
||||
|
||||
fieldGui->setInspectorField(NULL, fldnm);
|
||||
fieldGui->setDocs("");
|
||||
|
||||
if (fieldGui->registerObject())
|
||||
{
|
||||
dSprintf(matFieldName, 128, "MaterialSlot%d", i);
|
||||
StringTableEntry fieldValue = matAsset->getAssetId();
|
||||
|
||||
//addComponentField(matFieldName, "A material used in the shape file", "Material", matAsset->getAssetId(), "");
|
||||
//Con::executef(this, "onConstructComponentField", mTargetComponent, field->mFieldName);
|
||||
Con::printf("Added material field for MaterialSlot %d", i);
|
||||
|
||||
GuiInspectorField* fieldGui = materialGroup->constructField(TypeMaterialAssetPtr);
|
||||
fieldGui->init(inspector, materialGroup);
|
||||
|
||||
fieldGui->setSpecialEditField(true);
|
||||
fieldGui->setTargetObject(this);
|
||||
|
||||
StringTableEntry fldnm = StringTable->insert(matFieldName);
|
||||
|
||||
fieldGui->setSpecialEditVariableName(fldnm);
|
||||
|
||||
fieldGui->setInspectorField(NULL, fldnm);
|
||||
fieldGui->setDocs("");
|
||||
|
||||
if (fieldGui->registerObject())
|
||||
//Check if we'd already actually changed it, and display the modified value
|
||||
for (U32 c = 0; c < mChangingMaterials.size(); c++)
|
||||
{
|
||||
fieldGui->setValue(materialname);
|
||||
|
||||
stack->addObject(fieldGui);
|
||||
}
|
||||
else
|
||||
{
|
||||
SAFE_DELETE(fieldGui);
|
||||
if (mChangingMaterials[c].slot == i)
|
||||
{
|
||||
fieldValue = StringTable->insert(mChangingMaterials[i].assetId.c_str());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*if (materialGroup->isMethod("onConstructField"))
|
||||
{
|
||||
//ensure our stack variable is bound if we need it
|
||||
//Con::evaluatef("%d.stack = %d;", materialGroup->getId(), materialGroup->at(0)->getId());
|
||||
fieldGui->setValue(fieldValue);
|
||||
|
||||
Con::executef(materialGroup, "onConstructField", matFieldName,
|
||||
matFieldName, "material", matFieldName,
|
||||
materialname, "", "", this);
|
||||
}*/
|
||||
break;
|
||||
stack->addObject(fieldGui);
|
||||
}
|
||||
else
|
||||
{
|
||||
SAFE_DELETE(fieldGui);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue