mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-28 15:55:39 +00:00
Merge pull request #673 from Areloch/useImagePreviews
Shifts utilization of gui elements in editors that point to 'normal' image assets to utilize generated previews instead.
This commit is contained in:
commit
b5bd242e23
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