mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 19:53:48 +00:00
Shifts utilization of gui elements in editors that point to 'normal' image assets to utilize generated previews instead.
This reduces console spam about mismatched texture profiles and improves stability.
This commit is contained in:
parent
e9414a1660
commit
eb24b63be4
9 changed files with 168 additions and 277 deletions
|
|
@ -549,7 +549,20 @@ bool GuiInspectorTypeImageAssetPtr::renderTooltip(const Point2I& hoverPos, const
|
|||
if (!filename || !filename[0])
|
||||
return false;
|
||||
|
||||
GFXTexHandle texture(filename, &GFXStaticTextureSRGBProfile, avar("%s() - tooltip texture (line %d)", __FUNCTION__, __LINE__));
|
||||
StringTableEntry previewFilename = filename;
|
||||
if (Con::isFunction("getAssetPreviewImage"))
|
||||
{
|
||||
ConsoleValue consoleRet = Con::executef("getAssetPreviewImage", filename);
|
||||
previewFilename = StringTable->insert(consoleRet.getString());
|
||||
|
||||
if (AssetDatabase.isDeclaredAsset(previewFilename))
|
||||
{
|
||||
ImageAsset* previewAsset = AssetDatabase.acquireAsset<ImageAsset>(previewFilename);
|
||||
previewFilename = previewAsset->getImagePath();
|
||||
}
|
||||
}
|
||||
|
||||
GFXTexHandle texture(previewFilename, &GFXStaticTextureSRGBProfile, avar("%s() - tooltip texture (line %d)", __FUNCTION__, __LINE__));
|
||||
if (texture.isNull())
|
||||
return false;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue