SoundAsset Refactor

This commit is contained in:
marauder2k7 2025-12-12 12:27:33 +00:00
parent 9f29bee45f
commit da40838560
61 changed files with 1333 additions and 1828 deletions

View file

@ -244,8 +244,6 @@ GuiControlProfile::GuiControlProfile(void) :
mTextOffset(0,0),
mBitmapArrayRects(0)
{
INIT_ASSET(SoundButtonDown);
INIT_ASSET(SoundButtonOver);
mLoadCount = 0;
mUseCount = 0;
@ -321,21 +319,6 @@ GuiControlProfile::GuiControlProfile(void) :
mUseBitmapArray = def->mUseBitmapArray;
mTextOffset = def->mTextOffset;
// default sound
_setSoundButtonDown(def->getSoundButtonDown());
if (getSoundButtonDown() != StringTable->EmptyString())
{
if (!getSoundButtonDownProfile())
Con::errorf(ConsoleLogEntry::General, "GuiControlProfile: Can't get default button pressed sound asset.");
}
_setSoundButtonOver(def->getSoundButtonOver());
if (getSoundButtonOver() != StringTable->EmptyString())
{
if (!getSoundButtonOverProfile())
Con::errorf(ConsoleLogEntry::General, "GuiControlProfile: Can't get default button hover sound asset.");
}
//used by GuiTextCtrl
mModal = def->mModal;
mAlignment = def->mAlignment;

View file

@ -467,10 +467,8 @@ public:
Vector<RectI> mBitmapArrayRects; ///< Used for controls which use an array of bitmaps such as checkboxes
DECLARE_SOUNDASSET(GuiControlProfile, SoundButtonDown); ///< Sound played when a button is pressed.
DECLARE_ASSET_SETGET(GuiControlProfile, SoundButtonDown);
DECLARE_SOUNDASSET(GuiControlProfile, SoundButtonOver); ///< Sound played when a button is hovered.
DECLARE_ASSET_SETGET(GuiControlProfile, SoundButtonOver);
StringTableEntry mChildrenProfileName; ///< The name of the profile to use for the children controls