From d8e90a701c36e80979c5316f72c017873c45cc4c Mon Sep 17 00:00:00 2001 From: Glought <663343+Glought@users.noreply.github.com> Date: Fri, 11 Apr 2025 07:43:25 -0700 Subject: [PATCH] Add "Randomize on Randomizer Generation" options to Audio and Cosmetics Editors * Added "Randomize All Music and Sound Effects on Randomizer Generation" to the Audio Editor. * Added "Randomize All on Randomizer Generation" to the Cosmetics Editor. When enabled, these options randomize audio and/or cosmetics during a new randomizer generation. --- soh/soh/Enhancements/audio/AudioEditor.cpp | 6 ++++++ soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp | 4 ++++ soh/soh/Enhancements/randomizer/randomizer.cpp | 6 ++++++ 3 files changed, 16 insertions(+) diff --git a/soh/soh/Enhancements/audio/AudioEditor.cpp b/soh/soh/Enhancements/audio/AudioEditor.cpp index 9865615bd..f7e8974de 100644 --- a/soh/soh/Enhancements/audio/AudioEditor.cpp +++ b/soh/soh/Enhancements/audio/AudioEditor.cpp @@ -564,6 +564,12 @@ void AudioEditor::DrawElement() { .Color(THEME_COLOR) .Tooltip( "Enables randomizing all unlocked music and sound effects when you enter a new scene.")); + UIWidgets::CVarCheckbox( + "Randomize All Music and Sound Effects on Randomizer Generation",CVAR_AUDIO("RandomizeAllOnNewRandoGen"), + UIWidgets::CheckboxOptions() + .Color(THEME_COLOR) + .Tooltip( + "Enables randomizing all unlocked music and sound effects when you generate a new randomizer.")); UIWidgets::CVarCheckbox( "Lower Octaves of Unplayable High Notes", CVAR_AUDIO("ExperimentalOctaveDrop"), UIWidgets::CheckboxOptions() diff --git a/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp b/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp index e0f530bc2..68dc844ef 100644 --- a/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp +++ b/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp @@ -2380,6 +2380,10 @@ void CosmeticsEditorWindow::DrawElement() { UIWidgets::CheckboxOptions() .Color(THEME_COLOR) .Tooltip("Enables randomizing all unlocked cosmetics when you enter a new scene.")); + UIWidgets::CVarCheckbox("Randomize All on Randomizer Generation", CVAR_COSMETIC("RandomizeAllOnNewRandoGen"), + UIWidgets::CheckboxOptions() + .Color(THEME_COLOR) + .Tooltip("Enables randomizing all unlocked cosmetics when you generate a new randomizer.")); UIWidgets::CVarCheckbox( "Advanced Mode", CVAR_COSMETIC("AdvancedMode"), UIWidgets::CheckboxOptions() diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index d567a3d8e..e7de4c1fb 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -3611,6 +3611,12 @@ bool GenerateRandomizer(std::string seed /*= ""*/) { } if (CVarGetInteger(CVAR_GENERAL("RandoGenerating"), 0) == 0) { randoThread = std::thread(&GenerateRandomizerImgui, seed); + if (CVarGetInteger(CVAR_AUDIO("RandomizeAllOnNewRandoGen"), 0) == 1) { + AudioEditor_RandomizeAll(); + } + if (CVarGetInteger(CVAR_COSMETIC("RandomizeAllOnNewRandoGen"), 0) == 1) { + CosmeticsEditor_RandomizeAll(); + } return true; } return false;