Updates ImageAsset usage to utilize AssetRef, and standardizes the setter/getter functions and naming conventions, as well as the ability to use and bind named targets.

This commit is contained in:
JeffR 2026-06-16 17:39:30 -05:00
parent a858d8624e
commit 34e3f78a22
82 changed files with 1451 additions and 951 deletions

View file

@ -67,7 +67,8 @@ void GuiChunkedBitmapCtrl::initPersistFields()
{
docsURL;
addGroup("GuiChunkedBitmapCtrl");
INITPERSISTFIELD_IMAGEASSET(Bitmap, GuiChunkedBitmapCtrl, "This is the bitmap to render to the control.");
ADD_FIELD("bitmapAsset", TypeImageAssetRef, Offset(mBitmapAssetRef, GuiChunkedBitmapCtrl))
.doc("This is the bitmap asset to render to the control.");
addField( "useVariable", TypeBool, Offset( mUseVariable, GuiChunkedBitmapCtrl ), "This decides whether to use the \"bitmap\" file "
"or a bitmap stored in \"variable\"");
@ -92,6 +93,21 @@ GuiChunkedBitmapCtrl::GuiChunkedBitmapCtrl()
mTile = false;
}
void GuiChunkedBitmapCtrl::_setBitmap(StringTableEntry _in)
{
if (mBitmapAssetRef.assetId == _in)
return;
if (ImageAsset::isNamedTarget(_in))
{
mBitmapAssetRef.assetId = _in;
mBitmapAssetRef.assetPtr = ImageAsset::getNamedTargetAssetPtr(_in);
return;
}
mBitmapAssetRef = _in;
}
void GuiChunkedBitmapCtrl::setBitmap(const char *name)
{
bool awake = mAwake;