From 65275a8a35646413d72d1ebda3e0d9d395435523 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Mon, 29 Aug 2022 21:18:20 -0500 Subject: [PATCH 1/2] leftover profile reference flaw --- Engine/source/gui/buttons/guiButtonBaseCtrl.cpp | 6 +++--- Engine/source/gui/controls/guiSliderCtrl.cpp | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Engine/source/gui/buttons/guiButtonBaseCtrl.cpp b/Engine/source/gui/buttons/guiButtonBaseCtrl.cpp index c4c3da811..b4232217f 100644 --- a/Engine/source/gui/buttons/guiButtonBaseCtrl.cpp +++ b/Engine/source/gui/buttons/guiButtonBaseCtrl.cpp @@ -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; diff --git a/Engine/source/gui/controls/guiSliderCtrl.cpp b/Engine/source/gui/controls/guiSliderCtrl.cpp index 9b7354d6d..9c61aaf5e 100644 --- a/Engine/source/gui/controls/guiSliderCtrl.cpp +++ b/Engine/source/gui/controls/guiSliderCtrl.cpp @@ -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; From 73c1a902deffa409cfdf1c5b37123bfd145f4dda Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Mon, 29 Aug 2022 21:43:14 -0500 Subject: [PATCH 2/2] cAps fix --- Engine/source/T3D/assets/SoundAssetInspectors.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engine/source/T3D/assets/SoundAssetInspectors.h b/Engine/source/T3D/assets/SoundAssetInspectors.h index 23262151f..6fb23fdfc 100644 --- a/Engine/source/T3D/assets/SoundAssetInspectors.h +++ b/Engine/source/T3D/assets/SoundAssetInspectors.h @@ -1,6 +1,6 @@ #pragma once -#include "Soundasset.h" +#include "SoundAsset.h" #ifndef _GUI_INSPECTOR_TYPES_H_ #include "gui/editor/guiInspectorTypes.h"