MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / constructEditControl

Method constructEditControl

Engine/source/T3D/assets/TerrainAsset.cpp:460–492  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

458}
459
460GuiControl* GuiInspectorTypeTerrainAssetPtr::constructEditControl()
461{
462 // Create base filename edit controls
463 GuiControl* retCtrl = Parent::constructEditControl();
464 if (retCtrl == NULL)
465 return retCtrl;
466
467 // Change filespec
468 char szBuffer[512];
469 dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"TerrainAsset\", \"AssetBrowser.changeAsset\", %s, %s);",
470 mInspector->getIdString(), mCaption);
471 mBrowseButton->setField("Command", szBuffer);
472
473 setDataField(StringTable->insert("targetObject"), NULL, mInspector->getInspectObject()->getIdString());
474
475 // Create "Open in ShapeEditor" button
476 mShapeEdButton = new GuiBitmapButtonCtrl();
477
478 mShapeEdButton->setField("Command", "EditorGui.setEditor(TerrainEditorPlugin);");
479
480 char bitmapName[512] = "ToolsModule:TerrainBlock_image";
481 mShapeEdButton->setBitmap(StringTable->insert(bitmapName));
482
483 mShapeEdButton->setDataField(StringTable->insert("Profile"), NULL, "GuiButtonProfile");
484 mShapeEdButton->setDataField(StringTable->insert("tooltipprofile"), NULL, "GuiToolTipProfile");
485 mShapeEdButton->setDataField(StringTable->insert("hovertime"), NULL, "1000");
486 mShapeEdButton->setDataField(StringTable->insert("tooltip"), NULL, "Open this file in the Shape Editor");
487
488 mShapeEdButton->registerObject();
489 addObject(mShapeEdButton);
490
491 return retCtrl;
492}
493
494bool GuiInspectorTypeTerrainAssetPtr::updateRects()
495{

Callers

nothing calls this directly

Calls 7

dSprintfFunction · 0.85
getIdStringMethod · 0.80
setFieldMethod · 0.80
insertMethod · 0.45
setBitmapMethod · 0.45
setDataFieldMethod · 0.45
registerObjectMethod · 0.45

Tested by

no test coverage detected