review notes from Az

Should render fallback for namedTarget if namedTarget fails
Add safety around namedtarget getTexture to stop assert
Missing assets should revert to fallback image and print a warning to console
Remove REFACTOR tag from all macros.
This commit is contained in:
marauder2k7 2025-03-30 11:22:42 +01:00
parent b707b2e2b7
commit 73ad92b757
60 changed files with 189 additions and 164 deletions

View file

@ -70,7 +70,7 @@ void GuiBitmapCtrl::initPersistFields()
docsURL;
addGroup("Bitmap");
INITPERSISTFIELD_IMAGEASSET_REFACTOR(Bitmap, GuiBitmapCtrl, "The bitmap to render in this BitmapCtrl.")
INITPERSISTFIELD_IMAGEASSET(Bitmap, GuiBitmapCtrl, "The bitmap to render in this BitmapCtrl.")
addField("color", TypeColorI, Offset(mColor, GuiBitmapCtrl), "color mul");
addField("wrap", TypeBool, Offset(mWrap, GuiBitmapCtrl), "If true, the bitmap is tiled inside the control rather than stretched to fit.");

View file

@ -39,7 +39,7 @@ protected:
/// Name of the bitmap file. If this is 'texhandle' the bitmap is not loaded
/// from a file but rather set explicitly on the control.
DECLARE_IMAGEASSET_REFACTOR(GuiBitmapCtrl, Bitmap, GFXDefaultGUIProfile)
DECLARE_IMAGEASSET(GuiBitmapCtrl, Bitmap, GFXDefaultGUIProfile)
Point2I mStartPoint;
ColorI mColor;

View file

@ -826,9 +826,9 @@ IMPLEMENT_CALLBACK(GuiGameSettingsCtrl, onAxisEvent, void, (const char* device,
void GuiGameSettingsCtrl::initPersistFields()
{
docsURL;
INITPERSISTFIELD_IMAGEASSET_REFACTOR(KeybindBitmap, GuiGameSettingsCtrl, "Bitmap used to display the bound key for this keybind option.");
INITPERSISTFIELD_IMAGEASSET_REFACTOR(PreviousBitmap, GuiGameSettingsCtrl, "Bitmap used for the previous button when in list mode.");
INITPERSISTFIELD_IMAGEASSET_REFACTOR(NextBitmap, GuiGameSettingsCtrl, "Bitmap used for the next button when in list mode.");
INITPERSISTFIELD_IMAGEASSET(KeybindBitmap, GuiGameSettingsCtrl, "Bitmap used to display the bound key for this keybind option.");
INITPERSISTFIELD_IMAGEASSET(PreviousBitmap, GuiGameSettingsCtrl, "Bitmap used for the previous button when in list mode.");
INITPERSISTFIELD_IMAGEASSET(NextBitmap, GuiGameSettingsCtrl, "Bitmap used for the next button when in list mode.");
addFieldV("arrowSize", TypeRangedS32, Offset(mArrowSize, GuiGameSettingsCtrl), &CommonValidators::PositiveInt,
"Size of the arrow buttons' extents");

View file

@ -72,9 +72,9 @@ protected:
Point2F mRange; ///< When working as a slider, this sets our min/max range
//Keybind option
DECLARE_IMAGEASSET_REFACTOR(GuiGameSettingsCtrl, KeybindBitmap, GFXDefaultGUIProfile)
DECLARE_IMAGEASSET_REFACTOR(GuiGameSettingsCtrl, PreviousBitmap, GFXDefaultGUIProfile)
DECLARE_IMAGEASSET_REFACTOR(GuiGameSettingsCtrl, NextBitmap, GFXDefaultGUIProfile)
DECLARE_IMAGEASSET(GuiGameSettingsCtrl, KeybindBitmap, GFXDefaultGUIProfile)
DECLARE_IMAGEASSET(GuiGameSettingsCtrl, PreviousBitmap, GFXDefaultGUIProfile)
DECLARE_IMAGEASSET(GuiGameSettingsCtrl, NextBitmap, GFXDefaultGUIProfile)
S32 mArrowSize;
S32 mColumnSplit; //Padding between the leftmost edge of the control, and the left side of the 'option'.

View file

@ -126,7 +126,7 @@ protected:
NumBitmapModes = 2
};
DECLARE_IMAGEASSET_ARRAY_REFACTOR(GuiPopUpMenuCtrl, Bitmap, GFXDefaultGUIProfile, NumBitmapModes)
DECLARE_IMAGEASSET_ARRAY(GuiPopUpMenuCtrl, Bitmap, GFXDefaultGUIProfile, NumBitmapModes)
Point2I mBitmapBounds; // Added
S32 mIdMax;

View file

@ -131,7 +131,7 @@ class GuiPopUpMenuCtrlEx : public GuiTextCtrl
NumBitmapModes = 2
};
DECLARE_IMAGEASSET_ARRAY_REFACTOR(GuiPopUpMenuCtrlEx, Bitmap, GFXDefaultGUIProfile, NumBitmapModes)
DECLARE_IMAGEASSET_ARRAY(GuiPopUpMenuCtrlEx, Bitmap, GFXDefaultGUIProfile, NumBitmapModes)
Point2I mBitmapBounds; // Added