leftover profile reference flaw

This commit is contained in:
AzaezelX 2022-08-29 21:18:20 -05:00
parent b79b1ae65e
commit 65275a8a35
2 changed files with 8 additions and 4 deletions

View file

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

View file

@ -204,6 +204,9 @@ void GuiSliderCtrl::onMouseDown(const GuiEvent &event)
setFirstResponder();
mDepressed = true;
if (mProfile->isSoundButtonDownValid())
SFX->playOnce(mProfile->getSoundButtonDownProfile());
Point2I curMousePos = globalToLocalCoord( event.mousePoint );
F32 value;
if (getWidth() >= getHeight())
@ -261,7 +264,8 @@ void GuiSliderCtrl::onMouseEnter(const GuiEvent &event)
if( mActive && mProfile->mSoundButtonOver )
{
//F32 pan = (F32(event.mousePoint.x)/F32(getRoot()->getWidth())*2.0f-1.0f)*0.8f;
SFX->playOnce( mProfile->mSoundButtonOver );
if (mProfile->isSoundButtonOverValid())
SFX->playOnce(mProfile->getSoundButtonOverProfile());
}
mMouseOver = true;