From 53b0f0530c180bfd4ae50259d7626e206597f754 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Mon, 29 Aug 2022 16:36:17 -0500 Subject: [PATCH] soundasset sourcegroup fallback ensure if there's no assigned sourcegroup, we at least point at "AudioChannelMaster" so overall sound volume can have it's say turn on button hover and click profiles by unremming the file assign hoverasset and buttonclick assets to audioChannelGUI todo: sort volume hooks for non-AudioChannelMaster long term: resolve the requirement that gui profiles need direct sound profiles instead of the capacity to take assets --- Engine/source/T3D/assets/SoundAsset.cpp | 2 ++ Templates/BaseGame/game/data/UI/UI.tscript | 2 +- .../BaseGame/game/data/UI/sounds/buttonClick.asset.taml | 5 ++++- .../BaseGame/game/data/UI/sounds/buttonHover.asset.taml | 7 ++++++- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Engine/source/T3D/assets/SoundAsset.cpp b/Engine/source/T3D/assets/SoundAsset.cpp index b783b6858..d7fc3ebad 100644 --- a/Engine/source/T3D/assets/SoundAsset.cpp +++ b/Engine/source/T3D/assets/SoundAsset.cpp @@ -225,6 +225,8 @@ bool SoundAsset::loadSound() } else {// = new SFXProfile(mProfileDesc, mSoundFile, mPreload); + if (mProfileDesc.mSourceGroup == NULL) + mProfileDesc.mSourceGroup = dynamic_cast(Sim::findObject("AudioChannelMaster")); mSFXProfile.setDescription(&mProfileDesc); mSFXProfile.setSoundFileName(mSoundPath); mSFXProfile.setPreload(mPreload); diff --git a/Templates/BaseGame/game/data/UI/UI.tscript b/Templates/BaseGame/game/data/UI/UI.tscript index 9dae2fe5d..d3012a905 100644 --- a/Templates/BaseGame/game/data/UI/UI.tscript +++ b/Templates/BaseGame/game/data/UI/UI.tscript @@ -30,7 +30,7 @@ function UI::initClient(%this) { //Load UI stuff //we need to load this because some of the menu profiles use the sounds here - //%this.queueExec("./datablocks/guiSounds"); + %this.queueExec("./datablocks/guiSounds"); //Profiles %this.queueExec("./scripts/profiles"); diff --git a/Templates/BaseGame/game/data/UI/sounds/buttonClick.asset.taml b/Templates/BaseGame/game/data/UI/sounds/buttonClick.asset.taml index 99773fd2d..cd0089aab 100644 --- a/Templates/BaseGame/game/data/UI/sounds/buttonClick.asset.taml +++ b/Templates/BaseGame/game/data/UI/sounds/buttonClick.asset.taml @@ -1 +1,4 @@ - + diff --git a/Templates/BaseGame/game/data/UI/sounds/buttonHover.asset.taml b/Templates/BaseGame/game/data/UI/sounds/buttonHover.asset.taml index 00b1af405..858e11a42 100644 --- a/Templates/BaseGame/game/data/UI/sounds/buttonHover.asset.taml +++ b/Templates/BaseGame/game/data/UI/sounds/buttonHover.asset.taml @@ -1 +1,6 @@ - +