Reimplements ability to utilize direct file load alongside ImageAsset fields when utilizing the ImageAsset macros

Updates Asset Browser generated preview images to not utilize full assets, but just the preview image files themselves
This commit is contained in:
JeffR 2025-05-27 17:12:03 -05:00
parent a43458677a
commit 0fa8b97f91
7 changed files with 56 additions and 130 deletions

View file

@ -118,7 +118,11 @@ class GuiBitmapButtonCtrl : public GuiButtonCtrl, protected AssetPtrCallback
///
BitmapMode mBitmapMode;
private: AssetPtr<ImageAsset> mBitmapAsset; public: void _setBitmap(StringTableEntry _in) {
private:
AssetPtr<ImageAsset> mBitmapAsset;
String mBitmapFile;
public:
void _setBitmap(StringTableEntry _in) {
if (mBitmapAsset.getAssetId() == _in) return; if (!AssetDatabase.isDeclaredAsset(_in)) {
StringTableEntry imageAssetId = ImageAsset::smNoImageAssetFallback; AssetQuery query; S32 foundAssetcount = AssetDatabase.findAssetLooseFile(&query, _in); if (foundAssetcount != 0) {
imageAssetId = query.mAssetList[0];