From ffa3780d7b0f03f80786c05d41c883359eba12e6 Mon Sep 17 00:00:00 2001 From: aMannus Date: Sun, 24 Jul 2022 12:22:27 +0200 Subject: [PATCH 1/4] Added extra flyout for item fanfares --- libultraship/libultraship/ImGuiImpl.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/libultraship/libultraship/ImGuiImpl.cpp b/libultraship/libultraship/ImGuiImpl.cpp index 8fe9609047..2bef216ea5 100644 --- a/libultraship/libultraship/ImGuiImpl.cpp +++ b/libultraship/libultraship/ImGuiImpl.cpp @@ -1382,6 +1382,19 @@ namespace SohImGui { for (const auto& category : windowCategories) { ImGui::SetCursorPosY(0.0f); if (ImGui::BeginMenu(category.first.c_str())) { + if (category.first == "Randomizer") { + if (ImGui::BeginMenu("Rando Enhancements")) + { + EnhancementCheckbox("Dynamic Item Fanfares", "gRandoFanfareByItemType"); + Tooltip( + "Change what fanfare is played to match the type of item that is\n" + "obtained. This can make fanfares longer than usual in some cases." + ); + + ImGui::EndMenu(); + } + ImGui::Separator(); + } for (const std::string& name : category.second) { std::string varName(name); varName.erase(std::remove_if(varName.begin(), varName.end(), [](unsigned char x) { return std::isspace(x); }), varName.end()); From b42a282a844cdcd916bc1abcc91f9769fedbeac6 Mon Sep 17 00:00:00 2001 From: aMannus Date: Sun, 24 Jul 2022 14:06:55 +0200 Subject: [PATCH 2/4] Manually declared rando menu --- libultraship/libultraship/ImGuiImpl.cpp | 50 ++++++++++++++++--------- 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/libultraship/libultraship/ImGuiImpl.cpp b/libultraship/libultraship/ImGuiImpl.cpp index 2bef216ea5..1eb9bedfc6 100644 --- a/libultraship/libultraship/ImGuiImpl.cpp +++ b/libultraship/libultraship/ImGuiImpl.cpp @@ -1381,30 +1381,44 @@ namespace SohImGui { for (const auto& category : windowCategories) { ImGui::SetCursorPosY(0.0f); - if (ImGui::BeginMenu(category.first.c_str())) { - if (category.first == "Randomizer") { - if (ImGui::BeginMenu("Rando Enhancements")) - { - EnhancementCheckbox("Dynamic Item Fanfares", "gRandoFanfareByItemType"); - Tooltip( - "Change what fanfare is played to match the type of item that is\n" - "obtained. This can make fanfares longer than usual in some cases." - ); + if (category.first != "Randomizer") { + if (ImGui::BeginMenu(category.first.c_str())) { + for (const std::string& name : category.second) { + std::string varName(name); + varName.erase(std::remove_if(varName.begin(), varName.end(), [](unsigned char x) { return std::isspace(x); }), varName.end()); + std::string toggleName = "g" + varName + "Enabled"; - ImGui::EndMenu(); + EnhancementCheckbox(name.c_str(), toggleName.c_str()); + customWindows[name].enabled = CVar_GetS32(toggleName.c_str(), 0); } - ImGui::Separator(); + ImGui::EndMenu(); } - for (const std::string& name : category.second) { - std::string varName(name); - varName.erase(std::remove_if(varName.begin(), varName.end(), [](unsigned char x) { return std::isspace(x); }), varName.end()); - std::string toggleName = "g" + varName + "Enabled"; + } + } + + ImGui::SetCursorPosY(0.0f); + + if (ImGui::BeginMenu("Randomizer")) + { + EnhancementCheckbox("Randomizer Settings", "gRandomizerSettingsEnabled"); + customWindows["Randomizer Settings"].enabled = CVar_GetS32("gRandomizerSettingsEnabled", 0); + EnhancementCheckbox("Item Tracker", "gItemTrackerEnabled"); + customWindows["Item Tracker"].enabled = CVar_GetS32("gItemTrackerEnabled", 0); + + ImGui::Separator(); + if (ImGui::BeginMenu("Rando Enhancements")) + { + EnhancementCheckbox("Dynamic Item Fanfares", "gRandoFanfareByItemType"); + Tooltip( + "Change what fanfare is played to match the type\n" + "of item that is obtained. This can make fanfares\n" + "longer than usual in some cases." + ); - EnhancementCheckbox(name.c_str(), toggleName.c_str()); - customWindows[name].enabled = CVar_GetS32(toggleName.c_str(), 0); - } ImGui::EndMenu(); } + + ImGui::EndMenu(); } ImGui::EndMenuBar(); From 5e2b7acabbdd1301dbcb93c0a2fab618953ec47a Mon Sep 17 00:00:00 2001 From: aMannus Date: Sun, 24 Jul 2022 14:19:37 +0200 Subject: [PATCH 3/4] Tiny code cleanup --- libultraship/libultraship/ImGuiImpl.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libultraship/libultraship/ImGuiImpl.cpp b/libultraship/libultraship/ImGuiImpl.cpp index 1eb9bedfc6..47b992b88e 100644 --- a/libultraship/libultraship/ImGuiImpl.cpp +++ b/libultraship/libultraship/ImGuiImpl.cpp @@ -1396,8 +1396,8 @@ namespace SohImGui { } } + // Randomizer Menu ImGui::SetCursorPosY(0.0f); - if (ImGui::BeginMenu("Randomizer")) { EnhancementCheckbox("Randomizer Settings", "gRandomizerSettingsEnabled"); @@ -1414,13 +1414,10 @@ namespace SohImGui { "of item that is obtained. This can make fanfares\n" "longer than usual in some cases." ); - ImGui::EndMenu(); } - ImGui::EndMenu(); } - ImGui::EndMenuBar(); } From 94bff90cb9b2e1d0ff2608b8c49da49dbb5b8d9f Mon Sep 17 00:00:00 2001 From: aMannus Date: Sun, 24 Jul 2022 21:53:38 +0200 Subject: [PATCH 4/4] Changed name/tooltip for fanfares option --- libultraship/libultraship/ImGuiImpl.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libultraship/libultraship/ImGuiImpl.cpp b/libultraship/libultraship/ImGuiImpl.cpp index 47b992b88e..0e5ddd805d 100644 --- a/libultraship/libultraship/ImGuiImpl.cpp +++ b/libultraship/libultraship/ImGuiImpl.cpp @@ -1408,11 +1408,11 @@ namespace SohImGui { ImGui::Separator(); if (ImGui::BeginMenu("Rando Enhancements")) { - EnhancementCheckbox("Dynamic Item Fanfares", "gRandoFanfareByItemType"); + EnhancementCheckbox("Quest Item Fanfares", "gRandoQuestItemFanfares"); Tooltip( - "Change what fanfare is played to match the type\n" - "of item that is obtained. This can make fanfares\n" - "longer than usual in some cases." + "Play unique fanfares when obtaining quest items\n" + "(medallions/stones/songs). Note that these fanfares\n" + "are longer than usual." ); ImGui::EndMenu(); }