mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-04-28 21:27:58 +03:00
Adds a modal registration for pressing F1 and confirming Quit from the menu button. (#5154)
Fixes near shortcuts gossip stone name to include "grotto" to signify it's in the grotto.
This commit is contained in:
parent
4243eb67ae
commit
6ad503e1d2
4 changed files with 22 additions and 6 deletions
|
@ -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_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_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_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_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");
|
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");
|
||||||
|
|
||||||
|
|
|
@ -1293,6 +1293,11 @@ extern "C" void Graph_StartFrame() {
|
||||||
OTRGlobals::Instance->context->GetWindow()->SetLastScancode(-1);
|
OTRGlobals::Instance->context->GetWindow()->SetLastScancode(-1);
|
||||||
|
|
||||||
switch (dwScancode) {
|
switch (dwScancode) {
|
||||||
|
case KbScancode::LUS_KB_F1: {
|
||||||
|
std::shared_ptr<SohModalWindow> modal = static_pointer_cast<SohModalWindow>(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: {
|
case KbScancode::LUS_KB_F5: {
|
||||||
if (CVarGetInteger(CVAR_CHEAT("SaveStatesEnabled"), 0) == 0) {
|
if (CVarGetInteger(CVAR_CHEAT("SaveStatesEnabled"), 0) == 0) {
|
||||||
Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->
|
Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
#include "soh/Enhancements/controls/SohInputEditorWindow.h"
|
#include "soh/Enhancements/controls/SohInputEditorWindow.h"
|
||||||
#include "window/gui/GuiMenuBar.h"
|
#include "window/gui/GuiMenuBar.h"
|
||||||
#include "window/gui/GuiElement.h"
|
#include "window/gui/GuiElement.h"
|
||||||
|
#include "SohModals.h"
|
||||||
#include <variant>
|
#include <variant>
|
||||||
#include <spdlog/fmt/fmt.h>
|
#include <spdlog/fmt/fmt.h>
|
||||||
#include "variables.h"
|
#include "variables.h"
|
||||||
|
@ -19,7 +20,9 @@ std::vector<ImVec2> windowTypeSizes = { {} };
|
||||||
extern std::unordered_map<s16, const char*> warpPointSceneList;
|
extern std::unordered_map<s16, const char*> warpPointSceneList;
|
||||||
extern void Warp();
|
extern void Warp();
|
||||||
|
|
||||||
namespace SohGui {}
|
namespace SohGui {
|
||||||
|
extern std::shared_ptr<SohModalWindow> mModalWindow;
|
||||||
|
}
|
||||||
|
|
||||||
namespace Ship {
|
namespace Ship {
|
||||||
std::string disabledTempTooltip;
|
std::string disabledTempTooltip;
|
||||||
|
@ -104,6 +107,10 @@ void Menu::UpdateWindowBackendObjects() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Menu::IsMenuPopped() {
|
||||||
|
return popped;
|
||||||
|
}
|
||||||
|
|
||||||
UIWidgets::Colors Menu::GetMenuThemeColor() {
|
UIWidgets::Colors Menu::GetMenuThemeColor() {
|
||||||
return menuThemeIndex;
|
return menuThemeIndex;
|
||||||
}
|
}
|
||||||
|
@ -650,10 +657,13 @@ void Menu::DrawElement() {
|
||||||
options3.size = UIWidgets::Sizes::Inline;
|
options3.size = UIWidgets::Sizes::Inline;
|
||||||
options3.tooltip = "Quit SoH";
|
options3.tooltip = "Quit SoH";
|
||||||
if (UIWidgets::Button(ICON_FA_POWER_OFF, options3)) {
|
if (UIWidgets::Button(ICON_FA_POWER_OFF, options3)) {
|
||||||
if (!popped) {
|
SohGui::mModalWindow->RegisterPopup("Quit SoH", "Are you sure you want to quit SoH?", "Quit", "Cancel", []() {
|
||||||
ToggleVisibility();
|
std::shared_ptr<Menu> menu = static_pointer_cast<Menu>(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetMenu());
|
||||||
}
|
if (!menu->IsMenuPopped()) {
|
||||||
Ship::Context::GetInstance()->GetWindow()->Close();
|
menu->ToggleVisibility();
|
||||||
|
}
|
||||||
|
Ship::Context::GetInstance()->GetWindow()->Close();
|
||||||
|
}, nullptr);
|
||||||
}
|
}
|
||||||
ImGui::PopStyleVar();
|
ImGui::PopStyleVar();
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
|
|
|
@ -21,6 +21,7 @@ class Menu : public GuiWindow {
|
||||||
void InsertSidebarSearch();
|
void InsertSidebarSearch();
|
||||||
void RemoveSidebarSearch();
|
void RemoveSidebarSearch();
|
||||||
void UpdateWindowBackendObjects();
|
void UpdateWindowBackendObjects();
|
||||||
|
bool IsMenuPopped();
|
||||||
UIWidgets::Colors GetMenuThemeColor();
|
UIWidgets::Colors GetMenuThemeColor();
|
||||||
|
|
||||||
void MenuDrawItem(WidgetInfo& widget, uint32_t width, UIWidgets::Colors menuThemeIndex);
|
void MenuDrawItem(WidgetInfo& widget, uint32_t width, UIWidgets::Colors menuThemeIndex);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue