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.
This commit is contained in:
Glought 2025-04-11 07:43:25 -07:00
commit d8e90a701c
3 changed files with 16 additions and 0 deletions

View file

@ -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()

View file

@ -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()

View file

@ -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;