mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-20 13:23:45 -07:00
Merge a3e41841bf
into 7b4df9bdb2
This commit is contained in:
commit
de0e9cbef6
4 changed files with 33 additions and 0 deletions
|
@ -468,8 +468,17 @@ void AudioEditorRegisterOnSceneInitHook() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AudioEditorRegisterOnGenerationCompletionHook() {
|
||||||
|
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnGenerationCompletion>([]() {
|
||||||
|
if (CVarGetInteger(CVAR_AUDIO("RandomizeAllOnRandoGen"), 0)) {
|
||||||
|
AudioEditor_RandomizeAll();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
void AudioEditor::InitElement() {
|
void AudioEditor::InitElement() {
|
||||||
AudioEditorRegisterOnSceneInitHook();
|
AudioEditorRegisterOnSceneInitHook();
|
||||||
|
AudioEditorRegisterOnGenerationCompletionHook();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudioEditor::DrawElement() {
|
void AudioEditor::DrawElement() {
|
||||||
|
@ -573,6 +582,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("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(
|
UIWidgets::CVarCheckbox(
|
||||||
"Lower Octaves of Unplayable High Notes", CVAR_AUDIO("ExperimentalOctaveDrop"),
|
"Lower Octaves of Unplayable High Notes", CVAR_AUDIO("ExperimentalOctaveDrop"),
|
||||||
UIWidgets::CheckboxOptions()
|
UIWidgets::CheckboxOptions()
|
||||||
|
|
|
@ -2382,6 +2382,11 @@ void CosmeticsEditorWindow::DrawElement() {
|
||||||
.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."));
|
||||||
ImGui::EndDisabled();
|
ImGui::EndDisabled();
|
||||||
|
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."));
|
||||||
UIWidgets::CVarCheckbox(
|
UIWidgets::CVarCheckbox(
|
||||||
"Advanced Mode", CVAR_COSMETIC("AdvancedMode"),
|
"Advanced Mode", CVAR_COSMETIC("AdvancedMode"),
|
||||||
UIWidgets::CheckboxOptions()
|
UIWidgets::CheckboxOptions()
|
||||||
|
@ -2589,6 +2594,14 @@ void Cosmetics_RegisterOnSceneInitHook() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CosmeticsEditorRegisterOnGenerationCompletionHook() {
|
||||||
|
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnGenerationCompletion>([]() {
|
||||||
|
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) {
|
||||||
|
@ -2608,6 +2621,7 @@ void CosmeticsEditorWindow::InitElement() {
|
||||||
RegisterOnLoadGameHook();
|
RegisterOnLoadGameHook();
|
||||||
RegisterOnGameFrameUpdateHook();
|
RegisterOnGameFrameUpdateHook();
|
||||||
Cosmetics_RegisterOnSceneInitHook();
|
Cosmetics_RegisterOnSceneInitHook();
|
||||||
|
CosmeticsEditorRegisterOnGenerationCompletionHook();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CosmeticsEditor_RandomizeAll() {
|
void CosmeticsEditor_RandomizeAll() {
|
||||||
|
|
|
@ -68,6 +68,7 @@ DEFINE_HOOK(OnUpdateFileBossRushOptionSelection, (uint8_t optionIndex, uint8_t o
|
||||||
DEFINE_HOOK(OnUpdateFileRandomizerOptionSelection, (uint8_t optionIndex));
|
DEFINE_HOOK(OnUpdateFileRandomizerOptionSelection, (uint8_t optionIndex));
|
||||||
DEFINE_HOOK(OnUpdateFileNameSelection, (int16_t charCode));
|
DEFINE_HOOK(OnUpdateFileNameSelection, (int16_t charCode));
|
||||||
DEFINE_HOOK(OnFileChooseMain, (void* gameState));
|
DEFINE_HOOK(OnFileChooseMain, (void* gameState));
|
||||||
|
DEFINE_HOOK(OnGenerationCompletion, ());
|
||||||
|
|
||||||
DEFINE_HOOK(OnSetGameLanguage, ());
|
DEFINE_HOOK(OnSetGameLanguage, ());
|
||||||
DEFINE_HOOK(OnFileDropped, (std::string filePath));
|
DEFINE_HOOK(OnFileDropped, (std::string filePath));
|
||||||
|
|
|
@ -3800,6 +3800,8 @@ void GenerateRandomizerImgui(std::string seed = "") {
|
||||||
Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
|
Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
|
||||||
|
|
||||||
generated = 1;
|
generated = 1;
|
||||||
|
|
||||||
|
GameInteractor::Instance->ExecuteHooks<GameInteractor::OnGenerationCompletion>();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GenerateRandomizer(std::string seed /*= ""*/) {
|
bool GenerateRandomizer(std::string seed /*= ""*/) {
|
||||||
|
@ -3809,6 +3811,7 @@ bool GenerateRandomizer(std::string seed /*= ""*/) {
|
||||||
}
|
}
|
||||||
if (CVarGetInteger(CVAR_GENERAL("RandoGenerating"), 0) == 0) {
|
if (CVarGetInteger(CVAR_GENERAL("RandoGenerating"), 0) == 0) {
|
||||||
randoThread = std::thread(&GenerateRandomizerImgui, seed);
|
randoThread = std::thread(&GenerateRandomizerImgui, seed);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue