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

Method setPreviewImage

Engine/source/T3D/assets/ShapeAsset.cpp:900–919  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

898}
899
900void GuiInspectorTypeShapeAssetPtr::setPreviewImage(StringTableEntry assetId)
901{
902 //if what we're working with isn't even a valid asset, don't present like we found a good one
903 if (!AssetDatabase.isDeclaredAsset(assetId))
904 {
905 mPreviewImage->_setBitmap(StringTable->EmptyString());
906 return;
907 }
908
909 String shpPreviewAssetId = String(assetId) + "_PreviewImage";
910 shpPreviewAssetId.replace(":", "_");
911 shpPreviewAssetId = "ToolsModule:" + shpPreviewAssetId;
912 if (AssetDatabase.isDeclaredAsset(shpPreviewAssetId.c_str()))
913 {
914 mPreviewImage->setBitmap(StringTable->insert(shpPreviewAssetId.c_str()));
915 }
916
917 if (mPreviewImage->getBitmapAsset().isNull())
918 mPreviewImage->_setBitmap(StringTable->insert("ToolsModule:genericAssetIcon_image"));
919}
920
921IMPLEMENT_CONOBJECT(GuiInspectorTypeShapeAssetId);
922

Callers 1

onInspectMethod · 0.45

Calls 9

isDeclaredAssetMethod · 0.80
_setBitmapMethod · 0.80
EmptyStringMethod · 0.80
replaceMethod · 0.80
StringClass · 0.50
c_strMethod · 0.45
setBitmapMethod · 0.45
insertMethod · 0.45
isNullMethod · 0.45

Tested by

no test coverage detected