mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-21 05:43:42 -07:00
Changed AudioEditor and CosmeticsEditor "Randomize all on Randomizer Generation" options to use the "OnRandomizerGeneration" Hook.
This commit is contained in:
parent
1ec4ca4344
commit
d69a4a7ea1
2 changed files with 26 additions and 7 deletions
|
@ -459,8 +459,17 @@ void AudioEditorRegisterOnSceneInitHook() {
|
|||
});
|
||||
}
|
||||
|
||||
void AudioEditorRegisterOnRandomizerGenerationHook() {
|
||||
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnRandomizerGeneration>([]() {
|
||||
if (CVarGetInteger(CVAR_AUDIO("RandomizeAllOnRandoGen"), 0)) {
|
||||
AudioEditor_RandomizeAll();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void AudioEditor::InitElement() {
|
||||
AudioEditorRegisterOnSceneInitHook();
|
||||
AudioEditorRegisterOnRandomizerGenerationHook();
|
||||
}
|
||||
|
||||
void AudioEditor::DrawElement() {
|
||||
|
@ -564,12 +573,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("Randomize All Music and Sound Effects on Randomizer Generation",
|
||||
CVAR_AUDIO("RandomizeAllOnRandoGen"),
|
||||
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()
|
||||
|
|
|
@ -2380,7 +2380,8 @@ 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::CVarCheckbox(
|
||||
"Randomize All on Randomizer Generation", CVAR_COSMETIC("RandomizeAllOnRandoGen"),
|
||||
UIWidgets::CheckboxOptions()
|
||||
.Color(THEME_COLOR)
|
||||
.Tooltip("Enables randomizing all unlocked cosmetics when you generate a new randomizer."));
|
||||
|
@ -2584,6 +2585,14 @@ void Cosmetics_RegisterOnSceneInitHook() {
|
|||
});
|
||||
}
|
||||
|
||||
void CosmeticsEditorRegisterOnRandomizerGenerationHook() {
|
||||
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnRandomizerGeneration>([]() {
|
||||
if (CVarGetInteger(CVAR_COSMETIC("RandomizeAllOnRandoGen"), 0)) {
|
||||
CosmeticsEditor_RandomizeAll();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void CosmeticsEditorWindow::InitElement() {
|
||||
// Convert the `current color` into the format that the ImGui color picker expects
|
||||
for (auto& [id, cosmeticOption] : cosmeticOptions) {
|
||||
|
@ -2603,6 +2612,7 @@ void CosmeticsEditorWindow::InitElement() {
|
|||
RegisterOnLoadGameHook();
|
||||
RegisterOnGameFrameUpdateHook();
|
||||
Cosmetics_RegisterOnSceneInitHook();
|
||||
CosmeticsEditorRegisterOnRandomizerGenerationHook();
|
||||
}
|
||||
|
||||
void CosmeticsEditor_RandomizeAll() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue