diff --git a/soh/soh/Enhancements/randomizer/location_list.cpp b/soh/soh/Enhancements/randomizer/location_list.cpp index d828bad47..116b7d709 100644 --- a/soh/soh/Enhancements/randomizer/location_list.cpp +++ b/soh/soh/Enhancements/randomizer/location_list.cpp @@ -992,7 +992,7 @@ void Rando::StaticData::InitLocationTable() { // locationTable[RC_HF_OPEN_GROTTO_GOSSIP_STONE] = Location::HintStone(RC_HF_OPEN_GROTTO_GOSSIP_STONE, RCQUEST_BOTH, RCAREA_HYRULE_FIELD, SCENE_GROTTOS, -22947, "Open Grotto Gossip Stone"); locationTable[RC_KAK_OPEN_GROTTO_GOSSIP_STONE] = Location::HintStone(RC_KAK_OPEN_GROTTO_GOSSIP_STONE, RCQUEST_BOTH, RCAREA_KAKARIKO_VILLAGE, SCENE_GROTTOS, -22984, "Open Grotto Gossip Stone"); locationTable[RC_ZR_OPEN_GROTTO_GOSSIP_STONE] = Location::HintStone(RC_ZR_OPEN_GROTTO_GOSSIP_STONE, RCQUEST_BOTH, RCAREA_ZORAS_RIVER, SCENE_GROTTOS, -22985, "Open Grotto Gossip Stone"); - locationTable[RC_LW_NEAR_SHORTCUTS_GROTTO_GOSSIP_STONE] = Location::HintStone(RC_LW_NEAR_SHORTCUTS_GROTTO_GOSSIP_STONE, RCQUEST_BOTH, RCAREA_LOST_WOODS, SCENE_GROTTOS, -22964, "Near Shortcuts Gossip Stone"); + locationTable[RC_LW_NEAR_SHORTCUTS_GROTTO_GOSSIP_STONE] = Location::HintStone(RC_LW_NEAR_SHORTCUTS_GROTTO_GOSSIP_STONE, RCQUEST_BOTH, RCAREA_LOST_WOODS, SCENE_GROTTOS, -22964, "Near Shortcuts Grotto Gossip Stone"); locationTable[RC_DMT_STORMS_GROTTO_GOSSIP_STONE] = Location::HintStone(RC_DMT_STORMS_GROTTO_GOSSIP_STONE, RCQUEST_BOTH, RCAREA_DEATH_MOUNTAIN_TRAIL, SCENE_GROTTOS, -23255, "Storms Grotto Gossip Stone"); locationTable[RC_DMC_UPPER_GROTTO_GOSSIP_STONE] = Location::HintStone(RC_DMC_UPPER_GROTTO_GOSSIP_STONE, RCQUEST_BOTH, RCAREA_DEATH_MOUNTAIN_CRATER, SCENE_GROTTOS, -23802, "Upper Grotto Gossip Stone"); diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index ed5a1169d..5d2310e1b 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -1293,6 +1293,11 @@ extern "C" void Graph_StartFrame() { OTRGlobals::Instance->context->GetWindow()->SetLastScancode(-1); switch (dwScancode) { + case KbScancode::LUS_KB_F1: { + std::shared_ptr modal = static_pointer_cast(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Modal Window")); + modal->RegisterPopup("Menu Moved", "The menubar, accessed by hitting F1, no longer exists.\nThe new menu can be accessed by hitting the Esc button instead.", "OK"); + break; + } case KbScancode::LUS_KB_F5: { if (CVarGetInteger(CVAR_CHEAT("SaveStatesEnabled"), 0) == 0) { Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()-> diff --git a/soh/soh/SohGui/Menu.cpp b/soh/soh/SohGui/Menu.cpp index dc7970bc1..0e8f8ab51 100644 --- a/soh/soh/SohGui/Menu.cpp +++ b/soh/soh/SohGui/Menu.cpp @@ -4,6 +4,7 @@ #include "soh/Enhancements/controls/SohInputEditorWindow.h" #include "window/gui/GuiMenuBar.h" #include "window/gui/GuiElement.h" +#include "SohModals.h" #include #include #include "variables.h" @@ -19,7 +20,9 @@ std::vector windowTypeSizes = { {} }; extern std::unordered_map warpPointSceneList; extern void Warp(); -namespace SohGui {} +namespace SohGui { +extern std::shared_ptr mModalWindow; +} namespace Ship { std::string disabledTempTooltip; @@ -104,6 +107,10 @@ void Menu::UpdateWindowBackendObjects() { } } +bool Menu::IsMenuPopped() { + return popped; +} + UIWidgets::Colors Menu::GetMenuThemeColor() { return menuThemeIndex; } @@ -650,10 +657,13 @@ void Menu::DrawElement() { options3.size = UIWidgets::Sizes::Inline; options3.tooltip = "Quit SoH"; if (UIWidgets::Button(ICON_FA_POWER_OFF, options3)) { - if (!popped) { - ToggleVisibility(); - } - Ship::Context::GetInstance()->GetWindow()->Close(); + SohGui::mModalWindow->RegisterPopup("Quit SoH", "Are you sure you want to quit SoH?", "Quit", "Cancel", []() { + std::shared_ptr menu = static_pointer_cast(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetMenu()); + if (!menu->IsMenuPopped()) { + menu->ToggleVisibility(); + } + Ship::Context::GetInstance()->GetWindow()->Close(); + }, nullptr); } ImGui::PopStyleVar(); ImGui::SameLine(); diff --git a/soh/soh/SohGui/Menu.h b/soh/soh/SohGui/Menu.h index d7007bb1e..139f90030 100644 --- a/soh/soh/SohGui/Menu.h +++ b/soh/soh/SohGui/Menu.h @@ -21,6 +21,7 @@ class Menu : public GuiWindow { void InsertSidebarSearch(); void RemoveSidebarSearch(); void UpdateWindowBackendObjects(); + bool IsMenuPopped(); UIWidgets::Colors GetMenuThemeColor(); void MenuDrawItem(WidgetInfo& widget, uint32_t width, UIWidgets::Colors menuThemeIndex);