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

Method constructEditControl

Engine/source/T3D/assets/SoundAsset.cpp:383–416  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

381}
382
383GuiControl * GuiInspectorTypeSoundAssetPtr::constructEditControl()
384{
385 // Create base filename edit controls
386 GuiControl* retCtrl = Parent::constructEditControl();
387 if (retCtrl == NULL)
388 return retCtrl;
389
390 // Change filespec
391 char szBuffer[512];
392 dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"SoundAsset\", \"AssetBrowser.changeAsset\", %s, \"\");",
393 getIdString());
394 mBrowseButton->setField("Command", szBuffer);
395
396 setDataField(StringTable->insert("targetObject"), NULL, mInspector->getInspectObject()->getIdString());
397
398 // Create "Open in Editor" button
399 mEditButton = new GuiBitmapButtonCtrl();
400
401 dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.editAsset(%d.getText());", retCtrl->getId());
402 mEditButton->setField("Command", szBuffer);
403
404 char bitmapName[512] = "ToolsModule:SFXEmitter_image";
405 mEditButton->setBitmap(StringTable->insert(bitmapName));
406
407 mEditButton->setDataField(StringTable->insert("Profile"), NULL, "GuiButtonProfile");
408 mEditButton->setDataField(StringTable->insert("tooltipprofile"), NULL, "GuiToolTipProfile");
409 mEditButton->setDataField(StringTable->insert("hovertime"), NULL, "1000");
410 mEditButton->setDataField(StringTable->insert("tooltip"), NULL, "Test play this sound");
411
412 mEditButton->registerObject();
413 addObject(mEditButton);
414
415 return retCtrl;
416}
417
418bool GuiInspectorTypeSoundAssetPtr::updateRects()
419{

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected