From 1f65bde5838524b921e1bb339cbca3892c31ae55 Mon Sep 17 00:00:00 2001 From: Malkierian Date: Tue, 28 Jan 2025 18:45:21 -0700 Subject: [PATCH 1/2] Move most ImGui-related files/code to an SohGui subfolder. (#4968) --- .../Enhancements/TimeDisplay/TimeDisplay.cpp | 2 +- soh/soh/Enhancements/audio/AudioEditor.cpp | 2 +- soh/soh/Enhancements/controls/InputViewer.cpp | 2 +- .../controls/SohInputEditorWindow.cpp | 2 +- .../cosmetics/CosmeticsEditor.cpp | 2 +- .../Enhancements/debugger/MessageViewer.cpp | 2 +- soh/soh/Enhancements/debugger/actorViewer.cpp | 2 +- soh/soh/Enhancements/debugger/colViewer.cpp | 2 +- .../Enhancements/debugger/debugSaveEditor.cpp | 8 +-- soh/soh/Enhancements/debugger/dlViewer.cpp | 6 +-- .../Enhancements/debugger/hookDebugger.cpp | 4 +- soh/soh/Enhancements/debugger/valueViewer.cpp | 2 +- soh/soh/Enhancements/gameplaystats.cpp | 2 +- soh/soh/Enhancements/presets.cpp | 2 +- .../Enhancements/randomizer/Plandomizer.cpp | 4 +- .../Enhancements/randomizer/hook_handlers.cpp | 2 +- soh/soh/Enhancements/randomizer/option.cpp | 2 +- soh/soh/Enhancements/randomizer/option.h | 2 +- .../Enhancements/randomizer/randomizer.cpp | 4 +- .../randomizer/randomizer_check_tracker.cpp | 2 +- .../randomizer_entrance_tracker.cpp | 2 +- .../randomizer/randomizer_item_tracker.cpp | 2 +- .../resolution-editor/ResolutionEditor.cpp | 2 +- .../Enhancements/timesplits/TimeSplits.cpp | 2 +- soh/soh/OTRGlobals.cpp | 4 +- soh/soh/SaveManager.cpp | 2 +- soh/soh/SohGui.hpp | 50 ------------------ soh/soh/{ => SohGui}/ImGuiUtils.cpp | 0 soh/soh/{ => SohGui}/ImGuiUtils.h | 2 +- soh/soh/{ => SohGui}/SohGui.cpp | 10 ++-- soh/soh/SohGui/SohGui.hpp | 50 ++++++++++++++++++ soh/soh/{ => SohGui}/SohMenuBar.cpp | 52 +++++++++---------- soh/soh/{ => SohGui}/SohMenuBar.h | 0 soh/soh/{ => SohGui}/SohModals.cpp | 2 +- soh/soh/{ => SohGui}/SohModals.h | 0 soh/soh/{ => SohGui}/UIWidgets.cpp | 0 soh/soh/{ => SohGui}/UIWidgets.hpp | 0 37 files changed, 118 insertions(+), 118 deletions(-) delete mode 100644 soh/soh/SohGui.hpp rename soh/soh/{ => SohGui}/ImGuiUtils.cpp (100%) rename soh/soh/{ => SohGui}/ImGuiUtils.h (97%) rename soh/soh/{ => SohGui}/SohGui.cpp (97%) create mode 100644 soh/soh/SohGui/SohGui.hpp rename soh/soh/{ => SohGui}/SohMenuBar.cpp (99%) rename soh/soh/{ => SohGui}/SohMenuBar.h (100%) rename soh/soh/{ => SohGui}/SohModals.cpp (98%) rename soh/soh/{ => SohGui}/SohModals.h (100%) rename soh/soh/{ => SohGui}/UIWidgets.cpp (100%) rename soh/soh/{ => SohGui}/UIWidgets.hpp (100%) diff --git a/soh/soh/Enhancements/TimeDisplay/TimeDisplay.cpp b/soh/soh/Enhancements/TimeDisplay/TimeDisplay.cpp index 09f037570..05e03dae1 100644 --- a/soh/soh/Enhancements/TimeDisplay/TimeDisplay.cpp +++ b/soh/soh/Enhancements/TimeDisplay/TimeDisplay.cpp @@ -4,7 +4,7 @@ #include "assets/textures/parameter_static/parameter_static.h" #include "assets/soh_assets.h" -#include "soh/ImGuiUtils.h" +#include "soh/SohGui/ImGuiUtils.h" extern "C" { #include "macros.h" diff --git a/soh/soh/Enhancements/audio/AudioEditor.cpp b/soh/soh/Enhancements/audio/AudioEditor.cpp index d56c8269c..d15bc5f25 100644 --- a/soh/soh/Enhancements/audio/AudioEditor.cpp +++ b/soh/soh/Enhancements/audio/AudioEditor.cpp @@ -11,7 +11,7 @@ #include "soh/OTRGlobals.h" #include "soh/cvar_prefixes.h" #include -#include "soh/UIWidgets.hpp" +#include "soh/SohGui/UIWidgets.hpp" #include "AudioCollection.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" diff --git a/soh/soh/Enhancements/controls/InputViewer.cpp b/soh/soh/Enhancements/controls/InputViewer.cpp index 7d6b37179..5f650a25f 100644 --- a/soh/soh/Enhancements/controls/InputViewer.cpp +++ b/soh/soh/Enhancements/controls/InputViewer.cpp @@ -9,7 +9,7 @@ #include #include -#include "../../UIWidgets.hpp" +#include "soh/SohGui/UIWidgets.hpp" // Text colors static ImVec4 textColor = ImVec4(1.0f, 1.0f, 1.0f, 1.0f); diff --git a/soh/soh/Enhancements/controls/SohInputEditorWindow.cpp b/soh/soh/Enhancements/controls/SohInputEditorWindow.cpp index 7967c3d15..7e4918799 100644 --- a/soh/soh/Enhancements/controls/SohInputEditorWindow.cpp +++ b/soh/soh/Enhancements/controls/SohInputEditorWindow.cpp @@ -1,7 +1,7 @@ #include "SohInputEditorWindow.h" #include #include "soh/OTRGlobals.h" -#include "../../UIWidgets.hpp" +#include "soh/SohGui/UIWidgets.hpp" #include "z64.h" #include "soh/cvar_prefixes.h" #ifndef __WIIU__ diff --git a/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp b/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp index 45e097df7..0bdd3d10d 100644 --- a/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp +++ b/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp @@ -10,7 +10,7 @@ #include #include -#include "soh/UIWidgets.hpp" +#include "soh/SohGui/UIWidgets.hpp" #include "soh/OTRGlobals.h" #include "soh/ResourceManagerHelpers.h" diff --git a/soh/soh/Enhancements/debugger/MessageViewer.cpp b/soh/soh/Enhancements/debugger/MessageViewer.cpp index 3c10772f3..589dbaf4a 100644 --- a/soh/soh/Enhancements/debugger/MessageViewer.cpp +++ b/soh/soh/Enhancements/debugger/MessageViewer.cpp @@ -1,6 +1,6 @@ #include "MessageViewer.h" -#include +#include #include #include "../custom-message/CustomMessageManager.h" diff --git a/soh/soh/Enhancements/debugger/actorViewer.cpp b/soh/soh/Enhancements/debugger/actorViewer.cpp index c6ac49a74..8aac60954 100644 --- a/soh/soh/Enhancements/debugger/actorViewer.cpp +++ b/soh/soh/Enhancements/debugger/actorViewer.cpp @@ -1,6 +1,6 @@ #include "actorViewer.h" #include "../../util.h" -#include "../../UIWidgets.hpp" +#include "soh/SohGui/UIWidgets.hpp" #include "soh/ActorDB.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/nametag.h" diff --git a/soh/soh/Enhancements/debugger/colViewer.cpp b/soh/soh/Enhancements/debugger/colViewer.cpp index 2cba03f5b..493ffdfdc 100644 --- a/soh/soh/Enhancements/debugger/colViewer.cpp +++ b/soh/soh/Enhancements/debugger/colViewer.cpp @@ -1,6 +1,6 @@ #include "colViewer.h" #include "../../frame_interpolation.h" -#include "../../UIWidgets.hpp" +#include "soh/SohGui/UIWidgets.hpp" #include #include diff --git a/soh/soh/Enhancements/debugger/debugSaveEditor.cpp b/soh/soh/Enhancements/debugger/debugSaveEditor.cpp index 5fedd54be..962f50bd6 100644 --- a/soh/soh/Enhancements/debugger/debugSaveEditor.cpp +++ b/soh/soh/Enhancements/debugger/debugSaveEditor.cpp @@ -1,8 +1,8 @@ #include "debugSaveEditor.h" -#include "../../util.h" -#include "../../ImGuiUtils.h" -#include "../../OTRGlobals.h" -#include "../../UIWidgets.hpp" +#include "soh/util.h" +#include "soh/SohGui/ImGuiUtils.h" +#include "soh/OTRGlobals.h" +#include "soh/SohGui/UIWidgets.hpp" #include #include diff --git a/soh/soh/Enhancements/debugger/dlViewer.cpp b/soh/soh/Enhancements/debugger/dlViewer.cpp index fdfc8be1c..4f4d13bff 100644 --- a/soh/soh/Enhancements/debugger/dlViewer.cpp +++ b/soh/soh/Enhancements/debugger/dlViewer.cpp @@ -1,9 +1,9 @@ #include "actorViewer.h" -#include "../../util.h" -#include "../../UIWidgets.hpp" +#include "soh/util.h" +#include "soh/SohGui/UIWidgets.hpp" #include "ResourceManager.h" #include "DisplayList.h" -#include "../../OTRGlobals.h" +#include "soh/OTRGlobals.h" #include #include diff --git a/soh/soh/Enhancements/debugger/hookDebugger.cpp b/soh/soh/Enhancements/debugger/hookDebugger.cpp index 8ee9b3391..782cf4f7a 100644 --- a/soh/soh/Enhancements/debugger/hookDebugger.cpp +++ b/soh/soh/Enhancements/debugger/hookDebugger.cpp @@ -1,6 +1,6 @@ #include "hookDebugger.h" -#include "../game-interactor/GameInteractor.h" -#include "../../UIWidgets.hpp" +#include "soh/Enhancements/game-interactor/GameInteractor.h" +#include "soh/SohGui/UIWidgets.hpp" #include #include diff --git a/soh/soh/Enhancements/debugger/valueViewer.cpp b/soh/soh/Enhancements/debugger/valueViewer.cpp index a58512ea3..088e69713 100644 --- a/soh/soh/Enhancements/debugger/valueViewer.cpp +++ b/soh/soh/Enhancements/debugger/valueViewer.cpp @@ -1,5 +1,5 @@ #include "valueViewer.h" -#include "../../UIWidgets.hpp" +#include "soh/SohGui/UIWidgets.hpp" #include "soh/OTRGlobals.h" extern "C" { diff --git a/soh/soh/Enhancements/gameplaystats.cpp b/soh/soh/Enhancements/gameplaystats.cpp index ddff16c7d..aff0d0726 100644 --- a/soh/soh/Enhancements/gameplaystats.cpp +++ b/soh/soh/Enhancements/gameplaystats.cpp @@ -5,7 +5,7 @@ #include "functions.h" #include "macros.h" #include "soh/cvar_prefixes.h" -#include "../UIWidgets.hpp" +#include "soh/SohGui/UIWidgets.hpp" #include "soh/util.h" #include diff --git a/soh/soh/Enhancements/presets.cpp b/soh/soh/Enhancements/presets.cpp index b72143247..4ba4b62be 100644 --- a/soh/soh/Enhancements/presets.cpp +++ b/soh/soh/Enhancements/presets.cpp @@ -3,7 +3,7 @@ #include #include #include -#include "soh/UIWidgets.hpp" +#include "soh/SohGui/UIWidgets.hpp" #include void clearCvars(std::vector cvarsToClear) { diff --git a/soh/soh/Enhancements/randomizer/Plandomizer.cpp b/soh/soh/Enhancements/randomizer/Plandomizer.cpp index 2a086d377..e6c9399b5 100644 --- a/soh/soh/Enhancements/randomizer/Plandomizer.cpp +++ b/soh/soh/Enhancements/randomizer/Plandomizer.cpp @@ -1,5 +1,5 @@ #include "Plandomizer.h" -#include "soh/UIWidgets.hpp" +#include "soh/SohGui/UIWidgets.hpp" #include "soh/util.h" #include #include "soh/Notification/Notification.h" @@ -10,7 +10,7 @@ #include #include "soh/OTRGlobals.h" -#include "soh/ImGuiUtils.h" +#include "soh/SohGui/ImGuiUtils.h" #include "soh/Enhancements/randomizer/logic.h" #include "soh/Enhancements/randomizer/randomizer_check_objects.h" #include "soh/Enhancements/randomizer/rando_hash.h" diff --git a/soh/soh/Enhancements/randomizer/hook_handlers.cpp b/soh/soh/Enhancements/randomizer/hook_handlers.cpp index cc9708789..e323e810a 100644 --- a/soh/soh/Enhancements/randomizer/hook_handlers.cpp +++ b/soh/soh/Enhancements/randomizer/hook_handlers.cpp @@ -12,7 +12,7 @@ #include "soh/Enhancements/randomizer/ShuffleFreestanding.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" -#include "soh/ImGuiUtils.h" +#include "soh/SohGui/ImGuiUtils.h" #include "soh/Notification/Notification.h" #include "soh/SaveManager.h" #include "soh/Enhancements/randomizer/ShuffleFairies.h" diff --git a/soh/soh/Enhancements/randomizer/option.cpp b/soh/soh/Enhancements/randomizer/option.cpp index 84743cae6..5cf16ac26 100644 --- a/soh/soh/Enhancements/randomizer/option.cpp +++ b/soh/soh/Enhancements/randomizer/option.cpp @@ -2,7 +2,7 @@ #include "libultraship/bridge.h" #include #include -#include "soh/UIWidgets.hpp" +#include "soh/SohGui/UIWidgets.hpp" namespace Rando { Option Option::Bool(RandomizerSettingKey key_, std::string name_, std::vector options_, diff --git a/soh/soh/Enhancements/randomizer/option.h b/soh/soh/Enhancements/randomizer/option.h index a8ffe3511..1ff68c852 100644 --- a/soh/soh/Enhancements/randomizer/option.h +++ b/soh/soh/Enhancements/randomizer/option.h @@ -1,6 +1,6 @@ #pragma once -#include "soh/UIWidgets.hpp" +#include "soh/SohGui/UIWidgets.hpp" #include #include diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index 477c2f0da..d1ca49162 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -11,9 +11,9 @@ #include "3drando/rando_main.hpp" #include "3drando/random.hpp" #include "soh/ResourceManagerHelpers.h" -#include "soh/UIWidgets.hpp" +#include "soh/SohGui/UIWidgets.hpp" #include "3drando/custom_messages.hpp" -#include "../../UIWidgets.hpp" +#include "soh/SohGui/UIWidgets.hpp" #include #include #include "../custom-message/CustomMessageTypes.h" diff --git a/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp index b6ef5752c..51abc0db1 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp @@ -6,7 +6,7 @@ #include "soh/cvar_prefixes.h" #include "soh/SaveManager.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/UIWidgets.hpp" +#include "soh/SohGui/UIWidgets.hpp" #include "dungeon.h" #include "location_access.h" diff --git a/soh/soh/Enhancements/randomizer/randomizer_entrance_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_entrance_tracker.cpp index 0d7b1a731..78de199d7 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_entrance_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_entrance_tracker.cpp @@ -1,7 +1,7 @@ #include "randomizer_entrance_tracker.h" #include "soh/OTRGlobals.h" #include "soh/cvar_prefixes.h" -#include "soh/UIWidgets.hpp" +#include "soh/SohGui/UIWidgets.hpp" #include #include diff --git a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp index 0b96c4ab2..eb0b1aafd 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp @@ -4,7 +4,7 @@ #include "soh/cvar_prefixes.h" #include "soh/SaveManager.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/UIWidgets.hpp" +#include "soh/SohGui/UIWidgets.hpp" #include "randomizerTypes.h" #include diff --git a/soh/soh/Enhancements/resolution-editor/ResolutionEditor.cpp b/soh/soh/Enhancements/resolution-editor/ResolutionEditor.cpp index c15f04364..a18aea8dc 100644 --- a/soh/soh/Enhancements/resolution-editor/ResolutionEditor.cpp +++ b/soh/soh/Enhancements/resolution-editor/ResolutionEditor.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include "soh/SohGui/UIWidgets.hpp" #include #include "soh/OTRGlobals.h" #include "soh/cvar_prefixes.h" diff --git a/soh/soh/Enhancements/timesplits/TimeSplits.cpp b/soh/soh/Enhancements/timesplits/TimeSplits.cpp index b17f95b82..de9e157c3 100644 --- a/soh/soh/Enhancements/timesplits/TimeSplits.cpp +++ b/soh/soh/Enhancements/timesplits/TimeSplits.cpp @@ -1,5 +1,5 @@ #include "TimeSplits.h" -#include "soh/UIWidgets.hpp" +#include "soh/SohGui/UIWidgets.hpp" #include "soh/Enhancements/gameplaystats.h" #include "soh/SaveManager.h" #include "soh/util.h" diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index 9bc33593d..c19b186db 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -42,7 +42,6 @@ #include "Fonts.h" #include #include "Enhancements/custom-message/CustomMessageManager.h" -#include "ImGuiUtils.h" #include "Enhancements/presets.h" #include "util.h" #include @@ -70,7 +69,8 @@ #include "Enhancements/custom-message/CustomMessageTypes.h" #include #include "Enhancements/item-tables/ItemTableManager.h" -#include "SohGui.hpp" +#include "soh/SohGui/SohGui.hpp" +#include "soh/SohGui/ImGuiUtils.h" #include "ActorDB.h" #include "SaveManager.h" diff --git a/soh/soh/SaveManager.cpp b/soh/soh/SaveManager.cpp index 188006181..f91696191 100644 --- a/soh/soh/SaveManager.cpp +++ b/soh/soh/SaveManager.cpp @@ -15,7 +15,7 @@ #include "macros.h" #include #include -#include "SohGui.hpp" +#include "soh/SohGui/SohGui.hpp" #define NOGDI // avoid various windows defines that conflict with things in z64.h #include diff --git a/soh/soh/SohGui.hpp b/soh/soh/SohGui.hpp deleted file mode 100644 index 526db64bf..000000000 --- a/soh/soh/SohGui.hpp +++ /dev/null @@ -1,50 +0,0 @@ -// -// SohGui.hpp -// soh -// -// Created by David Chavez on 24.08.22. -// - -#ifndef SohGui_hpp -#define SohGui_hpp - -#include -#include "SohMenuBar.h" -#include "Enhancements/audio/AudioEditor.h" -#include "Enhancements/controls/InputViewer.h" -#include "Enhancements/cosmetics/CosmeticsEditor.h" -#include "Enhancements/debugger/actorViewer.h" -#include "Enhancements/debugger/colViewer.h" -#include "Enhancements/debugger/debugSaveEditor.h" -#include "Enhancements/debugger/hookDebugger.h" -#include "Enhancements/debugger/dlViewer.h" -#include "Enhancements/debugger/valueViewer.h" -#include "Enhancements/gameplaystatswindow.h" -#include "Enhancements/randomizer/randomizer_check_tracker.h" -#include "Enhancements/randomizer/randomizer_entrance_tracker.h" -#include "Enhancements/randomizer/randomizer_item_tracker.h" -#include "Enhancements/randomizer/randomizer_settings_window.h" -#include "Enhancements/timesplits/TimeSplits.h" -#include "Enhancements/randomizer/Plandomizer.h" -#include "AboutWindow.h" -#include "SohModals.h" - -#ifdef __cplusplus -extern "C" { -#endif - void enableBetaQuest(); - void disableBetaQuest(); -#ifdef __cplusplus -} -#endif - -namespace SohGui { - void SetupHooks(); - void SetupGuiElements(); - void Draw(); - void Destroy(); - void RegisterPopup(std::string title, std::string message, std::string button1 = "OK", std::string button2 = "", std::function button1callback = nullptr, std::function button2callback = nullptr); - void ShowRandomizerSettingsMenu(); -} - -#endif /* SohGui_hpp */ diff --git a/soh/soh/ImGuiUtils.cpp b/soh/soh/SohGui/ImGuiUtils.cpp similarity index 100% rename from soh/soh/ImGuiUtils.cpp rename to soh/soh/SohGui/ImGuiUtils.cpp diff --git a/soh/soh/ImGuiUtils.h b/soh/soh/SohGui/ImGuiUtils.h similarity index 97% rename from soh/soh/ImGuiUtils.h rename to soh/soh/SohGui/ImGuiUtils.h index 763bae49b..fde8ec6a4 100644 --- a/soh/soh/ImGuiUtils.h +++ b/soh/soh/SohGui/ImGuiUtils.h @@ -7,7 +7,7 @@ #include #include #include -#include "Enhancements/randomizer/randomizerTypes.h" +#include "soh/Enhancements/randomizer/randomizerTypes.h" #include "variables.h" //only for gItemIcons extern "C" { diff --git a/soh/soh/SohGui.cpp b/soh/soh/SohGui/SohGui.cpp similarity index 97% rename from soh/soh/SohGui.cpp rename to soh/soh/SohGui/SohGui.cpp index f91f263c9..84a44b052 100644 --- a/soh/soh/SohGui.cpp +++ b/soh/soh/SohGui/SohGui.cpp @@ -25,15 +25,15 @@ #include "include/global.h" #include "include/z64audio.h" #include "soh/SaveManager.h" -#include "OTRGlobals.h" +#include "soh/OTRGlobals.h" #include "soh/Enhancements/presets.h" #include "soh/resource/type/Skeleton.h" #include "libultraship/libultraship.h" -#include "Enhancements/game-interactor/GameInteractor.h" -#include "Enhancements/cosmetics/authenticGfxPatches.h" -#include "Enhancements/resolution-editor/ResolutionEditor.h" -#include "Enhancements/debugger/MessageViewer.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" +#include "soh/Enhancements/cosmetics/authenticGfxPatches.h" +#include "soh/Enhancements/resolution-editor/ResolutionEditor.h" +#include "soh/Enhancements/debugger/MessageViewer.h" #include "soh/Notification/Notification.h" #include "soh/Enhancements/TimeDisplay/TimeDisplay.h" diff --git a/soh/soh/SohGui/SohGui.hpp b/soh/soh/SohGui/SohGui.hpp new file mode 100644 index 000000000..4544c13e9 --- /dev/null +++ b/soh/soh/SohGui/SohGui.hpp @@ -0,0 +1,50 @@ +// +// SohGui.hpp +// soh +// +// Created by David Chavez on 24.08.22. +// + +#ifndef SohGui_hpp +#define SohGui_hpp + +#include +#include "SohMenuBar.h" +#include "soh/Enhancements/audio/AudioEditor.h" +#include "soh/Enhancements/controls/InputViewer.h" +#include "soh/Enhancements/cosmetics/CosmeticsEditor.h" +#include "soh/Enhancements/debugger/actorViewer.h" +#include "soh/Enhancements/debugger/colViewer.h" +#include "soh/Enhancements/debugger/debugSaveEditor.h" +#include "soh/Enhancements/debugger/hookDebugger.h" +#include "soh/Enhancements/debugger/dlViewer.h" +#include "soh/Enhancements/debugger/valueViewer.h" +#include "soh/Enhancements/gameplaystatswindow.h" +#include "soh/Enhancements/randomizer/randomizer_check_tracker.h" +#include "soh/Enhancements/randomizer/randomizer_entrance_tracker.h" +#include "soh/Enhancements/randomizer/randomizer_item_tracker.h" +#include "soh/Enhancements/randomizer/randomizer_settings_window.h" +#include "soh/Enhancements/timesplits/TimeSplits.h" +#include "soh/Enhancements/randomizer/Plandomizer.h" +#include "soh/AboutWindow.h" +#include "SohModals.h" + +#ifdef __cplusplus +extern "C" { +#endif + void enableBetaQuest(); + void disableBetaQuest(); +#ifdef __cplusplus +} +#endif + +namespace SohGui { + void SetupHooks(); + void SetupGuiElements(); + void Draw(); + void Destroy(); + void RegisterPopup(std::string title, std::string message, std::string button1 = "OK", std::string button2 = "", std::function button1callback = nullptr, std::function button2callback = nullptr); + void ShowRandomizerSettingsMenu(); +} + +#endif /* SohGui_hpp */ diff --git a/soh/soh/SohMenuBar.cpp b/soh/soh/SohGui/SohMenuBar.cpp similarity index 99% rename from soh/soh/SohMenuBar.cpp rename to soh/soh/SohGui/SohMenuBar.cpp index 250106530..e5e52c71d 100644 --- a/soh/soh/SohMenuBar.cpp +++ b/soh/soh/SohGui/SohMenuBar.cpp @@ -6,45 +6,45 @@ #include "UIWidgets.hpp" #include "include/z64audio.h" #include "graphic/Fast3D/gfx_rendering_api.h" -#include "OTRGlobals.h" -#include "SaveManager.h" +#include "soh/OTRGlobals.h" +#include "soh/SaveManager.h" #include "z64.h" -#include "cvar_prefixes.h" +#include "soh/cvar_prefixes.h" #include "macros.h" #include "functions.h" #include "variables.h" -#include "Enhancements/game-interactor/GameInteractor.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/presets.h" #include "soh/Enhancements/mods.h" #include "soh/Notification/Notification.h" -#include "Enhancements/cosmetics/authenticGfxPatches.h" +#include "soh/Enhancements/cosmetics/authenticGfxPatches.h" #ifdef ENABLE_REMOTE_CONTROL #include "soh/Network/CrowdControl/CrowdControl.h" #include "soh/Network/Sail/Sail.h" #endif -#include "Enhancements/audio/AudioEditor.h" -#include "Enhancements/controls/InputViewer.h" -#include "Enhancements/cosmetics/CosmeticsEditor.h" -#include "Enhancements/debugger/actorViewer.h" -#include "Enhancements/debugger/colViewer.h" -#include "Enhancements/debugger/debugSaveEditor.h" -#include "Enhancements/debugger/hookDebugger.h" -#include "Enhancements/debugger/dlViewer.h" -#include "Enhancements/debugger/valueViewer.h" -#include "Enhancements/gameplaystatswindow.h" -#include "Enhancements/debugger/MessageViewer.h" -#include "Enhancements/randomizer/randomizer_check_tracker.h" -#include "Enhancements/randomizer/randomizer_entrance_tracker.h" -#include "Enhancements/randomizer/randomizer_item_tracker.h" -#include "Enhancements/randomizer/randomizer_settings_window.h" -#include "Enhancements/resolution-editor/ResolutionEditor.h" -#include "Enhancements/enemyrandomizer.h" -#include "Enhancements/timesplits/TimeSplits.h" -#include "Enhancements/randomizer/Plandomizer.h" -#include "Enhancements/TimeDisplay/TimeDisplay.h" -#include "AboutWindow.h" +#include "soh/Enhancements/audio/AudioEditor.h" +#include "soh/Enhancements/controls/InputViewer.h" +#include "soh/Enhancements/cosmetics/CosmeticsEditor.h" +#include "soh/Enhancements/debugger/actorViewer.h" +#include "soh/Enhancements/debugger/colViewer.h" +#include "soh/Enhancements/debugger/debugSaveEditor.h" +#include "soh/Enhancements/debugger/hookDebugger.h" +#include "soh/Enhancements/debugger/dlViewer.h" +#include "soh/Enhancements/debugger/valueViewer.h" +#include "soh/Enhancements/gameplaystatswindow.h" +#include "soh/Enhancements/debugger/MessageViewer.h" +#include "soh/Enhancements/randomizer/randomizer_check_tracker.h" +#include "soh/Enhancements/randomizer/randomizer_entrance_tracker.h" +#include "soh/Enhancements/randomizer/randomizer_item_tracker.h" +#include "soh/Enhancements/randomizer/randomizer_settings_window.h" +#include "soh/Enhancements/resolution-editor/ResolutionEditor.h" +#include "soh/Enhancements/enemyrandomizer.h" +#include "soh/Enhancements/timesplits/TimeSplits.h" +#include "soh/Enhancements/randomizer/Plandomizer.h" +#include "soh/Enhancements/TimeDisplay/TimeDisplay.h" +#include "soh/AboutWindow.h" // FA icons are kind of wonky, if they worked how I expected them to the "+ 2.0f" wouldn't be needed, but // they don't work how I expect them to so I added that because it looked good when I eyeballed it diff --git a/soh/soh/SohMenuBar.h b/soh/soh/SohGui/SohMenuBar.h similarity index 100% rename from soh/soh/SohMenuBar.h rename to soh/soh/SohGui/SohMenuBar.h diff --git a/soh/soh/SohModals.cpp b/soh/soh/SohGui/SohModals.cpp similarity index 98% rename from soh/soh/SohModals.cpp rename to soh/soh/SohGui/SohModals.cpp index 576df50f7..642fedf15 100644 --- a/soh/soh/SohModals.cpp +++ b/soh/soh/SohGui/SohModals.cpp @@ -5,7 +5,7 @@ #include #include #include "UIWidgets.hpp" -#include "OTRGlobals.h" +#include "soh/OTRGlobals.h" #include "z64.h" extern "C" PlayState* gPlayState; diff --git a/soh/soh/SohModals.h b/soh/soh/SohGui/SohModals.h similarity index 100% rename from soh/soh/SohModals.h rename to soh/soh/SohGui/SohModals.h diff --git a/soh/soh/UIWidgets.cpp b/soh/soh/SohGui/UIWidgets.cpp similarity index 100% rename from soh/soh/UIWidgets.cpp rename to soh/soh/SohGui/UIWidgets.cpp diff --git a/soh/soh/UIWidgets.hpp b/soh/soh/SohGui/UIWidgets.hpp similarity index 100% rename from soh/soh/UIWidgets.hpp rename to soh/soh/SohGui/UIWidgets.hpp From 7df9641297e8ac5965ed9bfd62dc98fae38d6a09 Mon Sep 17 00:00:00 2001 From: Christopher Leggett Date: Wed, 29 Jan 2025 10:12:42 -0500 Subject: [PATCH 2/2] Exclude locations fix (#4969) * Properly check for Excluded Location option. * Remove GetOption overloads, weren't working anyway --- soh/soh/Enhancements/randomizer/3drando/spoiler_log.cpp | 2 +- soh/soh/Enhancements/randomizer/context.cpp | 8 -------- soh/soh/Enhancements/randomizer/context.h | 2 -- 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/3drando/spoiler_log.cpp b/soh/soh/Enhancements/randomizer/3drando/spoiler_log.cpp index a21dacaaf..d78f1ef90 100644 --- a/soh/soh/Enhancements/randomizer/3drando/spoiler_log.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/spoiler_log.cpp @@ -159,7 +159,7 @@ static void WriteExcludedLocations() { for (size_t i = 1; i < Rando::Settings::GetInstance()->GetExcludeLocationsOptions().size(); i++) { for (const auto& location : Rando::Settings::GetInstance()->GetExcludeLocationsOptions()[i]) { - if (ctx->GetOption(location->GetKey()).Get() == RO_LOCATION_INCLUDE) { + if (ctx->GetLocationOption(static_cast(location->GetKey())).Get() == RO_LOCATION_INCLUDE) { continue; } diff --git a/soh/soh/Enhancements/randomizer/context.cpp b/soh/soh/Enhancements/randomizer/context.cpp index 3e846c4b7..79a60cc70 100644 --- a/soh/soh/Enhancements/randomizer/context.cpp +++ b/soh/soh/Enhancements/randomizer/context.cpp @@ -438,14 +438,6 @@ OptionValue& Context::GetOption(const RandomizerSettingKey key) { return mOptions[key]; } -OptionValue& Context::GetOption(const RandomizerTrick key) { - return mTrickOptions[key]; -} - -OptionValue& Context::GetOption(const RandomizerCheck key) { - return itemLocationTable[key].GetExcludedOption(); -} - OptionValue& Context::GetTrickOption(const RandomizerTrick key) { return mTrickOptions[key]; } diff --git a/soh/soh/Enhancements/randomizer/context.h b/soh/soh/Enhancements/randomizer/context.h index 0fbb18748..cc71609eb 100644 --- a/soh/soh/Enhancements/randomizer/context.h +++ b/soh/soh/Enhancements/randomizer/context.h @@ -91,8 +91,6 @@ class Context { TrialInfo* GetTrial(TrialKey key) const; static Sprite* GetSeedTexture(uint8_t index); OptionValue& GetOption(RandomizerSettingKey key); - OptionValue& GetOption(RandomizerTrick key); - OptionValue& GetOption(RandomizerCheck key); OptionValue& GetTrickOption(RandomizerTrick key); OptionValue& GetLocationOption(RandomizerCheck key);