diff --git a/assets/ConfigMenuSelectionViewController.bsml b/assets/ConfigMenuSelectionViewController.bsml
index 5296f80..7422bb2 100644
--- a/assets/ConfigMenuSelectionViewController.bsml
+++ b/assets/ConfigMenuSelectionViewController.bsml
@@ -8,10 +8,11 @@
-
+
-
+
+
diff --git a/include/AudioClips.hpp b/include/AudioClips.hpp
index 7ba6b18..9909338 100644
--- a/include/AudioClips.hpp
+++ b/include/AudioClips.hpp
@@ -7,6 +7,7 @@ namespace QuestSounds::AudioClips {
extern QuestSounds::Utils::AsyncAudioClipLoader hitSoundLoader, // hitSound
badHitSoundLoader, // badHitSound
noteMissedSoundLoader,
+ bombExplosionSoundLoader,
menuMusicLoader, // menuMusic
menuClickLoader,
fireworkSoundLoader,
@@ -16,6 +17,7 @@ namespace QuestSounds::AudioClips {
extern ::ArrayW<::UnityW<::UnityEngine::AudioClip>> hitSoundArr, // hitSoundArray
badHitSoundArr, // badHitSoundArray
+ bombExplosionSoundLoaderArr,
menuClickArr,
fireworkSoundArr;
diff --git a/include/Config.hpp b/include/Config.hpp
index 50e9515..c1b003b 100644
--- a/include/Config.hpp
+++ b/include/Config.hpp
@@ -57,10 +57,12 @@ namespace QuestSounds {
SOUND_VALUE_SIMPLE(LevelCleared, "LevelCleared");
SOUND_VALUE(LevelFailed, "LevelFailed", 0);
SOUND_VALUE_SIMPLE(LobbyMusic, "LobbyMusic");
+ SOUND_VALUE(BombExplosionSound, "BombExplosionSounds", 0);
)
DECLARE_JSON_CLASS(
SoundsConfig,
+ VALUE_DEFAULT(std::string, ConfigVersion, "3.1.0");
NAMED_VALUE(Sounds, Sounds, NAME_OPTS("SoundsConfig_v3", "SoundsConfig_v2", "SoundsConfig_v1", "Sounds"));
)
extern SoundsConfig Config;
diff --git a/include/UI/ConfigMenuSelectionViewController.hpp b/include/UI/ConfigMenuSelectionViewController.hpp
index 8b8829f..fc5acc1 100644
--- a/include/UI/ConfigMenuSelectionViewController.hpp
+++ b/include/UI/ConfigMenuSelectionViewController.hpp
@@ -21,6 +21,7 @@ DECLARE_CLASS_CODEGEN(QuestSounds::UI, ConfigMenuSelectionViewController, HMUI::
DECLARE_INSTANCE_METHOD(void, LevelClearedButtonPressed);
DECLARE_INSTANCE_METHOD(void, LevelFailedButtonPressed);
DECLARE_INSTANCE_METHOD(void, FireworkButtonPressed);
+ DECLARE_INSTANCE_METHOD(void, BombExplosionSoundButtonPressed);
DECLARE_CTOR(ctor);
diff --git a/src/Hooks/NoteSoundHook.cpp b/src/Hooks/NoteSoundHook.cpp
index 920b4b1..81aad77 100644
--- a/src/Hooks/NoteSoundHook.cpp
+++ b/src/Hooks/NoteSoundHook.cpp
@@ -9,6 +9,7 @@ using namespace QuestSounds::AudioClips;
#include "GlobalNamespace/NoteCutSoundEffectManager.hpp"
#include "GlobalNamespace/NoteCutSoundEffect.hpp"
+#include "GlobalNamespace/BombCutSoundEffectManager.hpp"
#include "GlobalNamespace/BeatmapObjectManager.hpp"
#include "GlobalNamespace/NoteController.hpp"
#include "GlobalNamespace/NoteData.hpp"
@@ -16,6 +17,7 @@ using namespace QuestSounds::AudioClips;
using namespace GlobalNamespace;
+#pragma region HitSounds
MAKE_AUTO_HOOK_MATCH(NoteCutSoundEffectManager_Start, &NoteCutSoundEffectManager::Start, void, NoteCutSoundEffectManager* self) {
if(hitSoundLoader.loaded && Config.Sounds.HitSound.Active)
@@ -36,6 +38,10 @@ MAKE_AUTO_HOOK_MATCH(NoteCutSoundEffectManager_Start, &NoteCutSoundEffectManager
getLogger().debug("Beatalign offset is: {}", self->_beatAlignOffset);
}
+#pragma endregion
+
+#pragma region HitSoundsAndBadHitSounds
+
MAKE_AUTO_HOOK_MATCH(NoteCutSoundEffect_Awake, &NoteCutSoundEffect::Awake, void, NoteCutSoundEffect* self) {
if (hitSoundLoader.loaded && Config.Sounds.HitSound.Active) {
self->_goodCutVolume += Config.Sounds.HitSound.VolumeOffset.value_or(0.0f);
@@ -50,6 +56,10 @@ MAKE_AUTO_HOOK_MATCH(NoteCutSoundEffect_Awake, &NoteCutSoundEffect::Awake, void,
NoteCutSoundEffect_Awake(self);
}
+#pragma endregion
+
+#pragma region NoteMissedSounds
+
MAKE_AUTO_HOOK_MATCH(BeatmapObjectManager_HandleNoteWasMissed, &BeatmapObjectManager::HandleNoteControllerNoteWasMissed, void, BeatmapObjectManager* self, NoteController* noteController) {
BeatmapObjectManager_HandleNoteWasMissed(self, noteController);
if (noteMissedSoundLoader.loaded &&
@@ -67,4 +77,19 @@ MAKE_AUTO_HOOK_MATCH(PauseMenuManager_MenuButtonPressed, &PauseMenuManager::Menu
if (noteMissedSoundLoader.audioSource) noteMissedSoundLoader.audioSource->Stop();
}
PauseMenuManager_MenuButtonPressed(self);
-}
\ No newline at end of file
+}
+
+#pragma endregion
+
+#pragma region BombHitSounds
+
+MAKE_AUTO_HOOK_MATCH(BombCutSoundEffectManager_Start, &BombCutSoundEffectManager::Start, void, BombCutSoundEffectManager* self) {
+ if (bombExplosionSoundLoader.loaded && Config.Sounds.BombExplosionSound.Active) {
+ bombExplosionSoundLoaderArr = createAudioClipArray(bombExplosionSoundLoader);
+ self->_bombExplosionAudioClips = bombExplosionSoundLoaderArr;
+ self->_volume += Config.Sounds.BombExplosionSound.VolumeOffset.value_or(0.0f);
+ }
+ BombCutSoundEffectManager_Start(self);
+}
+
+#pragma endregion
\ No newline at end of file
diff --git a/src/UI/ConfigMenuSelectionViewController.cpp b/src/UI/ConfigMenuSelectionViewController.cpp
index a947a6c..74dd7ff 100644
--- a/src/UI/ConfigMenuSelectionViewController.cpp
+++ b/src/UI/ConfigMenuSelectionViewController.cpp
@@ -89,4 +89,11 @@ namespace QuestSounds::UI {
callback(8);
}
}
+
+ void ConfigMenuSelectionViewController::BombExplosionSoundButtonPressed() {
+ getLogger().info("BombExplosionSoundButtonPressed");
+ if (callback) {
+ callback(9);
+ }
+ }
}
\ No newline at end of file
diff --git a/src/UI/QuestSoundsFlowCoordinator.cpp b/src/UI/QuestSoundsFlowCoordinator.cpp
index 466c8dd..b9b9e9d 100644
--- a/src/UI/QuestSoundsFlowCoordinator.cpp
+++ b/src/UI/QuestSoundsFlowCoordinator.cpp
@@ -131,6 +131,12 @@ namespace QuestSounds::UI {
SetTitle("Firework", HMUI::ViewController::AnimationType::In);
// ReplaceTopViewController(soundSettingsViewController, nullptr, HMUI::ViewController::AnimationType::In, HMUI::ViewController::AnimationDirection::Horizontal);
break;
+ case 9:
+ getLogger().info("BombExplosionSoundButtonPressed");
+ soundSettingsViewController->Setup("BombExplosionSounds", &QuestSounds::Config.Sounds.BombExplosionSound, &QuestSounds::AudioClips::bombExplosionSoundLoader);
+ SetTitle("Bomb Explosion Sound", HMUI::ViewController::AnimationType::In);
+ // ReplaceTopViewController(soundSettingsViewController, nullptr, HMUI::ViewController::AnimationType::In, HMUI::ViewController::AnimationDirection::Horizontal);
+ break;
default:
getLogger().error("Invalid index");
SetTitle("QuestSounds", HMUI::ViewController::AnimationType::In);
diff --git a/src/main.cpp b/src/main.cpp
index 5f1b095..d523645 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -72,6 +72,15 @@ void makeFolder()
}
}
+ if (!direxists(Config.Sounds.BombExplosionSound.FolderPath.c_str()))
+ {
+ int makePath = mkpath(Config.Sounds.BombExplosionSound.FolderPath.c_str());
+ if (makePath == -1)
+ {
+ getLogger().error("Failed to make BombExplosionSound Folder path!");
+ }
+ }
+
if (!direxists(Config.Sounds.MenuClick.FolderPath.c_str()))
{
int makePath = mkpath(Config.Sounds.MenuClick.FolderPath.c_str());
@@ -125,6 +134,7 @@ namespace QuestSounds::AudioClips {
QuestSounds::Utils::AsyncAudioClipLoader hitSoundLoader, // hitSound
badHitSoundLoader, // badHitSound
noteMissedSoundLoader,
+ bombExplosionSoundLoader,
menuMusicLoader, // menuMusic
menuClickLoader,
fireworkSoundLoader,
@@ -133,6 +143,7 @@ QuestSounds::Utils::AsyncAudioClipLoader hitSoundLoader, // hitSound
lobbyAmbienceLoader; // Added for LobbyMusic
::ArrayW<::UnityW<::UnityEngine::AudioClip>> hitSoundArr, // hitSoundArray
badHitSoundArr, // badHitSoundArray
+ bombExplosionSoundLoaderArr,
menuClickArr,
fireworkSoundArr;
@@ -145,6 +156,7 @@ ::ArrayW<::UnityW<::UnityEngine::AudioClip>> origMenuClickArr;
hitSoundLoader.streamAudio = false; // Streaming HitSounds breaks them
badHitSoundLoader.filePath = Config.Sounds.BadHitSound.FilePath;
noteMissedSoundLoader.filePath = Config.Sounds.NoteMissedSound.FilePath;
+ bombExplosionSoundLoader.filePath = Config.Sounds.BombExplosionSound.FilePath;
menuMusicLoader.filePath = Config.Sounds.MenuMusic.FilePath;
menuClickLoader.filePath = Config.Sounds.MenuClick.FilePath;
fireworkSoundLoader.filePath = Config.Sounds.Firework.FilePath;
@@ -157,6 +169,7 @@ ::ArrayW<::UnityW<::UnityEngine::AudioClip>> origMenuClickArr;
if (Config.Sounds.HitSound.Active) hitSoundLoader.load();
if (Config.Sounds.BadHitSound.Active) badHitSoundLoader.load();
if (Config.Sounds.NoteMissedSound.Active) noteMissedSoundLoader.load();
+ if (Config.Sounds.BombExplosionSound.Active) bombExplosionSoundLoader.load();
if (Config.Sounds.Firework.Active) fireworkSoundLoader.load();
if (Config.Sounds.LevelCleared.Active) levelClearedLoader.load();
if (Config.Sounds.LevelFailed.Active) levelFailedLoader.load();