mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-21 13:53:49 -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() {
|
void AudioEditor::InitElement() {
|
||||||
AudioEditorRegisterOnSceneInitHook();
|
AudioEditorRegisterOnSceneInitHook();
|
||||||
|
AudioEditorRegisterOnRandomizerGenerationHook();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudioEditor::DrawElement() {
|
void AudioEditor::DrawElement() {
|
||||||
|
@ -564,12 +573,12 @@ void AudioEditor::DrawElement() {
|
||||||
.Color(THEME_COLOR)
|
.Color(THEME_COLOR)
|
||||||
.Tooltip(
|
.Tooltip(
|
||||||
"Enables randomizing all unlocked music and sound effects when you enter a new scene."));
|
"Enables randomizing all unlocked music and sound effects when you enter a new scene."));
|
||||||
UIWidgets::CVarCheckbox(
|
UIWidgets::CVarCheckbox("Randomize All Music and Sound Effects on Randomizer Generation",
|
||||||
"Randomize All Music and Sound Effects on Randomizer Generation",CVAR_AUDIO("RandomizeAllOnNewRandoGen"),
|
CVAR_AUDIO("RandomizeAllOnRandoGen"),
|
||||||
UIWidgets::CheckboxOptions()
|
UIWidgets::CheckboxOptions()
|
||||||
.Color(THEME_COLOR)
|
.Color(THEME_COLOR)
|
||||||
.Tooltip(
|
.Tooltip("Enables randomizing all unlocked music and sound effects when "
|
||||||
"Enables randomizing all unlocked music and sound effects when you generate a new randomizer."));
|
"you generate a new randomizer."));
|
||||||
UIWidgets::CVarCheckbox(
|
UIWidgets::CVarCheckbox(
|
||||||
"Lower Octaves of Unplayable High Notes", CVAR_AUDIO("ExperimentalOctaveDrop"),
|
"Lower Octaves of Unplayable High Notes", CVAR_AUDIO("ExperimentalOctaveDrop"),
|
||||||
UIWidgets::CheckboxOptions()
|
UIWidgets::CheckboxOptions()
|
||||||
|
|
|
@ -2380,7 +2380,8 @@ void CosmeticsEditorWindow::DrawElement() {
|
||||||
UIWidgets::CheckboxOptions()
|
UIWidgets::CheckboxOptions()
|
||||||
.Color(THEME_COLOR)
|
.Color(THEME_COLOR)
|
||||||
.Tooltip("Enables randomizing all unlocked cosmetics when you enter a new scene."));
|
.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()
|
UIWidgets::CheckboxOptions()
|
||||||
.Color(THEME_COLOR)
|
.Color(THEME_COLOR)
|
||||||
.Tooltip("Enables randomizing all unlocked cosmetics when you generate a new randomizer."));
|
.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() {
|
void CosmeticsEditorWindow::InitElement() {
|
||||||
// Convert the `current color` into the format that the ImGui color picker expects
|
// Convert the `current color` into the format that the ImGui color picker expects
|
||||||
for (auto& [id, cosmeticOption] : cosmeticOptions) {
|
for (auto& [id, cosmeticOption] : cosmeticOptions) {
|
||||||
|
@ -2603,6 +2612,7 @@ void CosmeticsEditorWindow::InitElement() {
|
||||||
RegisterOnLoadGameHook();
|
RegisterOnLoadGameHook();
|
||||||
RegisterOnGameFrameUpdateHook();
|
RegisterOnGameFrameUpdateHook();
|
||||||
Cosmetics_RegisterOnSceneInitHook();
|
Cosmetics_RegisterOnSceneInitHook();
|
||||||
|
CosmeticsEditorRegisterOnRandomizerGenerationHook();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CosmeticsEditor_RandomizeAll() {
|
void CosmeticsEditor_RandomizeAll() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue