Change GuiProfile to use Sound Asset

-Added SoundAssetInspector to bypass circular issue
-Added SoundAsset to GuiTypes
This commit is contained in:
marauder2k7 2022-08-29 23:40:51 +01:00
parent ebbf0947b3
commit 5d85664b40
10 changed files with 91 additions and 106 deletions

View file

@ -252,8 +252,8 @@ void GuiButtonBaseCtrl::onMouseDown(const GuiEvent &event)
if (mProfile->mCanKeyFocus)
setFirstResponder();
if (mProfile->mSoundButtonDown)
SFX->playOnce(mProfile->mSoundButtonDown);
if (mProfile->getSoundButtonDown())
SFX->playOnce(mProfile->getSoundButtonDownProfile());
mMouseDownPoint = event.mousePoint;
mMouseDragged = false;
@ -292,8 +292,8 @@ void GuiButtonBaseCtrl::onMouseEnter(const GuiEvent &event)
}
else
{
if ( mActive && mProfile->mSoundButtonOver )
SFX->playOnce(mProfile->mSoundButtonOver);
if (mProfile->getSoundButtonOver())
SFX->playOnce(mProfile->getSoundButtonOverProfile());
mHighlighted = true;
}
@ -377,8 +377,8 @@ bool GuiButtonBaseCtrl::onKeyDown(const GuiEvent &event)
if ((event.keyCode == KEY_RETURN || event.keyCode == KEY_SPACE)
&& event.modifier == 0)
{
if ( mProfile->mSoundButtonDown )
SFX->playOnce( mProfile->mSoundButtonDown);
if (mProfile->getSoundButtonDown())
SFX->playOnce(mProfile->getSoundButtonDownProfile());
return true;
}