diff --git a/.github/workflows/generate-builds.yml b/.github/workflows/generate-builds.yml index 29cd94c8a..85eeaf4d9 100644 --- a/.github/workflows/generate-builds.yml +++ b/.github/workflows/generate-builds.yml @@ -244,7 +244,6 @@ jobs: - name: Cache build folder uses: actions/cache@v4 with: - save-always: true key: ${{ runner.os }}-build-${{ github.ref }}-${{ github.sha }} restore-keys: | ${{ runner.os }}-build-${{ github.ref }} diff --git a/.github/workflows/pr-artifacts.yml b/.github/workflows/pr-artifacts.yml index 43b985b5d..85db7de59 100644 --- a/.github/workflows/pr-artifacts.yml +++ b/.github/workflows/pr-artifacts.yml @@ -12,7 +12,7 @@ jobs: if: ${{ github.event.workflow_run.event == 'pull_request' }} steps: - id: 'pr-number' - uses: actions/github-script@v6 + uses: actions/github-script@v7 with: result-encoding: string script: | @@ -20,8 +20,9 @@ jobs: const pullHeadSHA = '${{github.event.workflow_run.head_sha}}'; const pullUserId = ${{github.event.sender.id}}; const prNumber = await (async () => { - const pulls = await github.rest.pulls.list({owner, repo}); - for await (const {data} of github.paginate.iterator(pulls)) { + for await (const { data } of github.paginate.iterator( + github.rest.pulls.list, { owner, repo } + )) { for (const pull of data) { if (pull.head.sha === pullHeadSHA && pull.user.id === pullUserId) { return pull.number; @@ -36,7 +37,7 @@ jobs: return prNumber; - id: 'artifacts-text' - uses: actions/github-script@v6 + uses: actions/github-script@v7 with: result-encoding: string script: | @@ -47,13 +48,13 @@ jobs: }); return allArtifacts.data.artifacts.reduce((acc, item) => { - if (item.name === "assets") return acc; + if (item.name === "soh.otr") return acc; acc += ` - [${item.name}.zip](https://nightly.link/${context.repo.owner}/${context.repo.repo}/actions/artifacts/${item.id}.zip)`; return acc; }, '### Build Artifacts'); - id: 'add-to-pr' - uses: garrettjoecox/pr-section@3.1.0 + uses: garrettjoecox/pr-section@4.0.0 with: repo-token: '${{ secrets.GITHUB_TOKEN }}' pr-number: ${{ steps.pr-number.outputs.result }} diff --git a/soh/assets/objects/object_link_child/object_link_child.h b/soh/assets/objects/object_link_child/object_link_child.h index 8f49d115c..a6515cc56 100644 --- a/soh/assets/objects/object_link_child/object_link_child.h +++ b/soh/assets/objects/object_link_child/object_link_child.h @@ -220,7 +220,7 @@ static const ALIGN_ASSET(2) char gLinkChildDL_18580[] = dgLinkChildDL_18580; static const ALIGN_ASSET(2) char gLinkChildBottle2DL[] = dgLinkChildBottle2DL; #define dgLinkChildSlinghotStringDL "__OTR__objects/object_link_child/gLinkChildSlinghotStringDL" -static const ALIGN_ASSET(2) char gLinkChildSlinghotStringDL[] = dgLinkChildSlinghotStringDL; +static const ALIGN_ASSET(2) char gLinkChildSlingshotStringDL[] = dgLinkChildSlinghotStringDL; #define dgLinkChildDekuShieldDL "__OTR__objects/object_link_child/gLinkChildDekuShieldDL" static const ALIGN_ASSET(2) char gLinkChildDekuShieldDL[] = dgLinkChildDekuShieldDL; diff --git a/soh/include/global.h b/soh/include/global.h index 43f56ed0e..b453439fd 100644 --- a/soh/include/global.h +++ b/soh/include/global.h @@ -8,7 +8,7 @@ #include "functions.h" #include "variables.h" #include "macros.h" -#include "soh/OTRGlobals.h" +#include "soh/cvar_prefixes.h" #include "soh/Enhancements/gameconsole.h" #include "soh/Enhancements/gameplaystats.h" #include diff --git a/soh/soh/Enhancements/audio/AudioCollection.cpp b/soh/soh/Enhancements/audio/AudioCollection.cpp index dadcbf2ac..5b0165637 100644 --- a/soh/soh/Enhancements/audio/AudioCollection.cpp +++ b/soh/soh/Enhancements/audio/AudioCollection.cpp @@ -1,6 +1,7 @@ #include "AudioCollection.h" #include "sequence.h" #include "sfx.h" +#include "soh/cvar_prefixes.h" #include #include #include diff --git a/soh/soh/Enhancements/audio/AudioEditor.cpp b/soh/soh/Enhancements/audio/AudioEditor.cpp index a9fefbe71..954baa681 100644 --- a/soh/soh/Enhancements/audio/AudioEditor.cpp +++ b/soh/soh/Enhancements/audio/AudioEditor.cpp @@ -8,9 +8,10 @@ #include #include #include "../randomizer/3drando/random.hpp" -#include "../../OTRGlobals.h" +#include "soh/OTRGlobals.h" +#include "soh/cvar_prefixes.h" #include -#include "../../UIWidgets.hpp" +#include "soh/UIWidgets.hpp" #include "AudioCollection.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" diff --git a/soh/soh/Enhancements/bootcommands.c b/soh/soh/Enhancements/bootcommands.c index 16ad651fc..c010067da 100644 --- a/soh/soh/Enhancements/bootcommands.c +++ b/soh/soh/Enhancements/bootcommands.c @@ -10,6 +10,7 @@ #include #include #include "soh/OTRGlobals.h" +#include "soh/cvar_prefixes.h" uint8_t gLoadFileSelect = 0, gSkipLogoTest = 0; diff --git a/soh/soh/Enhancements/controls/InputViewer.cpp b/soh/soh/Enhancements/controls/InputViewer.cpp index 75a1ea5e7..6abaed446 100644 --- a/soh/soh/Enhancements/controls/InputViewer.cpp +++ b/soh/soh/Enhancements/controls/InputViewer.cpp @@ -4,6 +4,7 @@ #include "libultraship/libultra/controller.h" #include "Context.h" #include "soh/OTRGlobals.h" +#include "soh/cvar_prefixes.h" #ifndef IMGUI_DEFINE_MATH_OPERATORS #define IMGUI_DEFINE_MATH_OPERATORS #endif diff --git a/soh/soh/Enhancements/controls/SohInputEditorWindow.cpp b/soh/soh/Enhancements/controls/SohInputEditorWindow.cpp index 41c1538dc..14c891424 100644 --- a/soh/soh/Enhancements/controls/SohInputEditorWindow.cpp +++ b/soh/soh/Enhancements/controls/SohInputEditorWindow.cpp @@ -3,6 +3,7 @@ #include "soh/OTRGlobals.h" #include "../../UIWidgets.hpp" #include "z64.h" +#include "soh/cvar_prefixes.h" #ifndef __WIIU__ #include "controller/controldevice/controller/mapping/sdl/SDLAxisDirectionToButtonMapping.h" #endif @@ -1578,9 +1579,9 @@ void SohInputEditorWindow::DrawCameraControlPanel() { UIWidgets::Tooltip("Inverts the Camera X Axis in:\n-First-Person/C-Up view\n-Weapon Aiming"); UIWidgets::PaddedEnhancementCheckbox("Invert Aiming Y Axis", CVAR_SETTING("Controls.InvertAimingYAxis"), true, true, false, "", UIWidgets::CheckboxGraphics::Cross, true); UIWidgets::Tooltip("Inverts the Camera Y Axis in:\n-First-Person/C-Up view\n-Weapon Aiming"); - UIWidgets::PaddedEnhancementCheckbox("Invert Shield Aiming Y Axis", CVAR_SETTING("Controls.InvertShieldAimingYAxis"), true, true, false, "", UIWidgets::CheckboxGraphics::Cross, true); + UIWidgets::PaddedEnhancementCheckbox("Invert Shield Aiming X Axis", CVAR_SETTING("Controls.InvertShieldAimingXAxis"), true, true, false, "", UIWidgets::CheckboxGraphics::Cross, true); UIWidgets::Tooltip("Inverts the Shield Aiming Y Axis"); - UIWidgets::PaddedEnhancementCheckbox("Invert Shield Aiming X Axis", CVAR_SETTING("Controls.InvertShieldAimingYAxis")); + UIWidgets::PaddedEnhancementCheckbox("Invert Shield Aiming Y Axis", CVAR_SETTING("Controls.InvertShieldAimingYAxis")); UIWidgets::Tooltip("Inverts the Shield Aiming X Axis"); UIWidgets::PaddedEnhancementCheckbox("Invert Z-Weapon Aiming Y Axis", CVAR_SETTING("Controls.InvertZAimingYAxis"), true, true, false, "", UIWidgets::CheckboxGraphics::Cross, true); UIWidgets::Tooltip("Inverts the Camera Y Axis in:\n-Z-Weapon Aiming"); diff --git a/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp b/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp index 5f4739478..712101824 100644 --- a/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp +++ b/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp @@ -14,10 +14,12 @@ #include "soh/UIWidgets.hpp" #include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" extern "C" { #include #include "macros.h" +#include "soh/cvar_prefixes.h" extern PlayState* gPlayState; #include "objects/object_link_boy/object_link_boy.h" #include "objects/object_link_child/object_link_child.h" @@ -877,7 +879,7 @@ void ApplyOrResetCustomGfxPatches(bool manualChange) { Color_RGBA8 color = CVarGetColor(equipmentSlingshotString.cvar, defaultColor); PATCH_GFX(gGiSlingshotDL, "Equipment_SlingshotString1",equipmentSlingshotString.changedCvar, 75, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); PATCH_GFX(gGiSlingshotDL, "Equipment_SlingshotString2",equipmentSlingshotString.changedCvar, 76, gsDPSetEnvColor(color.r / 2, color.g / 2, color.b / 2, 255)); - PATCH_GFX(gLinkChildSlinghotStringDL, "Equipment_SlingshotString3",equipmentSlingshotString.changedCvar, 9, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkChildSlingshotStringDL, "Equipment_SlingshotString3",equipmentSlingshotString.changedCvar, 9, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); } static CosmeticOption& equipmentBowTips = cosmeticOptions.at("Equipment.BowTips"); @@ -1419,7 +1421,7 @@ void DrawSillyTab() { Reset_Option_Single("Reset##BunnyHood_EarLength", CVAR_COSMETIC("BunnyHood.EarLength")); UIWidgets::EnhancementSliderFloat("Bunny Hood Spread: %f", "##BunnyHood_EarSpread", CVAR_COSMETIC("BunnyHood.EarSpread"), -300.0f, 500.0f, "", 0.0f, false); Reset_Option_Single("Reset##BunnyHood_EarSpread", CVAR_COSMETIC("BunnyHood.EarSpread")); - UIWidgets::EnhancementSliderFloat("Goron Neck Length: %f", "##Goron_NeckLength", CVAR_COSMETIC("Goron.NeckLength"), 0.0f, 1000.0f, "", 0.0f, false); + UIWidgets::EnhancementSliderFloat("Goron Neck Length: %f", "##Goron_NeckLength", CVAR_COSMETIC("Goron.NeckLength"), 0.0f, 5000.0f, "", 0.0f, false); Reset_Option_Single("Reset##Goron_NeckLength", CVAR_COSMETIC("Goron.NeckLength")); UIWidgets::EnhancementCheckbox("Unfix Goron Spin", CVAR_COSMETIC("UnfixGoronSpin")); UIWidgets::EnhancementSliderFloat("Fairies Size: %f", "##Fairies_Size", CVAR_COSMETIC("Fairies.Size"), 0.25f, 5.0f, "", 1.0f, false); diff --git a/soh/soh/Enhancements/cosmetics/authenticGfxPatches.cpp b/soh/soh/Enhancements/cosmetics/authenticGfxPatches.cpp index 6b74769c1..75f6bd35d 100644 --- a/soh/soh/Enhancements/cosmetics/authenticGfxPatches.cpp +++ b/soh/soh/Enhancements/cosmetics/authenticGfxPatches.cpp @@ -1,6 +1,8 @@ #include #include #include "soh/OTRGlobals.h" +#include "soh/cvar_prefixes.h" +#include "soh/ResourceManagerHelpers.h" extern "C" { #include @@ -9,11 +11,6 @@ extern "C" { #include "objects/object_gi_soldout/object_gi_soldout.h" #include "objects/object_ik/object_ik.h" #include "objects/object_link_child/object_link_child.h" - -uint32_t ResourceMgr_GameHasMasterQuest(); -uint32_t ResourceMgr_GameHasOriginal(); -void ResourceMgr_PatchGfxByName(const char* path, const char* patchName, int index, Gfx instruction); -void ResourceMgr_UnpatchGfxByName(const char* path, const char* patchName); } typedef struct { diff --git a/soh/soh/Enhancements/custom-message/CustomMessageManager.cpp b/soh/soh/Enhancements/custom-message/CustomMessageManager.cpp index c165a1364..fde95e0c5 100644 --- a/soh/soh/Enhancements/custom-message/CustomMessageManager.cpp +++ b/soh/soh/Enhancements/custom-message/CustomMessageManager.cpp @@ -26,6 +26,10 @@ static const std::unordered_map percentColors = { { "w { "b", QM_BLUE }, { "c", QM_LBLUE }, { "p", QM_PINK }, { "y", QM_YELLOW }, { "B", QM_BLACK } }; +static const std::unordered_map colorToPercent = { { QM_WHITE, "%w" }, { QM_RED, "%r"}, { QM_GREEN, "%g" }, + { QM_BLUE, "%b" }, { QM_LBLUE, "%c"}, { QM_PINK, "%p" }, + { QM_YELLOW, "%y" }, { QM_BLACK, "%B" } }; + static const std::unordered_map altarIcons = { { "0", ITEM_KOKIRI_EMERALD }, { "1", ITEM_GORON_RUBY }, @@ -153,6 +157,8 @@ void CustomMessage::ProcessMessageFormat(std::string& str, MessageFormat format) CleanString(str); } else if (format == MF_AUTO_FORMAT){ AutoFormatString(str); + }else if (format == MF_ENCODE){ + EncodeColors(str); } } @@ -296,6 +302,12 @@ void CustomMessage::Clean() { } } +void CustomMessage::Encode() { + for (std::string& str : messages) { + EncodeColors(str); + } +} + void CustomMessage::FormatString(std::string& str) const { std::replace(str.begin(), str.end(), '&', NEWLINE()[0]); std::replace(str.begin(), str.end(), '^', WAIT_FOR_INPUT()[0]); @@ -521,7 +533,23 @@ const char* Interface_ReplaceSpecialCharacters(char text[]) { return textChar; } +void CustomMessage::EncodeColors(std::string& str) const { + for (std::string color: colors) { + if (const size_t firstHashtag = str.find('#'); firstHashtag != std::string::npos) { + str.replace(firstHashtag, 1, colorToPercent.at(color)); + if (const size_t secondHashtag = str.find('#', firstHashtag + 1); secondHashtag != std::string::npos) { + str.replace(secondHashtag, 1, "%w"); + } else { + SPDLOG_DEBUG("non-matching hashtags in string: \"%s\"", str); + } + } + } + // Remove any remaining '#' characters. + std::erase(str, '#'); +} + void CustomMessage::ReplaceColors(std::string& str) const { + EncodeColors(str); for (const auto& colorPair : percentColors) { std::string textToReplace = "%"; textToReplace += colorPair.first; @@ -531,18 +559,6 @@ void CustomMessage::ReplaceColors(std::string& str) const { start_pos += textToReplace.length(); } } - for (auto color: colors) { - if (const size_t firstHashtag = str.find('#'); firstHashtag != std::string::npos) { - str.replace(firstHashtag, 1, COLOR(color)); - if (const size_t secondHashtag = str.find('#', firstHashtag + 1); secondHashtag != std::string::npos) { - str.replace(secondHashtag, 1, COLOR(QM_WHITE)); - } else { - SPDLOG_DEBUG("non-matching hashtags in string: \"%s\"", str); - } - } - } - // Remove any remaining '#' characters. - std::erase(str, '#'); } void CustomMessage::ReplaceAltarIcons(std::string& str) const { @@ -634,6 +650,8 @@ CustomMessage CustomMessageManager::RetrieveMessage(std::string tableID, uint16_ message.AutoFormat(); } else if (format == MF_CLEAN){ message.Clean(); + } else if (format == MF_ENCODE){ + message.Encode(); } return message; diff --git a/soh/soh/Enhancements/custom-message/CustomMessageManager.h b/soh/soh/Enhancements/custom-message/CustomMessageManager.h index ef9ecd725..4c32db015 100644 --- a/soh/soh/Enhancements/custom-message/CustomMessageManager.h +++ b/soh/soh/Enhancements/custom-message/CustomMessageManager.h @@ -26,7 +26,8 @@ typedef enum { MF_FORMATTED, MF_CLEAN, MF_RAW, - MF_AUTO_FORMAT + MF_AUTO_FORMAT, + MF_ENCODE, } MessageFormat; /** @@ -111,6 +112,11 @@ class CustomMessage { */ void ReplaceSpecialCharacters(std::string& str) const; + /** + * @brief Replaces hashtags with stored colors. + */ + void EncodeColors(std::string& str) const; + /** * @brief Replaces our color variable strings with the OoT control codes. */ @@ -163,6 +169,11 @@ class CustomMessage { */ void Clean(); + /** + * @brief Replaces variable characters with fixed ones to store the sata in string form + */ + void Encode(); + /** * @brief Replaces various symbols with the control codes necessary to * display them in OoT's textboxes for a single string diff --git a/soh/soh/Enhancements/debugconsole.cpp b/soh/soh/Enhancements/debugconsole.cpp index 9a4bd0449..4f65ef9a5 100644 --- a/soh/soh/Enhancements/debugconsole.cpp +++ b/soh/soh/Enhancements/debugconsole.cpp @@ -6,6 +6,7 @@ #include #include #include "soh/OTRGlobals.h" +#include "soh/cvar_prefixes.h" #include #include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/cosmetics/CosmeticsEditor.h" diff --git a/soh/soh/Enhancements/debugger/MessageViewer.cpp b/soh/soh/Enhancements/debugger/MessageViewer.cpp index 5b23c1876..7ae34b4a8 100644 --- a/soh/soh/Enhancements/debugger/MessageViewer.cpp +++ b/soh/soh/Enhancements/debugger/MessageViewer.cpp @@ -6,6 +6,7 @@ #include "../custom-message/CustomMessageManager.h" #include "functions.h" #include "macros.h" +#include "soh/cvar_prefixes.h" #include "message_data_static.h" #include "variables.h" #include "soh/util.h" diff --git a/soh/soh/Enhancements/debugger/actorViewer.cpp b/soh/soh/Enhancements/debugger/actorViewer.cpp index 9992f1ecd..c6ac49a74 100644 --- a/soh/soh/Enhancements/debugger/actorViewer.cpp +++ b/soh/soh/Enhancements/debugger/actorViewer.cpp @@ -13,6 +13,7 @@ #include #include #include "soh/OTRGlobals.h" +#include "soh/cvar_prefixes.h" extern "C" { #include diff --git a/soh/soh/Enhancements/debugger/colViewer.cpp b/soh/soh/Enhancements/debugger/colViewer.cpp index 5139576ce..57df9a4a2 100644 --- a/soh/soh/Enhancements/debugger/colViewer.cpp +++ b/soh/soh/Enhancements/debugger/colViewer.cpp @@ -15,6 +15,7 @@ extern "C" { #include "variables.h" #include "functions.h" #include "macros.h" +#include "soh/cvar_prefixes.h" extern PlayState* gPlayState; } diff --git a/soh/soh/Enhancements/debugger/debugSaveEditor.cpp b/soh/soh/Enhancements/debugger/debugSaveEditor.cpp index a5126d32e..807c269d3 100644 --- a/soh/soh/Enhancements/debugger/debugSaveEditor.cpp +++ b/soh/soh/Enhancements/debugger/debugSaveEditor.cpp @@ -18,6 +18,7 @@ extern "C" { #include "variables.h" #include "functions.h" #include "macros.h" +#include "soh/cvar_prefixes.h" #include "soh/Enhancements/randomizer/adult_trade_shuffle.h" extern PlayState* gPlayState; @@ -1206,7 +1207,7 @@ void DrawQuestStatusTab() { ImGui::SameLine(); DrawQuestItemButton(QUEST_GERUDO_CARD); - for (const SongMapEntry& entry : songMapping) { + for (const auto& [quest, entry] : songMapping) { if ((entry.id != QUEST_SONG_MINUET) && (entry.id != QUEST_SONG_LULLABY)) { ImGui::SameLine(); } diff --git a/soh/soh/Enhancements/debugger/valueViewer.cpp b/soh/soh/Enhancements/debugger/valueViewer.cpp index c03be8ee1..a58512ea3 100644 --- a/soh/soh/Enhancements/debugger/valueViewer.cpp +++ b/soh/soh/Enhancements/debugger/valueViewer.cpp @@ -7,6 +7,7 @@ extern "C" { #include "variables.h" #include "functions.h" #include "macros.h" +#include "soh/cvar_prefixes.h" extern PlayState* gPlayState; void GfxPrint_SetColor(GfxPrint* printer, u32 r, u32 g, u32 b, u32 a); void GfxPrint_SetPos(GfxPrint* printer, s32 x, s32 y); diff --git a/soh/soh/Enhancements/enemyrandomizer.cpp b/soh/soh/Enhancements/enemyrandomizer.cpp index e0f82062c..89aab7e00 100644 --- a/soh/soh/Enhancements/enemyrandomizer.cpp +++ b/soh/soh/Enhancements/enemyrandomizer.cpp @@ -6,13 +6,13 @@ #include "soh/Enhancements/enhancementTypes.h" #include "variables.h" #include "soh/OTRGlobals.h" +#include "soh/cvar_prefixes.h" +#include "soh/ResourceManagerHelpers.h" extern "C" { #include } -extern "C" uint32_t ResourceMgr_IsSceneMasterQuest(s16 sceneNum); - const char* enemyCVarList[] = { CVAR_ENHANCEMENT("RandomizedEnemyList.Armos"), CVAR_ENHANCEMENT("RandomizedEnemyList.Arwing"), CVAR_ENHANCEMENT("RandomizedEnemyList.BabyDodongo"), CVAR_ENHANCEMENT("RandomizedEnemyList.Bari"), diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor_RawAction.cpp b/soh/soh/Enhancements/game-interactor/GameInteractor_RawAction.cpp index 9f7a73ad3..24e38d9b4 100644 --- a/soh/soh/Enhancements/game-interactor/GameInteractor_RawAction.cpp +++ b/soh/soh/Enhancements/game-interactor/GameInteractor_RawAction.cpp @@ -8,6 +8,7 @@ extern "C" { #include "variables.h" #include "macros.h" +#include "soh/cvar_prefixes.h" #include "functions.h" extern PlayState* gPlayState; } diff --git a/soh/soh/Enhancements/gameplaystats.cpp b/soh/soh/Enhancements/gameplaystats.cpp index 82a4b3b6e..3f7691741 100644 --- a/soh/soh/Enhancements/gameplaystats.cpp +++ b/soh/soh/Enhancements/gameplaystats.cpp @@ -1,11 +1,10 @@ -extern "C" { #include "gameplaystats.h" -} #include "gameplaystatswindow.h" #include "soh/SaveManager.h" #include "functions.h" #include "macros.h" +#include "soh/cvar_prefixes.h" #include "../UIWidgets.hpp" #include "soh/util.h" diff --git a/soh/soh/Enhancements/gameplaystats.h b/soh/soh/Enhancements/gameplaystats.h index 528da33f9..9d41f2560 100644 --- a/soh/soh/Enhancements/gameplaystats.h +++ b/soh/soh/Enhancements/gameplaystats.h @@ -1,5 +1,17 @@ #pragma once +#include "soh/cvar_prefixes.h" +#include + +#ifdef __cplusplus +extern "C" { +#endif + uint64_t GetUnixTimestamp(void); + char* GameplayStats_GetCurrentTime(); +#ifdef __cplusplus +}; +#endif + // When using RTA timing // get the diff since the save was created, // unless the game is complete in which we use the defeated ganon timestamp @@ -17,7 +29,6 @@ gSaveContext.sohStats.sceneTimer) void InitStatTracker(); -char* GameplayStats_GetCurrentTime(); typedef enum { // 0x00 to 0x9B (0 to 155) used for getting items, diff --git a/soh/soh/Enhancements/mods.cpp b/soh/soh/Enhancements/mods.cpp index 168f38473..c88733e22 100644 --- a/soh/soh/Enhancements/mods.cpp +++ b/soh/soh/Enhancements/mods.cpp @@ -3,6 +3,9 @@ #include "game-interactor/GameInteractor.h" #include "tts/tts.h" #include "soh/OTRGlobals.h" +#include "soh/SaveManager.h" +#include "soh/ResourceManagerHelpers.h" +#include "soh/Enhancements/boss-rush/BossRushTypes.h" #include "soh/Enhancements/boss-rush/BossRush.h" #include "soh/Enhancements/enhancementTypes.h" #include "soh/Enhancements/randomizer/3drando/random.hpp" @@ -42,18 +45,16 @@ extern "C" { #include #include "align_asset_macro.h" #include "macros.h" +#include "soh/cvar_prefixes.h" #include "functions.h" #include "variables.h" #include "functions.h" #include "src/overlays/actors/ovl_En_Door/z_en_door.h" -void ResourceMgr_PatchGfxByName(const char* path, const char* patchName, int index, Gfx instruction); -void ResourceMgr_UnpatchGfxByName(const char* path, const char* patchName); extern SaveContext gSaveContext; extern PlayState* gPlayState; extern "C" s16 gEnSnowballId; extern void Overlay_DisplayText(float duration, const char* text); -uint32_t ResourceMgr_IsSceneMasterQuest(s16 sceneNum); } // GreyScaleEndDlist diff --git a/soh/soh/Enhancements/nametag.cpp b/soh/soh/Enhancements/nametag.cpp index fa88c9aeb..c2d72eae0 100644 --- a/soh/soh/Enhancements/nametag.cpp +++ b/soh/soh/Enhancements/nametag.cpp @@ -10,6 +10,7 @@ extern "C" { #include "z64.h" #include "macros.h" +#include "soh/cvar_prefixes.h" #include "functions.h" #include "variables.h" #include "textures/message_static/message_static.h" diff --git a/soh/soh/Enhancements/presets.cpp b/soh/soh/Enhancements/presets.cpp index c98f64eda..8c7126e42 100644 --- a/soh/soh/Enhancements/presets.cpp +++ b/soh/soh/Enhancements/presets.cpp @@ -74,7 +74,9 @@ void DrawPresetSelector(PresetType presetTypeId) { applyPreset(selectedPresetDef.entries); } Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); - Rando::Context::GetInstance()->GetSettings()->ReloadOptions(); + if (presetTypeId == PRESET_TYPE_RANDOMIZER){ + Rando::Context::GetInstance()->GetSettings()->ReloadOptions(); + } } ImGui::PopStyleVar(1); } diff --git a/soh/soh/Enhancements/presets.h b/soh/soh/Enhancements/presets.h index 6543e1a7c..96b39ba30 100644 --- a/soh/soh/Enhancements/presets.h +++ b/soh/soh/Enhancements/presets.h @@ -8,6 +8,7 @@ #include "soh/Enhancements/randomizer/randomizerTypes.h" #include "soh/Enhancements/enhancementTypes.h" #include "soh/OTRGlobals.h" +#include "soh/cvar_prefixes.h" enum PresetEntryType { PRESET_ENTRY_TYPE_S32, diff --git a/soh/soh/Enhancements/randomizer/3drando/hint_list.cpp b/soh/soh/Enhancements/randomizer/3drando/hint_list.cpp index ea082218e..14faa479b 100644 --- a/soh/soh/Enhancements/randomizer/3drando/hint_list.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/hint_list.cpp @@ -2253,6 +2253,118 @@ void StaticData::HintTable_Init() { /*german*/ "", /*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR)); + hintTextTable[RHT_JUNK_CREW_1] = HintText(CustomMessage("They say that %gGanondorf's Mom%w is going out with %ySqueak%w!", + /*german*/ "", + /*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR)); + + hintTextTable[RHT_JUNK_CREW_2] = HintText(CustomMessage("They say that %gProxySaw%w is still fixing %yCaladius's Bugs%w...", + /*german*/ "", + /*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR)); + + hintTextTable[RHT_JUNK_CREW_3] = HintText(CustomMessage("They say that %gItsHeckinPat%w is still just %yEyeballing it%w.", + /*german*/ "", + /*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR)); + + hintTextTable[RHT_JUNK_CREW_4] = HintText(CustomMessage("They say that %gCaladius%w is working on %yV2%w of something.", + /*german*/ "", + /*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR)); + + hintTextTable[RHT_JUNK_CREW_5] = HintText(CustomMessage("They say that %gdice%w is a funny name for a %ytaco%w.", + /*german*/ "", + /*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR)); + + hintTextTable[RHT_JUNK_CREW_6] = HintText(CustomMessage("They say %g2Ship Rando%w is still blocked by %yV3%w...", + /*german*/ "", + /*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR)); + + hintTextTable[RHT_JUNK_CREW_7] = HintText(CustomMessage("They say if you click your heels and say %gframebuffer%w 3 times, %yArchez%w appears!", + /*german*/ "", + /*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR)); + + hintTextTable[RHT_JUNK_CREW_8] = HintText(CustomMessage("They say %gVB%w stands for %yVirtual Bananas%w... Probably.", + /*german*/ "", + /*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR)); + + hintTextTable[RHT_JUNK_CREW_9] = HintText(CustomMessage("They say %gZeru%w is still routing his %yHundo%w.", + /*german*/ "", + /*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR)); + + hintTextTable[RHT_JUNK_CREW_10] = HintText(CustomMessage("They say %gRaccoonCloud%w is still looking for his %yHover Boots%w.", + /*german*/ "", + /*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR)); + + hintTextTable[RHT_JUNK_CREW_11] = HintText(CustomMessage("They say %gItsHeckinPat%w foreclosed on his %yHut%w.", + /*german*/ "", + /*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR)); + + hintTextTable[RHT_JUNK_CREW_12] = HintText(CustomMessage("They say %gRaccoonCloud%w is part of the %yInner Circle%w.", + /*german*/ "", + /*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR)); + + hintTextTable[RHT_JUNK_CREW_13] = HintText(CustomMessage("They say %gMoonlitxShadows%w is the %rleader%w of the %yDork Army%w.", + /*german*/ "", + /*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR)); + + hintTextTable[RHT_JUNK_CREW_14] = HintText(CustomMessage("They say %gGanondorf%w hates the %yInternet%w.", + /*german*/ "", + /*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR)); + + hintTextTable[RHT_JUNK_CREW_15] = HintText(CustomMessage("They say %gMido's House%w hoards %yTrash%w.", + /*german*/ "", + /*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR)); + + hintTextTable[RHT_JUNK_CREW_16] = HintText(CustomMessage("They say %gSweettalking Ganondorf%w rewards %yHis Heart%w.", + /*german*/ "", + /*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR)); + + hintTextTable[RHT_JUNK_CREW_17] = HintText(CustomMessage("They say %gaMannus%w said %yGo To Bed%w!", + /*german*/ "", + /*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR)); + + hintTextTable[RHT_JUNK_CREW_18] = HintText(CustomMessage("They say %gCaladius%w is a %yPinhead%w!", + /*german*/ "", + /*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR)); + + hintTextTable[RHT_JUNK_CREW_19] = HintText(CustomMessage("They say %gRaccoonCloud%w loves the %yIce Cavern%w.", + /*german*/ "", + /*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR)); + + hintTextTable[RHT_JUNK_CREW_20] = HintText(CustomMessage("They say %gNo One%w should forget %yHover Scrub%w!", + /*german*/ "", + /*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR)); + + hintTextTable[RHT_JUNK_CREW_21] = HintText(CustomMessage("They say %gMoonlitxShadows%w likes to %ySlide%w.", + /*german*/ "", + /*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR)); + + hintTextTable[RHT_JUNK_CREW_23] = HintText(CustomMessage("They say that %gBackwalking%w should be %rBanned%w!", + /*german*/ "", + /*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR)); + + hintTextTable[RHT_JUNK_CREW_24] = HintText(CustomMessage("They say that %gGorons%w should always have %yLong Necks%w!", + /*german*/ "", + /*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR)); + + hintTextTable[RHT_JUNK_CREW_25] = HintText(CustomMessage("They say that %gCaladius%w has a %ytendency to lose his shirt%w!", + /*german*/ "", + /*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR)); + + hintTextTable[RHT_JUNK_CREW_26] = HintText(CustomMessage("They say that if your %rSkip keeps Failing%w, you're probably an %yESS Off%w.", + /*german*/ "", + /*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR)); + + hintTextTable[RHT_JUNK_CREW_27] = HintText(CustomMessage("They say that %gLogic%w is just a %ySuggestion%w.", + /*german*/ "", + /*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR)); + + hintTextTable[RHT_JUNK_CREW_28] = HintText(CustomMessage("They say there's %gAlways Logic%w in %yNo Logic%w...", + /*german*/ "", + /*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR)); + + hintTextTable[RHT_JUNK_CREW_29] = HintText(CustomMessage("They said that %rFredomato%w has just %yone more push up%w to do!", + /*german*/ "", + /*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR)); + /*-------------------------- | DUNGEON HINT TEXT | ---------------------------*/ diff --git a/soh/soh/Enhancements/randomizer/3drando/hints.cpp b/soh/soh/Enhancements/randomizer/3drando/hints.cpp index f72212301..ee6a638f5 100644 --- a/soh/soh/Enhancements/randomizer/3drando/hints.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/hints.cpp @@ -113,8 +113,8 @@ StaticHintInfo::StaticHintInfo(HintType _type, std::vectorGetName()); - assert(false); + //assert(false); areas.push_back(RA_NONE); } else { areas.push_back(ctx->GetItemLocation(loc)->GetRandomArea()); diff --git a/soh/soh/Enhancements/randomizer/3drando/hints.hpp b/soh/soh/Enhancements/randomizer/3drando/hints.hpp index d111c78ca..9199c6c81 100644 --- a/soh/soh/Enhancements/randomizer/3drando/hints.hpp +++ b/soh/soh/Enhancements/randomizer/3drando/hints.hpp @@ -69,6 +69,8 @@ struct StaticHintInfo{ std::vector _hintChecks = {}, bool _yourPocket = false, int _num = 0); }; +RandomizerHintTextKey GetRandomJunkHint(); extern void CreateAllHints(); extern void CreateWarpSongTexts(); -void CreateStaticHints(); \ No newline at end of file +void CreateStaticHints(); +RandomizerHintTextKey GetRandomJunkHint(); \ No newline at end of file diff --git a/soh/soh/Enhancements/randomizer/3drando/playthrough.cpp b/soh/soh/Enhancements/randomizer/3drando/playthrough.cpp index 0d4f39c5c..e789b16cf 100644 --- a/soh/soh/Enhancements/randomizer/3drando/playthrough.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/playthrough.cpp @@ -10,6 +10,7 @@ #include "soh/Enhancements/randomizer/randomizerTypes.h" #include "variables.h" #include "soh/OTRGlobals.h" +#include "soh/cvar_prefixes.h" #include "../option.h" #include "soh/Enhancements/debugger/performanceTimer.h" diff --git a/soh/soh/Enhancements/randomizer/3drando/rando_main.cpp b/soh/soh/Enhancements/randomizer/3drando/rando_main.cpp index d4d7ebdd7..0558b26e1 100644 --- a/soh/soh/Enhancements/randomizer/3drando/rando_main.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/rando_main.cpp @@ -9,6 +9,7 @@ #include #include #include "soh/OTRGlobals.h" +#include "soh/cvar_prefixes.h" void RandoMain::GenerateRando(std::set excludedLocations, std::set enabledTricks, std::string seedString) { diff --git a/soh/soh/Enhancements/randomizer/Plandomizer.cpp b/soh/soh/Enhancements/randomizer/Plandomizer.cpp new file mode 100644 index 000000000..fcec76887 --- /dev/null +++ b/soh/soh/Enhancements/randomizer/Plandomizer.cpp @@ -0,0 +1,1114 @@ +#include "Plandomizer.h" +#include "soh/UIWidgets.hpp" +#include "soh/util.h" +#include +#include "soh/Notification/Notification.h" +#include +#include "soh/Enhancements/randomizer/3drando/hints.hpp" + +#include +#include + +#include "soh/OTRGlobals.h" +#include "soh/ImGuiUtils.h" +#include "soh/Enhancements/randomizer/logic.h" +#include "soh/Enhancements/randomizer/randomizer_check_objects.h" +#include "soh/Enhancements/randomizer/rando_hash.h" +#include "soh/Enhancements/randomizer/3drando/shops.hpp" + +extern "C" { + #include "include/z64item.h" + #include "objects/gameplay_keep/gameplay_keep.h" + extern SaveContext gSaveContext; + extern PlayState* gPlayState; +} + +const std::string randomizeButton = ICON_FA_RANDOM; + +static int32_t correctedItemID = -1; +static int32_t getTabID = TAB_HINTS; + +Rando::Item temporaryItem; +std::string shortName = ""; +std::string logTemp = ""; +std::string lastLoadedSpoiler = ""; +int32_t temporaryItemIndex = -1; +RandomizerCheckArea selectedArea = RCAREA_INVALID; + +ImVec4 itemColor = ImVec4( 1.0f, 1.0f, 1.0f, 1.0f ); +ImTextureID textureID; +ImVec2 imageSize = ImVec2(32.0f, 32.0f); +float imagePadding = 2.0f; +ImVec2 textureUV0 = ImVec2( 0, 0 ); +ImVec2 textureUV1 = ImVec2( 1, 1 ); + +bool shouldPopup = false; +bool shouldTrapPopup = false; +bool shouldRemove = false; + +namespace fs = std::filesystem; +std::vector existingSeedList; + +std::vector spoilerHash; +std::vector plandoHash; +std::vector spoilerLogData; +std::vector plandoLogData; +std::vector> drawnItemsList; + +std::vector spoilerHintData; +std::vector plandoHintData; + +extern std::map rcAreaNames; + +std::unordered_map bossKeyShortNames = { + { RG_FOREST_TEMPLE_BOSS_KEY, "Frst" }, + { RG_FIRE_TEMPLE_BOSS_KEY, "Fire" }, + { RG_WATER_TEMPLE_BOSS_KEY, "Watr" }, + { RG_SPIRIT_TEMPLE_BOSS_KEY, "Sprt" }, + { RG_SHADOW_TEMPLE_BOSS_KEY, "Shdw" }, + { RG_GANONS_CASTLE_BOSS_KEY, "Ganon" }, +}; + +std::unordered_map ocarinaButtonNames = { + { RG_OCARINA_A_BUTTON, "A" }, + { RG_OCARINA_C_UP_BUTTON, "C-UP" }, + { RG_OCARINA_C_DOWN_BUTTON, "C-DWN" }, + { RG_OCARINA_C_LEFT_BUTTON, "C-LFT" }, + { RG_OCARINA_C_RIGHT_BUTTON, "C-RHT" }, +}; + +std::map bossSoulMapping = { + { RG_GOHMA_SOUL, { 0.00f, 1.00f, 0.00f, 1.0f } }, + { RG_KING_DODONGO_SOUL, { 1.00f, 0.00f, 0.39f, 1.0f } }, + { RG_BARINADE_SOUL, { 0.20f, 1.00f, 1.00f, 1.0f } }, + { RG_PHANTOM_GANON_SOUL, { 0.02f, 0.76f, 0.18f, 1.0f } }, + { RG_VOLVAGIA_SOUL, { 0.93f, 0.37f, 0.37f, 1.0f } }, + { RG_MORPHA_SOUL, { 0.33f, 0.71f, 0.87f, 1.0f } }, + { RG_BONGO_BONGO_SOUL, { 0.49f, 0.06f, 0.69f, 1.0f } }, + { RG_TWINROVA_SOUL, { 0.87f, 0.62f, 0.18f, 1.0f } }, + { RG_GANON_SOUL, { 0.31f, 0.31f, 0.31f, 1.0f } } +}; + + +std::vector infiniteItemList = { + RG_GREEN_RUPEE, RG_BLUE_RUPEE, RG_RED_RUPEE, RG_PURPLE_RUPEE, RG_HUGE_RUPEE, + RG_ARROWS_5, RG_ARROWS_10, RG_ARROWS_30, + RG_DEKU_STICK_1, RG_DEKU_SEEDS_30, RG_DEKU_NUTS_5, RG_DEKU_NUTS_10, + RG_BOMBS_5, RG_BOMBS_10, RG_BOMBS_20, RG_BOMBCHU_5, RG_BOMBCHU_10, RG_BOMBCHU_20, + RG_RECOVERY_HEART, RG_ICE_TRAP, RG_SOLD_OUT +}; + +std::unordered_map itemImageMap = { + { RG_NONE, "ITEM_SOLD_OUT" }, + { RG_KOKIRI_SWORD, "ITEM_SWORD_KOKIRI" }, + { RG_GIANTS_KNIFE, "ITEM_SWORD_KNIFE" }, + { RG_BIGGORON_SWORD, "ITEM_SWORD_BGS" }, + { RG_DEKU_SHIELD, "ITEM_SHIELD_DEKU" }, + { RG_HYLIAN_SHIELD, "ITEM_SHIELD_HYLIAN" }, + { RG_MIRROR_SHIELD, "ITEM_SHIELD_MIRROR" }, + { RG_GORON_TUNIC, "ITEM_TUNIC_GORON" }, + { RG_ZORA_TUNIC, "ITEM_TUNIC_ZORA" }, + { RG_IRON_BOOTS, "ITEM_BOOTS_IRON" }, + { RG_HOVER_BOOTS, "ITEM_BOOTS_HOVER" }, + { RG_BOOMERANG, "ITEM_BOOMERANG" }, + { RG_LENS_OF_TRUTH, "ITEM_LENS" }, + { RG_MEGATON_HAMMER, "ITEM_HAMMER" }, + { RG_STONE_OF_AGONY, "ITEM_STONE_OF_AGONY" }, + { RG_DINS_FIRE, "ITEM_DINS_FIRE" }, + { RG_FARORES_WIND, "ITEM_FARORES_WIND" }, + { RG_NAYRUS_LOVE, "ITEM_NAYRUS_LOVE" }, + { RG_FIRE_ARROWS, "ITEM_ARROW_FIRE" }, + { RG_ICE_ARROWS, "ITEM_ARROW_ICE" }, + { RG_LIGHT_ARROWS, "ITEM_ARROW_LIGHT" }, + { RG_GERUDO_MEMBERSHIP_CARD, "ITEM_GERUDO_CARD" }, + { RG_MAGIC_BEAN, "ITEM_BEAN" }, + { RG_MAGIC_BEAN_PACK, "ITEM_BEAN" }, + { RG_DOUBLE_DEFENSE, "ITEM_HEART_CONTAINER" }, + { RG_WEIRD_EGG, "ITEM_WEIRD_EGG" }, + { RG_ZELDAS_LETTER, "ITEM_LETTER_ZELDA" }, + { RG_POCKET_EGG, "ITEM_POCKET_EGG" }, + { RG_COJIRO, "ITEM_COJIRO" }, + { RG_ODD_MUSHROOM, "ITEM_ODD_MUSHROOM" }, + { RG_ODD_POTION, "ITEM_ODD_POTION" }, + { RG_POACHERS_SAW, "ITEM_SAW" }, + { RG_BROKEN_SWORD, "ITEM_SWORD_BROKEN" }, + { RG_PRESCRIPTION, "ITEM_PRESCRIPTION" }, + { RG_EYEBALL_FROG, "ITEM_FROG" }, + { RG_EYEDROPS, "ITEM_EYEDROPS" }, + { RG_CLAIM_CHECK, "ITEM_CLAIM_CHECK" }, + { RG_GOLD_SKULLTULA_TOKEN, "ITEM_SKULL_TOKEN" }, + { RG_PROGRESSIVE_HOOKSHOT, "ITEM_HOOKSHOT" }, + { RG_PROGRESSIVE_STRENGTH, "ITEM_BRACELET" }, + { RG_PROGRESSIVE_BOMB_BAG, "ITEM_BOMB_BAG_30" }, + { RG_PROGRESSIVE_BOW, "ITEM_QUIVER_30" }, + { RG_PROGRESSIVE_SLINGSHOT, "ITEM_SLINGSHOT" }, + { RG_PROGRESSIVE_WALLET, "ITEM_WALLET_ADULT" }, + { RG_PROGRESSIVE_SCALE, "ITEM_SCALE_SILVER" }, + { RG_PROGRESSIVE_NUT_UPGRADE, "ITEM_NUT" }, + { RG_PROGRESSIVE_STICK_UPGRADE, "ITEM_STICK" }, + { RG_PROGRESSIVE_BOMBCHUS, "ITEM_BOMBCHU" }, + { RG_PROGRESSIVE_MAGIC_METER, "ITEM_MAGIC_SMALL" }, + { RG_MAGIC_SINGLE, "ITEM_MAGIC_SMALL" }, + { RG_MAGIC_DOUBLE, "ITEM_MAGIC_LARGE" }, + { RG_PROGRESSIVE_OCARINA, "ITEM_OCARINA_FAIRY" }, + { RG_PROGRESSIVE_GORONSWORD, "ITEM_SWORD_BGS" }, + { RG_EMPTY_BOTTLE, "ITEM_BOTTLE" }, + { RG_BOTTLE_WITH_MILK, "ITEM_MILK_BOTTLE" }, + { RG_BOTTLE_WITH_RED_POTION, "ITEM_POTION_RED" }, + { RG_BOTTLE_WITH_GREEN_POTION, "ITEM_POTION_GREEN" }, + { RG_BOTTLE_WITH_BLUE_POTION, "ITEM_POTION_BLUE" }, + { RG_BOTTLE_WITH_FAIRY, "ITEM_FAIRY" }, + { RG_BOTTLE_WITH_FISH, "ITEM_FISH" }, + { RG_BOTTLE_WITH_BLUE_FIRE, "ITEM_BLUE_FIRE" }, + { RG_BOTTLE_WITH_BUGS, "ITEM_BUG" }, + { RG_BOTTLE_WITH_POE, "ITEM_POE" }, + { RG_RUTOS_LETTER, "ITEM_LETTER_RUTO" }, + { RG_BOTTLE_WITH_BIG_POE, "ITEM_BIG_POE" }, + { RG_ZELDAS_LULLABY, "ITEM_SONG_LULLABY" }, + { RG_EPONAS_SONG, "ITEM_SONG_EPONA" }, + { RG_SARIAS_SONG, "ITEM_SONG_SARIA" }, + { RG_SUNS_SONG, "ITEM_SONG_SUN" }, + { RG_SONG_OF_TIME, "ITEM_SONG_TIME" }, + { RG_SONG_OF_STORMS, "ITEM_SONG_STORMS" }, + { RG_MINUET_OF_FOREST, "ITEM_SONG_MINUET" }, + { RG_BOLERO_OF_FIRE, "ITEM_SONG_BOLERO" }, + { RG_SERENADE_OF_WATER, "ITEM_SONG_SERENADE" }, + { RG_REQUIEM_OF_SPIRIT, "ITEM_SONG_REQUIEM" }, + { RG_NOCTURNE_OF_SHADOW, "ITEM_SONG_NOCTURNE" }, + { RG_PRELUDE_OF_LIGHT, "ITEM_SONG_PRELUDE" }, + { RG_DEKU_TREE_MAP, "ITEM_DUNGEON_MAP" }, + { RG_DODONGOS_CAVERN_MAP, "ITEM_DUNGEON_MAP" }, + { RG_JABU_JABUS_BELLY_MAP, "ITEM_DUNGEON_MAP" }, + { RG_FOREST_TEMPLE_MAP, "ITEM_DUNGEON_MAP" }, + { RG_FIRE_TEMPLE_MAP, "ITEM_DUNGEON_MAP" }, + { RG_WATER_TEMPLE_MAP, "ITEM_DUNGEON_MAP" }, + { RG_SPIRIT_TEMPLE_MAP, "ITEM_DUNGEON_MAP" }, + { RG_SHADOW_TEMPLE_MAP, "ITEM_DUNGEON_MAP" }, + { RG_BOTTOM_OF_THE_WELL_MAP, "ITEM_DUNGEON_MAP" }, + { RG_ICE_CAVERN_MAP, "ITEM_DUNGEON_MAP" }, + { RG_DEKU_TREE_COMPASS, "ITEM_COMPASS" }, + { RG_DODONGOS_CAVERN_COMPASS, "ITEM_COMPASS" }, + { RG_JABU_JABUS_BELLY_COMPASS, "ITEM_COMPASS" }, + { RG_FOREST_TEMPLE_COMPASS, "ITEM_COMPASS" }, + { RG_FIRE_TEMPLE_COMPASS, "ITEM_COMPASS" }, + { RG_WATER_TEMPLE_COMPASS, "ITEM_COMPASS" }, + { RG_SPIRIT_TEMPLE_COMPASS, "ITEM_COMPASS" }, + { RG_SHADOW_TEMPLE_COMPASS, "ITEM_COMPASS" }, + { RG_BOTTOM_OF_THE_WELL_COMPASS, "ITEM_COMPASS" }, + { RG_ICE_CAVERN_COMPASS, "ITEM_COMPASS" }, + { RG_FOREST_TEMPLE_BOSS_KEY, "ITEM_KEY_BOSS" }, + { RG_FIRE_TEMPLE_BOSS_KEY, "ITEM_KEY_BOSS" }, + { RG_WATER_TEMPLE_BOSS_KEY, "ITEM_KEY_BOSS" }, + { RG_SPIRIT_TEMPLE_BOSS_KEY, "ITEM_KEY_BOSS" }, + { RG_SHADOW_TEMPLE_BOSS_KEY, "ITEM_KEY_BOSS" }, + { RG_GANONS_CASTLE_BOSS_KEY, "ITEM_KEY_BOSS" }, + { RG_FOREST_TEMPLE_SMALL_KEY, "ITEM_KEY_SMALL" }, + { RG_FIRE_TEMPLE_SMALL_KEY, "ITEM_KEY_SMALL" }, + { RG_WATER_TEMPLE_SMALL_KEY, "ITEM_KEY_SMALL" }, + { RG_SPIRIT_TEMPLE_SMALL_KEY, "ITEM_KEY_SMALL" }, + { RG_SHADOW_TEMPLE_SMALL_KEY, "ITEM_KEY_SMALL" }, + { RG_BOTTOM_OF_THE_WELL_SMALL_KEY, "ITEM_KEY_SMALL" }, + { RG_GERUDO_TRAINING_GROUNDS_SMALL_KEY, "ITEM_KEY_SMALL" }, + { RG_GERUDO_FORTRESS_SMALL_KEY, "ITEM_KEY_SMALL" }, + { RG_GANONS_CASTLE_SMALL_KEY, "ITEM_KEY_SMALL" }, + { RG_TREASURE_GAME_SMALL_KEY, "ITEM_KEY_SMALL" }, + { RG_KOKIRI_EMERALD, "ITEM_KOKIRI_EMERALD" }, + { RG_GORON_RUBY, "ITEM_GORON_RUBY" }, + { RG_ZORA_SAPPHIRE, "ITEM_ZORA_SAPPHIRE" }, + { RG_FOREST_MEDALLION, "ITEM_MEDALLION_FOREST" }, + { RG_FIRE_MEDALLION, "ITEM_MEDALLION_FIRE" }, + { RG_WATER_MEDALLION, "ITEM_MEDALLION_WATER" }, + { RG_SPIRIT_MEDALLION, "ITEM_MEDALLION_SPIRIT" }, + { RG_SHADOW_MEDALLION, "ITEM_MEDALLION_SHADOW" }, + { RG_LIGHT_MEDALLION, "ITEM_MEDALLION_LIGHT" }, + { RG_RECOVERY_HEART, "ITEM_HEART_GRAYSCALE" }, + { RG_GREEN_RUPEE, "ITEM_RUPEE_GRAYSCALE" }, + { RG_GREG_RUPEE, "ITEM_RUPEE_GRAYSCALE" }, + { RG_BLUE_RUPEE, "ITEM_RUPEE_GRAYSCALE" }, + { RG_RED_RUPEE, "ITEM_RUPEE_GRAYSCALE" }, + { RG_PURPLE_RUPEE, "ITEM_RUPEE_GRAYSCALE" }, + { RG_HUGE_RUPEE, "ITEM_RUPEE_GRAYSCALE" }, + { RG_TREASURE_GAME_GREEN_RUPEE, "ITEM_RUPEE_GRAYSCALE" }, + { RG_PIECE_OF_HEART, "ITEM_HEART_PIECE" }, + { RG_HEART_CONTAINER, "ITEM_HEART_CONTAINER" }, + { RG_ICE_TRAP, "ITEM_ICE_TRAP" }, + { RG_MILK, "ITEM_MILK_BOTTLE"}, + { RG_BOMBS_5, "ITEM_BOMB" }, + { RG_BOMBS_10, "ITEM_BOMB" }, + { RG_BOMBS_20, "ITEM_BOMB" }, + { RG_BUY_BOMBS_525, "ITEM_BOMB" }, + { RG_BUY_BOMBS_535, "ITEM_BOMB" }, + { RG_BUY_BOMBS_10, "ITEM_BOMB" }, + { RG_BUY_BOMBS_20, "ITEM_BOMB" }, + { RG_BUY_BOMBS_30, "ITEM_BOMB" }, + { RG_DEKU_NUTS_5, "ITEM_NUT" }, + { RG_DEKU_NUTS_10, "ITEM_NUT" }, + { RG_BUY_DEKU_NUTS_5, "ITEM_NUT" }, + { RG_BUY_DEKU_NUTS_10, "ITEM_NUT" }, + { RG_BOMBCHU_5, "ITEM_BOMBCHU" }, + { RG_BOMBCHU_10, "ITEM_BOMBCHU" }, + { RG_BOMBCHU_20, "ITEM_BOMBCHU" }, + { RG_BUY_BOMBCHUS_20, "ITEM_BOMBCHU" }, + { RG_ARROWS_5, "ITEM_ARROWS_SMALL" }, + { RG_BUY_ARROWS_10, "ITEM_ARROWS_SMALL" }, + { RG_ARROWS_10, "ITEM_ARROWS_MEDIUM" }, + { RG_BUY_ARROWS_30, "ITEM_ARROWS_MEDIUM" }, + { RG_ARROWS_30, "ITEM_ARROWS_LARGE" }, + { RG_BUY_ARROWS_50, "ITEM_ARROWS_LARGE" }, + { RG_TREASURE_GAME_HEART, "ITEM_HEART_PIECE" }, + { RG_DEKU_SEEDS_30, "ITEM_SEEDS" }, + { RG_BUY_DEKU_SEEDS_30, "ITEM_SEEDS" }, + { RG_BUY_HEART, "ITEM_HEART_GRAYSCALE" }, + { RG_FISHING_POLE, "ITEM_FISHING_POLE" }, + { RG_SOLD_OUT, "ITEM_SOLD_OUT" }, + { RG_TRIFORCE_PIECE, "TRIFORCE_PIECE" }, + { RG_SKELETON_KEY, "ITEM_KEY_SMALL" } +}; + +Rando::Item plandomizerRandoRetrieveItem(RandomizerGet randoGetItem) { + auto randoGetItemEntry = Rando::StaticData::RetrieveItem(randoGetItem); + return randoGetItemEntry; +} + +ImVec4 plandomizerGetItemColor(Rando::Item randoItem) { + itemColor = ImVec4( 1.0f, 1.0f, 1.0f, 1.0f ); + if (randoItem.GetItemType() == ITEMTYPE_SMALLKEY || randoItem.GetItemType() == ITEMTYPE_FORTRESS_SMALLKEY + || randoItem.GetItemType() == ITEMTYPE_BOSSKEY) { + if (randoItem.GetRandomizerGet() == RG_FOREST_TEMPLE_SMALL_KEY || + randoItem.GetRandomizerGet() == RG_FOREST_TEMPLE_KEY_RING) { + itemColor = ImVec4( 0.02f, 0.76f, 0.18f, 1.0f ); + } else if (randoItem.GetRandomizerGet() == RG_FIRE_TEMPLE_SMALL_KEY || + randoItem.GetRandomizerGet() == RG_FIRE_TEMPLE_KEY_RING) { + itemColor = ImVec4( 0.93f, 0.37f, 0.37f, 1.0f ); + } else if (randoItem.GetRandomizerGet() == RG_WATER_TEMPLE_SMALL_KEY || + randoItem.GetRandomizerGet() == RG_WATER_TEMPLE_KEY_RING) { + itemColor = ImVec4( 0.33f, 0.71f, 0.87f, 1.0f ); + } else if (randoItem.GetRandomizerGet() == RG_SPIRIT_TEMPLE_SMALL_KEY || + randoItem.GetRandomizerGet() == RG_SPIRIT_TEMPLE_KEY_RING) { + itemColor = ImVec4( 0.87f, 0.62f, 0.18f, 1.0f ); + } else if (randoItem.GetRandomizerGet() == RG_SHADOW_TEMPLE_SMALL_KEY || + randoItem.GetRandomizerGet() == RG_SHADOW_TEMPLE_KEY_RING) { + itemColor = ImVec4( 0.49f, 0.06f, 0.69f, 1.0f ); + } else if (randoItem.GetRandomizerGet() == RG_BOTTOM_OF_THE_WELL_SMALL_KEY || + randoItem.GetRandomizerGet() == RG_BOTTOM_OF_THE_WELL_KEY_RING) { + itemColor = ImVec4( 0.89f, 0.43f, 1.0f, 1.0f ); + } else if (randoItem.GetRandomizerGet() == RG_GERUDO_TRAINING_GROUNDS_SMALL_KEY || + randoItem.GetRandomizerGet() == RG_GERUDO_TRAINING_GROUNDS_KEY_RING) { + itemColor = ImVec4( 1.0f, 1.0f, 0, 1.0f ); + } else if (randoItem.GetRandomizerGet() == RG_GERUDO_FORTRESS_SMALL_KEY || + randoItem.GetRandomizerGet() == RG_GERUDO_FORTRESS_KEY_RING) { + itemColor = ImVec4( 1.0f, 1.0f, 1.0f, 1.0f ); + } else if (randoItem.GetRandomizerGet() == RG_GANONS_CASTLE_SMALL_KEY || + randoItem.GetRandomizerGet() == RG_GANONS_CASTLE_KEY_RING) { + itemColor = ImVec4( 0.5f, 0.5f, 0.5f, 1.0f ); + } + return itemColor; + } + if (randoItem.GetItemType() == ITEMTYPE_SONG) { + uint32_t questID = Rando::Logic::RandoGetToQuestItem[randoItem.GetRandomizerGet()]; + textureID = Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(songMapping.at((QuestItem)questID).name); + itemColor = songMapping.at((QuestItem)questID).color; + imageSize = ImVec2(24.0f, 32.0f); + imagePadding = 6.0f; + return itemColor; + } + if (randoItem.GetRandomizerGet() >= RG_GREEN_RUPEE && randoItem.GetRandomizerGet() <= RG_HUGE_RUPEE) { + if (randoItem.GetRandomizerGet() == RG_GREG_RUPEE || randoItem.GetRandomizerGet() == RG_GREEN_RUPEE + || randoItem.GetRandomizerGet() == RG_TREASURE_GAME_GREEN_RUPEE) { + itemColor = ImVec4( 0.02f, 0.76f, 0.18f, 1.0f ); + } else if (randoItem.GetRandomizerGet() == RG_BLUE_RUPEE) { + itemColor = ImVec4( 0.33f, 0.71f, 0.87f, 1.0f ); + } else if (randoItem.GetRandomizerGet() == RG_RED_RUPEE) { + itemColor = ImVec4( 0.93f, 0.37f, 0.37f, 1.0f ); + } else if (randoItem.GetRandomizerGet() == RG_PURPLE_RUPEE) { + itemColor = ImVec4( 0.89f, 0.43f, 1.0f, 1.0f ); + } else if (randoItem.GetRandomizerGet() == RG_HUGE_RUPEE) { + itemColor = ImVec4( 1.0f, 1.0f, 0, 1.0f ); + } + return itemColor; + } + + if (randoItem.GetRandomizerGet() >= RG_GOHMA_SOUL && randoItem.GetRandomizerGet() <= RG_GANON_SOUL) { + itemColor = bossSoulMapping.at(randoItem.GetRandomizerGet()); + } + + return itemColor; +} + +std::string plandomizerHintsTooltip() { + std::string hintTootip; + hintTootip = + "The following options are available:\n" + "- Use \\n to create New Lines.\n" + "- Use %g to change the text color to Green,\n" + " - %r for Red, %y for Yellow, and %w for White\n" + " can also be used as color examples."; + + return hintTootip; +} + +std::string extractNumberInParentheses(const std::string& text) { + size_t start = text.find('('); + size_t end = text.find(')'); + + if (start != std::string::npos && end != std::string::npos && start < end) { + return text.substr(start + 1, end - start - 1); + } + return ""; +} + +void PlandomizerPopulateSeedList() { + existingSeedList.clear(); + auto spoilerPath = Ship::Context::GetPathRelativeToAppDirectory("Randomizer"); + + if (std::filesystem::exists(spoilerPath)) { + for (const auto& entry : std::filesystem::directory_iterator(spoilerPath)) { + if (entry.is_regular_file() && entry.path().extension() == ".json") { + existingSeedList.push_back(entry.path().stem().string()); + } + } + } +} + +void PlandomizerItemImageCorrection(Rando::Item randoItem) { + textureID = 0; + imageSize = ImVec2( 32.0f, 32.0f ); + imagePadding = 2.0f; + textureUV0 = ImVec2( 0, 0 ); + textureUV1 = ImVec2( 1, 1 ); + + + itemColor = plandomizerGetItemColor(randoItem); + + if (randoItem.GetItemType() == ITEMTYPE_SMALLKEY || randoItem.GetItemType() == ITEMTYPE_FORTRESS_SMALLKEY) { + textureID = Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("ITEM_KEY_SMALL"); + return; + } + if (randoItem.GetItemType() == ITEMTYPE_BOSSKEY) { + textureID = Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("ITEM_KEY_BOSS"); + return; + } + + for (auto& map : itemImageMap) { + if (map.first == randoItem.GetRandomizerGet()) { + textureID = Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(map.second.c_str()); + if (map.second.find("ITEM_ARROWS") != std::string::npos) { + textureUV0 = ImVec2( 0, 1 ); + textureUV1 = ImVec2( 1, 0 ); + } + if (map.second == "ITEM_TRIFORCE" || map.first == RG_SKELETON_KEY) { + textureUV0 = ImVec2( 1, 1 ); + textureUV1 = ImVec2( 0, 0 ); + } + break; + } + } + + if (randoItem.GetRandomizerGet() >= RG_GOHMA_SOUL && randoItem.GetRandomizerGet() <= RG_GANON_SOUL) { + textureID = Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("BOSS_SOUL"); + } + + if (randoItem.GetRandomizerGet() >= RG_OCARINA_A_BUTTON && randoItem.GetRandomizerGet() <= RG_OCARINA_C_RIGHT_BUTTON) { + textureID = Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("ITEM_OCARINA_TIME"); + } + + if (textureID == 0) { + textureID = Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(itemMapping[randoItem.GetGIEntry()->itemId].name); + } +} + +void PlandomizerRandomizeHint(int32_t status, int32_t index) { + if (status == HINT_SINGLE) { + plandoHintData[index].hintText = Rando::StaticData::hintTextTable[GetRandomJunkHint()].GetHintMessage().GetForCurrentLanguage(MF_ENCODE); + } else { + for (auto& hint : plandoHintData) { + hint.hintText = Rando::StaticData::hintTextTable[GetRandomJunkHint()].GetHintMessage().GetForCurrentLanguage(MF_ENCODE); + } + } +} + +void PlandomizerRemoveAllHints() { + if (plandoHintData.size() > 0) { + for (auto& remove : plandoHintData) { + remove.hintText.clear(); + } + } +} + +void PlandomizerSortDrawnItems() { + std::sort(drawnItemsList.begin(), drawnItemsList.end(), + [](const auto& a, const auto& b) { + auto typeA = a.first.GetItemType(); + auto typeB = b.first.GetItemType(); + if (typeA != typeB){ + return typeA < typeB; + } + return a.first.GetRandomizerGet() < b.first.GetRandomizerGet(); + }); +} + +void PlandomizerRemoveAllItems() { + if (drawnItemsList.size() == 1) { + drawnItemsList.clear(); + } + for (auto& remove : plandoLogData) { + if (std::find(infiniteItemList.begin(), infiniteItemList.end(), remove.checkRewardItem.GetRandomizerGet()) == infiniteItemList.end()) { + bool itemExists = false; + for (auto& itemToCheck : drawnItemsList) { + if (itemToCheck.first.GetRandomizerGet() == remove.checkRewardItem.GetRandomizerGet()) { + itemToCheck.second += 1; + itemExists = true; + break; + } + } + if (!itemExists) { + drawnItemsList.push_back(std::make_pair(remove.checkRewardItem, 1)); + } + } + remove.checkRewardItem = plandomizerRandoRetrieveItem(RG_SOLD_OUT); + } + PlandomizerSortDrawnItems(); +} + +void PlandomizerRemoveFromItemList(Rando::Item randoItem) { + if (std::find(infiniteItemList.begin(), infiniteItemList.end(), randoItem.GetRandomizerGet()) == infiniteItemList.end()) { + uint32_t index = 0; + for (auto& itemToCheck : drawnItemsList) { + if (itemToCheck.first.GetRandomizerGet() == randoItem.GetRandomizerGet()) { + if (shouldRemove) { + drawnItemsList.erase(drawnItemsList.begin() + index); + break; + } else { + itemToCheck.second -= 1; + } + } + index++; + } + shouldRemove = false; + } + PlandomizerSortDrawnItems(); +} + +void PlandomizerAddToItemList(Rando::Item randoItem) { + if (std::find(infiniteItemList.begin(), infiniteItemList.end(), randoItem.GetRandomizerGet()) == infiniteItemList.end()) { + bool itemExists = false; + for (auto& itemToCheck : drawnItemsList) { + if (itemToCheck.first.GetRandomizerGet() == randoItem.GetRandomizerGet()) { + itemToCheck.second += 1; + itemExists = true; + break; + } + } + + if (!itemExists) { + drawnItemsList.push_back(std::make_pair(randoItem, 1)); + } + } + PlandomizerSortDrawnItems(); +} + +void PlandomizerSaveSpoilerLog() { + nlohmann::json spoilerSave; + std::string filename = lastLoadedSpoiler; + + std::ifstream inputFile(filename); + if (inputFile.is_open()) { + inputFile >> spoilerSave; + inputFile.close(); + } + + spoilerSave["file_hash"] = { + plandoHash[0], plandoHash[1], plandoHash[2], plandoHash[3], plandoHash[4] + }; + + for (auto& import : plandoHintData) { + spoilerSave["Gossip Stone Hints"][import.hintName] = { + { "type", import.hintType.c_str() }, + { "message", import.hintText.c_str() } + }; + } + + for (auto& import : plandoLogData) { + if (import.checkRewardItem.GetRandomizerGet() == RG_ICE_TRAP) { + spoilerSave["locations"][import.checkName] = { + { "item", import.checkRewardItem.GetName().english }, + { "model", import.iceTrapModel.GetName().english }, + { "trickName", import.iceTrapName.c_str() } + }; + if (import.shopPrice > -1) { + spoilerSave["locations"][import.checkName]["price"] = import.shopPrice; + } + } else if (import.shopPrice > -1) { + spoilerSave["locations"][import.checkName] = { + { "item", import.checkRewardItem.GetName().english }, + { "price", import.shopPrice } + }; + } else { + spoilerSave["locations"][import.checkName] = import.checkRewardItem.GetName().english; + } + } + + std::ofstream outputFile(filename); + if (outputFile.is_open()) { + outputFile << spoilerSave.dump(4); + outputFile.close(); + } +} + +void PlandomizerLoadSpoilerLog(std::string logFile) { + spoilerHash.clear(); + plandoHash.clear(); + spoilerLogData.clear(); + plandoLogData.clear(); + spoilerHintData.clear(); + plandoHintData.clear(); + drawnItemsList.clear(); + + nlohmann::json spoilerLogInput; + auto spoilerPath = Ship::Context::GetPathRelativeToAppDirectory("Randomizer"); + std::string spoilerStr = spoilerPath + "/" + logFile.c_str() + ".json"; + + if (!std::filesystem::exists(spoilerStr)) { + return; + } + + std::ifstream file(spoilerStr); + + if (file.is_open()) { + try { + file >> spoilerLogInput; + file.close(); + + if (spoilerLogInput.contains("file_hash")) { + auto hash = spoilerLogInput["file_hash"]; + for (auto& load : hash) { + spoilerHash.push_back(load); + plandoHash.push_back(load); + } + } + + if (spoilerLogInput.contains("Gossip Stone Hints")) { + auto hints = spoilerLogInput["Gossip Stone Hints"]; + for (auto& [key, value] : hints.items()) { + SpoilerHintObject hintObject; + hintObject.hintName = key.c_str(); + hintObject.hintType = "Hardcoded Message"; + hintObject.hintText = value["message"]; + + spoilerHintData.push_back(hintObject); + plandoHintData.push_back(hintObject); + } + } + + if (spoilerLogInput.contains("locations")) { + auto locations = spoilerLogInput["locations"]; + for (auto& [key, value] : locations.items()) { + if (key == "Ganon" || key == "Completed Triforce") { + continue; + } + SpoilerCheckObject checkObject; + checkObject.checkName = key; + auto type = value; + if (value.is_object()) { + checkObject.checkRewardItem = plandomizerRandoRetrieveItem(Rando::StaticData::itemNameToEnum[value["item"]]); + if (value["price"].is_number()) { + checkObject.shopPrice = value["price"]; + } else { + checkObject.shopPrice = -1; + } + if (checkObject.checkRewardItem.GetRandomizerGet() == RG_ICE_TRAP) { + checkObject.iceTrapModel = plandomizerRandoRetrieveItem(Rando::StaticData::itemNameToEnum[value["model"]]); + checkObject.iceTrapName = value["trickName"]; + } + } else { + checkObject.checkRewardItem = plandomizerRandoRetrieveItem(Rando::StaticData::itemNameToEnum[value.get()]); + checkObject.shopPrice = -1; + if (checkObject.shopPrice == -1 + && checkObject.checkRewardItem.GetName().english.find("Buy") != std::string::npos) { + checkObject.shopPrice = checkObject.checkRewardItem.GetPrice(); + } + } + spoilerLogData.push_back(checkObject); + plandoLogData.push_back(checkObject); + PlandomizerAddToItemList(plandomizerRandoRetrieveItem(RG_SOLD_OUT)); + } + } + } catch (nlohmann::json::parse_error& e) { + Notification::Emit({ .message = "Invalid Spoiler Log Format", .remainingTime = 10.0f }); + } + } + lastLoadedSpoiler = spoilerStr; +} + +void PlandomizerOverlayText(std::pair drawObject ) { + // Overlay the item count text on the existing button + ImVec2 imageMin = ImGui::GetItemRectMin(); + ImVec2 imageMax = ImGui::GetItemRectMax(); + ImVec2 textPos = ImVec2(imageMax.x - ImGui::CalcTextSize(std::to_string(drawObject.second).c_str()).x - 2, + imageMax.y - ImGui::CalcTextSize(std::to_string(drawObject.second).c_str()).y - 2); + + ImGui::SetCursorScreenPos(textPos); + ImGui::Text(std::to_string(drawObject.second).c_str()); + + // Overlay item info + if (drawObject.first.GetRandomizerGet() >= RG_PROGRESSIVE_HOOKSHOT && + drawObject.first.GetRandomizerGet() <= RG_PROGRESSIVE_GORONSWORD) { + textPos = ImVec2(imageMin.x + 2, imageMin.y + 2); + + ImGui::SetCursorScreenPos(textPos); + ImGui::Text("+"); + } + if (extractNumberInParentheses(drawObject.first.GetName().english.c_str()) != "" && + extractNumberInParentheses(drawObject.first.GetName().english.c_str()) != "WINNER" && + extractNumberInParentheses(drawObject.first.GetName().english.c_str()) != "LOSER") { + textPos = ImVec2(imageMin.x + 2, imageMin.y + 2); + + ImGui::SetCursorScreenPos(textPos); + std::string overlayText = "+"; + overlayText += extractNumberInParentheses(drawObject.first.GetName().english.c_str()); + ImGui::Text(overlayText.c_str()); + } + if (drawObject.first.GetRandomizerGet() >= RG_FOREST_TEMPLE_BOSS_KEY && + drawObject.first.GetRandomizerGet() <= RG_GANONS_CASTLE_BOSS_KEY) { + textPos = ImVec2(imageMin.x + 1, imageMin.y + 1); + ImGui::SetCursorScreenPos(textPos); + shortName = ""; + for (auto& name : bossKeyShortNames) { + if (name.first == drawObject.first.GetRandomizerGet()) { + shortName = name.second; + break; + } + } + ImGui::Text(shortName.c_str()); + } + if (drawObject.first.GetRandomizerGet() >= RG_OCARINA_A_BUTTON && + drawObject.first.GetRandomizerGet() <= RG_OCARINA_C_RIGHT_BUTTON) { + textPos = ImVec2(imageMin.x + 1, imageMin.y + 1); + ImGui::SetCursorScreenPos(textPos); + shortName = ""; + for (auto& name : ocarinaButtonNames) { + if (name.first == drawObject.first.GetRandomizerGet()) { + shortName = name.second; + break; + } + } + ImGui::Text(shortName.c_str()); + } +} + +void PlandomizerDrawItemPopup(uint32_t index) { + if (shouldPopup && ImGui::BeginPopup("ItemList")) { + ImGui::SeparatorText("Resources"); + ImGui::BeginTable("Infinite Item Table", 7); + for (auto& item : infiniteItemList) { + ImGui::PushID(item); + ImGui::TableNextColumn(); + PlandomizerItemImageCorrection(plandomizerRandoRetrieveItem(item)); + if (ImGui::ImageButton(textureID, + imageSize, textureUV0, textureUV1, imagePadding, ImVec4(0, 0, 0, 0), itemColor)) { + if (std::find(infiniteItemList.begin(), infiniteItemList.end(), plandoLogData[index].checkRewardItem.GetRandomizerGet()) == infiniteItemList.end()) { + PlandomizerAddToItemList(plandoLogData[index].checkRewardItem); + } + plandoLogData[index].checkRewardItem = plandomizerRandoRetrieveItem(item); + ImGui::CloseCurrentPopup(); + } + UIWidgets::Tooltip(plandomizerRandoRetrieveItem(item).GetName().english.c_str()); + PlandomizerOverlayText(std::make_pair(plandomizerRandoRetrieveItem(item), 1)); + ImGui::PopID(); + } + + + ImGui::EndTable(); + ImGui::SeparatorText("Spoiler Log Rewards"); + ImGui::BeginTable("Item Button Table", 8); + uint32_t itemIndex = 0; + + bool isClicked = false; + for (auto& drawSlots : drawnItemsList) { + ImGui::TableNextColumn(); + ImGui::BeginGroup(); + ImGui::PushID(itemIndex); + auto itemToDraw = drawSlots.first; + PlandomizerItemImageCorrection(drawSlots.first); + if (ImGui::ImageButton(textureID, + imageSize, textureUV0, textureUV1, imagePadding, ImVec4(0, 0, 0, 0), itemColor)) { + if (itemToDraw.GetRandomizerGet() >= RG_PROGRESSIVE_HOOKSHOT && + itemToDraw.GetRandomizerGet() <= RG_PROGRESSIVE_GORONSWORD) { + plandoLogData[index].checkRewardItem = drawSlots.first; + } else { + plandoLogData[index].checkRewardItem = itemToDraw; + } + temporaryItemIndex = itemIndex; + if (drawSlots.second == 1) { + shouldRemove = true; + } + isClicked = true; + ImGui::CloseCurrentPopup(); + } + if (!isClicked) { + UIWidgets::Tooltip(drawSlots.first.GetName().english.c_str()); + } + ImGui::PopID(); + + PlandomizerOverlayText(drawSlots); + + ImGui::EndGroup(); + itemIndex++; + } + if (isClicked) { + PlandomizerRemoveFromItemList(drawnItemsList[temporaryItemIndex].first); + PlandomizerAddToItemList(temporaryItem); + } + ImGui::EndTable(); + ImGui::EndPopup(); + } +} + +void PlandomizerDrawIceTrapPopUp(uint32_t index) { + if (shouldTrapPopup && ImGui::BeginPopup("TrapList")) { + ImGui::BeginTable("Ice Trap Table", 8); + for (auto& items : itemImageMap) { + if (items.first == RG_ICE_TRAP) { + continue; + } + ImGui::TableNextColumn(); + ImGui::PushID(items.first); + PlandomizerItemImageCorrection(Rando::StaticData::RetrieveItem(items.first)); + if (ImGui::ImageButton(textureID, imageSize, textureUV0, textureUV1, imagePadding, ImVec4(0, 0, 0, 0), itemColor)) { + plandoLogData[index].iceTrapModel = Rando::StaticData::RetrieveItem(items.first); + ImGui::CloseCurrentPopup(); + }; + UIWidgets::Tooltip(Rando::StaticData::RetrieveItem(items.first).GetName().english.c_str()); + + auto itemObject = Rando::StaticData::RetrieveItem(items.first); + PlandomizerOverlayText(std::make_pair(itemObject, 1)); + + ImGui::PopID(); + } + ImGui::EndTable(); + ImGui::EndPopup(); + } +} + +void PlandomizerDrawItemSlots(uint32_t index) { + ImGui::PushID(index); + PlandomizerItemImageCorrection(plandoLogData[index].checkRewardItem); + if (ImGui::ImageButton(textureID, imageSize, textureUV0, textureUV1, imagePadding, ImVec4(0, 0, 0, 0), itemColor)) { + shouldPopup = true; + temporaryItem = plandoLogData[index].checkRewardItem; + ImGui::OpenPopup("ItemList"); + }; + UIWidgets::Tooltip(plandoLogData[index].checkRewardItem.GetName().english.c_str()); + PlandomizerOverlayText(std::make_pair(plandoLogData[index].checkRewardItem, 1)); + PlandomizerDrawItemPopup(index); + ImGui::PopID(); +} + +void PlandomizerDrawShopSlider(uint32_t index) { + ImGui::PushID(index); + ImGui::Text("Price:"); + ImGui::SameLine(); + ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x - 20.0f); + ImGui::SliderInt("", &plandoLogData[index].shopPrice, 0, 999, "%d Rupees"); + ImGui::PopItemWidth(); + ImGui::PopID(); +} + +void PlandomizerDrawIceTrapSetup(uint32_t index) { + std::string trapTextInput = plandoLogData[index].iceTrapName.c_str(); + + ImGui::PushID(index); + ImGui::BeginTable("IceTrap", 2, ImGuiTableFlags_BordersOuter | ImGuiTableFlags_BordersInner); + ImGui::TableSetupColumn("Model", ImGuiTableColumnFlags_WidthFixed, 36.0f); + ImGui::TableSetupColumn("Trap Options"); + ImGui::TableHeadersRow(); + + ImGui::TableNextColumn(); + PlandomizerItemImageCorrection(plandoLogData[index].iceTrapModel); + if (ImGui::ImageButton(textureID, imageSize, textureUV0, textureUV1, imagePadding, ImVec4(0, 0, 0, 0), itemColor)) { + shouldTrapPopup = true; + ImGui::OpenPopup("TrapList"); + }; + UIWidgets::Tooltip(plandoLogData[index].iceTrapModel.GetName().english.c_str()); + PlandomizerDrawIceTrapPopUp(index); + ImGui::SameLine(); + ImGui::TableNextColumn(); + ImGui::Text("Name: "); + ImGui::SameLine(); + if (plandoLogData[index].iceTrapModel.GetRandomizerGet() != RG_NONE && + plandoLogData[index].iceTrapModel.GetRandomizerGet() != RG_SOLD_OUT) { + if (ImGui::Button(randomizeButton.c_str())) { + plandoLogData[index].iceTrapName = + GetIceTrapName(plandoLogData[index].iceTrapModel.GetRandomizerGet()).GetForLanguage(CVarGetInteger(CVAR_SETTING("Languages"), 0)).c_str(); + } + ImGui::SameLine(); + } + if (UIWidgets::InputString("##TrapName", &trapTextInput)) { + plandoLogData[index].iceTrapName = trapTextInput.c_str(); + } + + if (plandoLogData[index].shopPrice > -1) { + PlandomizerDrawShopSlider(index); + } + ImGui::EndTable(); + + ImGui::PopID(); +} + +void PlandomizerDrawOptions() { + ImGui::BeginTable("LoadSpoiler", 2); + ImGui::TableNextColumn(); + ImGui::SeparatorText("Load/Save Spoiler Log"); + PlandomizerPopulateSeedList(); + static int32_t selectedList = 0; + if (existingSeedList.size() != 0) { + if (ImGui::BeginCombo("##JsonFiles", existingSeedList[selectedList].c_str())) { + for (size_t i = 0; i < existingSeedList.size(); i++) { + bool isSelected = (selectedList == i); + if (ImGui::Selectable(existingSeedList[i].c_str(), isSelected)) { + selectedList = i; + } + if (isSelected) { + ImGui::SetItemDefaultFocus(); + } + } + ImGui::EndCombo(); + } + } else { + ImGui::Text("No Spoiler Logs found."); + } + ImGui::BeginDisabled(existingSeedList.empty()); + if (ImGui::Button("Load")) { + logTemp = existingSeedList[selectedList].c_str(); + PlandomizerLoadSpoilerLog(logTemp.c_str()); + } + ImGui::EndDisabled(); + ImGui::BeginDisabled(spoilerLogData.empty()); + ImGui::SameLine(); + if (ImGui::Button("Save")) { + PlandomizerSaveSpoilerLog(); + } + ImGui::EndDisabled(); + + ImGui::TableNextColumn(); + ImGui::SeparatorText("Current Seed Hash"); + ImGui::SetCursorPosX(ImGui::GetCursorPosX() + (ImGui::GetContentRegionAvail().x * 0.5f) - (34.0f * 5.0f)); + if (spoilerLogData.size() > 0) { + ImGui::BeginTable("HashIcons", 5); + ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(1.0f, 1.0f, 1.0f, 0.0f)); + ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(1.0f, 1.0f, 1.0f, 0.2f)); + ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(1.0f, 1.0f, 1.0f, 0.1f)); + for (int i = 0; i < 5; i++) { + ImGui::TableSetupColumn("Icon", ImGuiTableColumnFlags_WidthFixed, 34.0f); + } + ImGui::TableNextColumn(); + + int32_t index = 0; + for (auto& hash : plandoHash) { + ImGui::PushID(index); + textureID = Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(gSeedTextures[hash].tex); + if (ImGui::ImageButton(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("HASH_ARROW_UP"), + ImVec2(35.0f, 18.0f), ImVec2(1, 1), ImVec2(0, 0), 2.0f, ImVec4(0, 0, 0, 0), ImVec4(1, 1, 1, 1))) { + if (hash + 1 >= gSeedTextures.size()) { + hash = 0; + } else { + hash++; + } + } + ImGui::Image(textureID, ImVec2(35.0f, 35.0f)); + if (ImGui::ImageButton(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("HASH_ARROW_DWN"), + ImVec2(35.0f, 18.0f), ImVec2(0, 0), ImVec2(1, 1), 2.0f, ImVec4(0, 0, 0, 0), ImVec4(1, 1, 1, 1))) { + if (hash == 0) { + hash = gSeedTextures.size() - 1; + } else { + hash--; + } + } + if (index != spoilerHash.size() - 1) { + ImGui::TableNextColumn(); + } + ImGui::PopID(); + index++; + } + ImGui::PopStyleColor(3); + ImGui::EndTable(); + } else { + ImGui::Text("No Spoiler Log Loaded"); + } + ImGui::EndTable(); + + ImGui::SeparatorText("Options"); + if (plandoLogData.size() == 0) { + ImGui::Text("Please Load Spoiler Data..."); + return; + } + + if (getTabID == TAB_HINTS) { + if (ImGui::Button("Clear All Hints")) { + PlandomizerRemoveAllHints(); + } + ImGui::SameLine(); + if (ImGui::Button("Randomize All Hints")) { + PlandomizerRandomizeHint(HINT_ALL, 0); + } + } + if (getTabID == TAB_LOCATIONS) { + if (plandoLogData.size() > 0) { + const char* comboLabel = rcAreaNames[selectedArea].c_str(); + if (selectedArea == RCAREA_INVALID) { + comboLabel = "All"; + } + ImGui::Text("Filter by Area:"); + ImGui::SameLine(); + ImGui::PushItemWidth(300.0f); + if (ImGui::BeginCombo("##AreaFilter", comboLabel)) { + for (const auto& [area, name] : rcAreaNames) { + bool isSelected = (selectedArea == area); + + const char* displayName = name.c_str(); + if (area == RCAREA_INVALID) { + displayName = "All"; + } + if (ImGui::Selectable(displayName, isSelected)) { + selectedArea = area; + } + if (isSelected) { + ImGui::SetItemDefaultFocus(); + } + } + ImGui::EndCombo(); + } + ImGui::PopItemWidth(); + + ImGui::SameLine(); + if (ImGui::Button("Empty All Rewards")) { + PlandomizerRemoveAllItems(); + } + } + } +} + +void PlandomizerDrawHintsWindow() { + uint32_t index = 0; + std::string hintInputText; + + ImGui::BeginChild("Hints"); + ImGui::BeginTable("Hints Window", 1, ImGuiTableFlags_BordersInnerV | ImGuiTableFlags_ScrollY); + ImGui::TableSetupColumn("Hint Entries"); + ImGui::TableSetupScrollFreeze(0, 1); + ImGui::TableHeadersRow(); + + for (auto& hintData : spoilerHintData) { + ImGui::PushID(index); + ImGui::TableNextColumn(); + ImGui::SeparatorText(hintData.hintName.c_str()); + ImGui::Text("Current Hint: "); + ImGui::SameLine(); + ImGui::TextWrapped(hintData.hintText.c_str()); + + if (spoilerHintData.size() > 0) { + hintInputText = plandoHintData[index].hintText.c_str(); + } + ImGui::Text("New Hint: "); + ImGui::SameLine(); + if (ImGui::Button(randomizeButton.c_str())) { + PlandomizerRandomizeHint(HINT_SINGLE, index); + } + UIWidgets::Tooltip("Randomize Hint"); + ImGui::SameLine(); + ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x - 10); + if (UIWidgets::InputString("##HintMessage", &hintInputText)) { + plandoHintData[index].hintText = hintInputText.c_str(); + } + UIWidgets::Tooltip(plandomizerHintsTooltip().c_str()); + index++; + ImGui::PopID(); + } + + ImGui::EndTable(); + ImGui::EndChild(); +} + +void PlandomizerDrawLocationsWindow(RandomizerCheckArea rcArea) { + uint32_t index = 0; + ImGui::BeginChild("Locations"); + ImGui::BeginTable("Locations Window", 4, ImGuiTableFlags_BordersInnerV | ImGuiTableFlags_ScrollY); + ImGui::TableSetupColumn("Spoiler Log Check Name", ImGuiTableColumnFlags_WidthFixed, 250.0f); + ImGui::TableSetupColumn("Spoiler Log Reward", ImGuiTableColumnFlags_WidthFixed, 190.0f); + ImGui::TableSetupColumn("New Reward", ImGuiTableColumnFlags_WidthFixed | ImGuiTableColumnFlags_NoHeaderLabel, 34.0f); + ImGui::TableSetupColumn("Additional Options"); + ImGui::TableSetupScrollFreeze(0, 1); + ImGui::TableHeadersRow(); + ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(1.0f, 1.0f, 1.0f, 0.0f)); + ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(1.0f, 1.0f, 1.0f, 0.2f)); + ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(1.0f, 1.0f, 1.0f, 0.1f)); + + for (auto& spoilerData : spoilerLogData) { + auto checkID = Rando::StaticData::locationNameToEnum[spoilerData.checkName]; + auto randoArea = Rando::StaticData::GetLocation(checkID)->GetArea(); + if (rcArea == RCAREA_INVALID || rcArea == randoArea) { + ImGui::TableNextColumn(); + ImGui::TextWrapped(spoilerData.checkName.c_str()); + ImGui::TableNextColumn(); + ImGui::TextWrapped(spoilerData.checkRewardItem.GetName().english.c_str()); + ImGui::TableNextColumn(); + PlandomizerDrawItemSlots(index); + if (plandoLogData[index].checkRewardItem.GetRandomizerGet() == RG_ICE_TRAP) { + ImGui::TableNextColumn(); + PlandomizerDrawIceTrapSetup(index); + } else if (spoilerData.shopPrice != -1) { + ImGui::TableNextColumn(); + ImGui::BeginTable("Shops", 1, ImGuiTableFlags_BordersOuter | ImGuiTableFlags_BordersInner); + ImGui::TableSetupColumn("Shop Price"); + ImGui::TableHeadersRow(); + ImGui::TableNextColumn(); + PlandomizerDrawShopSlider(index); + ImGui::EndTable(); + } else { + ImGui::TableNextColumn(); + } + } + index++; + } + ImGui::PopStyleColor(3); + ImGui::EndTable(); + ImGui::EndChild(); +} + +void PlandomizerDrawSpoilerTable() { + ImGui::BeginChild("Main"); + if (ImGui::BeginTabBar("Check Tabs")) { + if (ImGui::BeginTabItem("Gossip Stones")) { + getTabID = TAB_HINTS; + PlandomizerDrawHintsWindow(); + ImGui::EndTabItem(); + } + if (ImGui::BeginTabItem("Locations")) { + getTabID = TAB_LOCATIONS; + PlandomizerDrawLocationsWindow(selectedArea); + ImGui::EndTabItem(); + } + } + ImGui::EndTabBar(); + ImGui::EndChild(); +} + +void PlandomizerWindow::DrawElement() { + PlandomizerDrawOptions(); + UIWidgets::PaddedSeparator(); + PlandomizerDrawSpoilerTable(); +} + +void PlandomizerWindow::InitElement() { + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture("ITEM_RUPEE_GRAYSCALE", gRupeeCounterIconTex, ImVec4(1, 1, 1, 1)); + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture("ITEM_HEART_GRAYSCALE", gHeartFullTex, ImVec4(0.87f, 0.10f, 0.10f, 1)); + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture("ITEM_SEEDS", gItemIconDekuSeedsTex, ImVec4( 1, 1, 1, 1 )); + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture("ITEM_ARROWS_SMALL", gDropArrows1Tex, ImVec4( 1, 1, 1, 1 )); + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture("ITEM_ARROWS_MEDIUM", gDropArrows2Tex, ImVec4( 1, 1, 1, 1 )); + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture("ITEM_ARROWS_LARGE", gDropArrows3Tex, ImVec4( 1, 1, 1, 1 )); + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture("ITEM_ICE_TRAP", gMagicArrowEquipEffectTex, ImVec4( 1, 1, 1, 1 )); + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture("HASH_ARROW_UP", gEmptyCDownArrowTex, ImVec4( 1, 1, 1, 1 )); + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture("HASH_ARROW_DWN", gEmptyCDownArrowTex, ImVec4( 1, 1, 1, 1 )); + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture("BOSS_SOUL", gBossSoulTex, ImVec4(1, 1, 1, 1)); + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture("TRIFORCE_PIECE", gTriforcePieceTex, ImVec4(1, 1, 1, 1)); +} diff --git a/soh/soh/Enhancements/randomizer/Plandomizer.h b/soh/soh/Enhancements/randomizer/Plandomizer.h new file mode 100644 index 000000000..d337e4da6 --- /dev/null +++ b/soh/soh/Enhancements/randomizer/Plandomizer.h @@ -0,0 +1,52 @@ +#pragma once +#ifndef PLANDOMIZER_H +#define PLANDOMIZER_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} +#endif + +#endif // PLANDOMIZER_H + +#include +#include "soh/Enhancements/randomizer/item.h" + +#ifdef __cplusplus +class PlandomizerWindow : public Ship::GuiWindow { + public: + using GuiWindow::GuiWindow; + + void InitElement() override; + void DrawElement() override; + void UpdateElement() override{}; +}; + +typedef struct { + std::string checkName; + Rando::Item checkRewardItem; + int32_t shopPrice; + Rando::Item iceTrapModel; + std::string iceTrapName; +} SpoilerCheckObject; + +typedef struct { + std::string hintName; + std::string hintType; + std::string hintText; +} SpoilerHintObject; + +typedef enum { + TAB_HINTS, + TAB_LOCATIONS +}; + +typedef enum { + HINT_SINGLE, + HINT_ALL, +}; + +#endif \ No newline at end of file diff --git a/soh/soh/Enhancements/randomizer/draw.cpp b/soh/soh/Enhancements/randomizer/draw.cpp index e643acd70..f4eef9b9b 100644 --- a/soh/soh/Enhancements/randomizer/draw.cpp +++ b/soh/soh/Enhancements/randomizer/draw.cpp @@ -5,6 +5,7 @@ #include "functions.h" #include "variables.h" #include "soh/OTRGlobals.h" +#include "soh/cvar_prefixes.h" #include "randomizerTypes.h" #include #include "objects/object_gi_key/object_gi_key.h" diff --git a/soh/soh/Enhancements/randomizer/hook_handlers.cpp b/soh/soh/Enhancements/randomizer/hook_handlers.cpp index 27813cffe..35badbce6 100644 --- a/soh/soh/Enhancements/randomizer/hook_handlers.cpp +++ b/soh/soh/Enhancements/randomizer/hook_handlers.cpp @@ -1,5 +1,6 @@ #include #include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/enhancementTypes.h" #include "soh/Enhancements/custom-message/CustomMessageTypes.h" #include "soh/Enhancements/item-tables/ItemTableManager.h" @@ -10,6 +11,7 @@ #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include "soh/ImGuiUtils.h" #include "soh/Notification/Notification.h" +#include "soh/SaveManager.h" extern "C" { #include "macros.h" @@ -1397,6 +1399,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l } break; } + case VB_FREEZE_ON_SKULL_TOKEN: case VB_TRADE_TIMER_ODD_MUSHROOM: case VB_TRADE_TIMER_EYEDROPS: case VB_TRADE_TIMER_FROG: @@ -1834,7 +1837,7 @@ void RandomizerOnActorInitHandler(void* actorRef) { if ( actor->id == ACTOR_OBJ_OSHIHIKI && LINK_IS_CHILD && - IsGameMasterQuest() && + ResourceMgr_IsGameMasterQuest() && gPlayState->sceneNum == SCENE_SPIRIT_TEMPLE && actor->room == 6 && // Spirit Temple silver block hallway actor->params == 0x9C7 // Silver block that is marked as in the hole ) { @@ -2193,7 +2196,7 @@ void RandomizerRegisterHooks() { onGameFrameUpdateHook = GameInteractor::Instance->RegisterGameHook(RandomizerOnGameFrameUpdateHandler); onSceneSpawnActorsHook = GameInteractor::Instance->RegisterGameHook(RandomizerOnSceneSpawnActorsHandler); onPlayDestroyHook = GameInteractor::Instance->RegisterGameHook(RandomizerOnPlayDestroyHandler); - onPlayDestroyHook = GameInteractor::Instance->RegisterGameHook(RandomizerOnExitGameHandler); + onExitGameHook = GameInteractor::Instance->RegisterGameHook(RandomizerOnExitGameHandler); onKaleidoUpdateHook = GameInteractor::Instance->RegisterGameHook(RandomizerOnKaleidoscopeUpdateHandler); if (RAND_GET_OPTION(RSK_FISHSANITY) != RO_FISHSANITY_OFF) { diff --git a/soh/soh/Enhancements/randomizer/logic.cpp b/soh/soh/Enhancements/randomizer/logic.cpp index 15aaa4487..15271534c 100644 --- a/soh/soh/Enhancements/randomizer/logic.cpp +++ b/soh/soh/Enhancements/randomizer/logic.cpp @@ -1103,10 +1103,10 @@ namespace Rando { bool Logic::CanBuildRainbowBridge(){ return ctx->GetOption(RSK_RAINBOW_BRIDGE).Is(RO_BRIDGE_ALWAYS_OPEN) || (ctx->GetOption(RSK_RAINBOW_BRIDGE).Is(RO_BRIDGE_VANILLA) && HasItem(RG_SHADOW_MEDALLION) && HasItem(RG_SPIRIT_MEDALLION) && CanUse(RG_LIGHT_ARROWS)) || - (ctx->GetOption(RSK_RAINBOW_BRIDGE).Is(RO_BRIDGE_STONES) && StoneCount() + (HasItem(RG_GREG_RUPEE) && ctx->GetOption(RSK_BRIDGE_OPTIONS).Is(RO_BRIDGE_GREG)) >= ctx->GetOption(RSK_RAINBOW_BRIDGE_STONE_COUNT).Value()) || - (ctx->GetOption(RSK_RAINBOW_BRIDGE).Is(RO_BRIDGE_MEDALLIONS) && MedallionCount() + (HasItem(RG_GREG_RUPEE) && ctx->GetOption(RSK_BRIDGE_OPTIONS).Is(RO_BRIDGE_GREG)) >= ctx->GetOption(RSK_RAINBOW_BRIDGE_MEDALLION_COUNT).Value()) || - (ctx->GetOption(RSK_RAINBOW_BRIDGE).Is(RO_BRIDGE_DUNGEON_REWARDS) && StoneCount() + MedallionCount() + (HasItem(RG_GREG_RUPEE) && ctx->GetOption(RSK_BRIDGE_OPTIONS).Is(RO_BRIDGE_GREG)) >= ctx->GetOption(RSK_RAINBOW_BRIDGE_REWARD_COUNT).Value()) || - (ctx->GetOption(RSK_RAINBOW_BRIDGE).Is(RO_BRIDGE_DUNGEONS) && DungeonCount() + (HasItem(RG_GREG_RUPEE) && ctx->GetOption(RSK_BRIDGE_OPTIONS).Is(RO_BRIDGE_GREG)) >= ctx->GetOption(RSK_RAINBOW_BRIDGE_DUNGEON_COUNT).Value()) || + (ctx->GetOption(RSK_RAINBOW_BRIDGE).Is(RO_BRIDGE_STONES) && StoneCount() + (HasItem(RG_GREG_RUPEE) && ctx->GetOption(RSK_BRIDGE_OPTIONS).Is(RO_BRIDGE_GREG_REWARD)) >= ctx->GetOption(RSK_RAINBOW_BRIDGE_STONE_COUNT).Value()) || + (ctx->GetOption(RSK_RAINBOW_BRIDGE).Is(RO_BRIDGE_MEDALLIONS) && MedallionCount() + (HasItem(RG_GREG_RUPEE) && ctx->GetOption(RSK_BRIDGE_OPTIONS).Is(RO_BRIDGE_GREG_REWARD)) >= ctx->GetOption(RSK_RAINBOW_BRIDGE_MEDALLION_COUNT).Value()) || + (ctx->GetOption(RSK_RAINBOW_BRIDGE).Is(RO_BRIDGE_DUNGEON_REWARDS) && StoneCount() + MedallionCount() + (HasItem(RG_GREG_RUPEE) && ctx->GetOption(RSK_BRIDGE_OPTIONS).Is(RO_BRIDGE_GREG_REWARD)) >= ctx->GetOption(RSK_RAINBOW_BRIDGE_REWARD_COUNT).Value()) || + (ctx->GetOption(RSK_RAINBOW_BRIDGE).Is(RO_BRIDGE_DUNGEONS) && DungeonCount() + (HasItem(RG_GREG_RUPEE) && ctx->GetOption(RSK_BRIDGE_OPTIONS).Is(RO_BRIDGE_GREG_REWARD)) >= ctx->GetOption(RSK_RAINBOW_BRIDGE_DUNGEON_COUNT).Value()) || (ctx->GetOption(RSK_RAINBOW_BRIDGE).Is(RO_BRIDGE_TOKENS) && GetGSCount() >= ctx->GetOption(RSK_RAINBOW_BRIDGE_TOKEN_COUNT).Value()) || (ctx->GetOption(RSK_RAINBOW_BRIDGE).Is(RO_BRIDGE_GREG) && HasItem(RG_GREG_RUPEE)); } diff --git a/soh/soh/Enhancements/randomizer/rando_hash.h b/soh/soh/Enhancements/randomizer/rando_hash.h index 76c3ce0a3..3fdcd205e 100644 --- a/soh/soh/Enhancements/randomizer/rando_hash.h +++ b/soh/soh/Enhancements/randomizer/rando_hash.h @@ -10,7 +10,7 @@ #include #include -std::array gSeedTextures = { { +inline std::array gSeedTextures = { { { dgItemIconDekuNutTex, 32, 32, G_IM_FMT_RGBA, G_IM_SIZ_32b, 0 }, { dgItemIconDekuStickTex, 32, 32, G_IM_FMT_RGBA, G_IM_SIZ_32b, 1 }, { dgItemIconBombTex, 32, 32, G_IM_FMT_RGBA, G_IM_SIZ_32b, 2 }, diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index d6a2bdfaa..2255f7b97 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -10,7 +10,9 @@ #include #include "3drando/rando_main.hpp" #include "3drando/random.hpp" -#include "3drando/custom_messages.hpp" +#include "soh/ResourceManagerHelpers.h" +#include "soh/UIWidgets.hpp" +#include "3drando/custom_messages.hpp" #include "../../UIWidgets.hpp" #ifndef IMGUI_DEFINE_MATH_OPERATORS #define IMGUI_DEFINE_MATH_OPERATORS @@ -41,9 +43,6 @@ #include "fishsanity.h" #include "randomizerTypes.h" -extern "C" uint32_t ResourceMgr_IsGameMasterQuest(); -extern "C" uint32_t ResourceMgr_IsSceneMasterQuest(s16 sceneNum); - extern std::map rcAreaNames; using json = nlohmann::json; diff --git a/soh/soh/Enhancements/randomizer/randomizerTypes.h b/soh/soh/Enhancements/randomizer/randomizerTypes.h index 4cda80c37..fe8910c6d 100644 --- a/soh/soh/Enhancements/randomizer/randomizerTypes.h +++ b/soh/soh/Enhancements/randomizer/randomizerTypes.h @@ -2627,6 +2627,35 @@ typedef enum { RHT_JUNK_SG_6, RHT_JUNK_SG_7, RHT_JUNK_SG_8, + RHT_JUNK_CREW_1, + RHT_JUNK_CREW_2, + RHT_JUNK_CREW_3, + RHT_JUNK_CREW_4, + RHT_JUNK_CREW_5, + RHT_JUNK_CREW_6, + RHT_JUNK_CREW_7, + RHT_JUNK_CREW_8, + RHT_JUNK_CREW_9, + RHT_JUNK_CREW_10, + RHT_JUNK_CREW_11, + RHT_JUNK_CREW_12, + RHT_JUNK_CREW_13, + RHT_JUNK_CREW_14, + RHT_JUNK_CREW_15, + RHT_JUNK_CREW_16, + RHT_JUNK_CREW_17, + RHT_JUNK_CREW_18, + RHT_JUNK_CREW_19, + RHT_JUNK_CREW_20, + RHT_JUNK_CREW_21, + RHT_JUNK_CREW_22, + RHT_JUNK_CREW_23, + RHT_JUNK_CREW_24, + RHT_JUNK_CREW_25, + RHT_JUNK_CREW_26, + RHT_JUNK_CREW_27, + RHT_JUNK_CREW_28, + RHT_JUNK_CREW_29, // Locations RHT_LINKS_POCKET, RHT_QUEEN_GOHMA, diff --git a/soh/soh/Enhancements/randomizer/randomizer_check_objects.cpp b/soh/soh/Enhancements/randomizer/randomizer_check_objects.cpp index 4e50edddd..5d3a62b86 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_check_objects.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_check_objects.cpp @@ -6,6 +6,7 @@ #include #include "z64.h" #include "soh/OTRGlobals.h" +#include "soh/cvar_prefixes.h" #include "fishsanity.h" std::map rcAreaNames = { diff --git a/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp index 0d5e6d2ed..2add45f1d 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp @@ -2,9 +2,12 @@ #include "randomizer_entrance_tracker.h" #include "randomizer_item_tracker.h" #include "randomizerTypes.h" +#include "soh/OTRGlobals.h" +#include "soh/cvar_prefixes.h" +#include "soh/SaveManager.h" +#include "soh/ResourceManagerHelpers.h" +#include "soh/UIWidgets.hpp" #include "dungeon.h" -#include "../../OTRGlobals.h" -#include "../../UIWidgets.hpp" #include "3drando/location_access.hpp" #include @@ -24,7 +27,6 @@ extern "C" { #include "macros.h" extern PlayState* gPlayState; } -extern "C" uint32_t ResourceMgr_IsSceneMasterQuest(s16 sceneNum); extern "C" GetItemEntry ItemTable_RetrieveEntry(s16 modIndex, s16 getItemID); extern std::vector dungeonRewardStones; @@ -32,8 +34,6 @@ extern std::vector dungeonRewardMedallions; extern std::vector songItems; extern std::vector equipmentItems; -#define RCO_RAORU { RC_GIFT_FROM_SAGES, RCVORMQ_BOTH, RCTYPE_DUNGEON_REWARD, RCAREA_MARKET, ACTOR_ID_MAX, SCENE_ID_MAX, 0x00, GI_NONE, false, "Gift from Raoru", "Gift from Raoru", true }; - using json = nlohmann::json; namespace CheckTracker { @@ -216,34 +216,6 @@ static ImGuiTextFilter checkSearch; std::array filterAreasHidden = { 0 }; std::array filterChecksHidden = { 0 }; -void SongFromImpa() { - if (IS_RANDO) { - if (OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SKIP_CHILD_ZELDA) == RO_GENERIC_ON && IS_RANDO) { - //if (gSaveContext.checkTrackerData[RC_SONG_FROM_IMPA].status != RCSHOW_SAVED) { - // gSaveContext.checkTrackerData[RC_SONG_FROM_IMPA].status = RCSHOW_SAVED; - //} - } - } -} - -void GiftFromSages() { - if (!IS_RANDO) { - //DefaultCheckData(RC_GIFT_FROM_SAGES); - } -} - -std::vector checks; -// Function for adding Link's Pocket check -void LinksPocket() { - /*if (IS_RANDO) { - if (OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_LINKS_POCKET) != RO_LINKS_POCKET_NOTHING || - OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHUFFLE_DUNGEON_REWARDS) == RO_DUNGEON_REWARDS_END_OF_DUNGEON) { - DefaultCheckData(RC_LINKS_POCKET); - gSaveContext.checkTrackerData[RC_LINKS_POCKET].status = RCSHOW_SAVED; - } - }*/ -} - void TrySetAreas() { if (checksByArea.empty()) { for (int i = RCAREA_KOKIRI_FOREST; i < RCAREA_INVALID; i++) { @@ -507,9 +479,6 @@ void CheckTrackerLoadGame(int32_t fileNum) { showVOrMQ = (OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_MQ_DUNGEON_RANDOM) == RO_MQ_DUNGEONS_RANDOM_NUMBER || (OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_MQ_DUNGEON_RANDOM) == RO_MQ_DUNGEONS_SET_NUMBER && OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_MQ_DUNGEON_COUNT) < 12)); - LinksPocket(); - SongFromImpa(); - GiftFromSages(); initialized = true; UpdateAllOrdering(); UpdateInventoryChecks(); @@ -1254,7 +1223,6 @@ bool IsCheckShuffled(RandomizerCheck rc) { (loc->GetRCType() != RCTYPE_SHOP || (showShops && OTRGlobals::Instance->gRandomizer->IdentifyShopItem(loc->GetScene(), loc->GetActorParams() + 1).enGirlAShopItem == 50)) && (rc != RC_TRIFORCE_COMPLETED || !hideTriforceCompleted) && - (rc != RC_GIFT_FROM_SAGES || !IS_RANDO) && (loc->GetRCType() != RCTYPE_SCRUB || showScrubs || (showMajorScrubs && (rc == RC_LW_DEKU_SCRUB_NEAR_BRIDGE || // The 3 scrubs that are always randomized diff --git a/soh/soh/Enhancements/randomizer/randomizer_entrance.c b/soh/soh/Enhancements/randomizer/randomizer_entrance.c index 5c0f8971f..8f4a1668c 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_entrance.c +++ b/soh/soh/Enhancements/randomizer/randomizer_entrance.c @@ -9,6 +9,8 @@ #include "randomizer_entrance.h" #include "randomizer_grotto.h" +#include "soh/OTRGlobals.h" +#include "soh/SaveManager.h" #include #include "global.h" @@ -159,7 +161,7 @@ void Entrance_Init(void) { } // Initialize all boss room save/death warps with their vanilla dungeon entryway - for (s16 i = 1; i < SHUFFLEABLE_BOSS_COUNT; i++) { + for (s16 i = 0; i < SHUFFLEABLE_BOSS_COUNT; i++) { bossSceneSaveDeathWarps[i] = dungeons[i].entryway; } @@ -183,7 +185,7 @@ void Entrance_Init(void) { // Search for boss room overrides and look for the matching save/death warp value to use // If the boss room is in a dungeon, use the dungeons entryway as the save warp // Otherwise use the "exit" value for the entrance that lead to the boss room - for (int j = 0; j <= SHUFFLEABLE_BOSS_COUNT; j++) { + for (int j = 0; j < SHUFFLEABLE_BOSS_COUNT; j++) { if (overrideIndex == dungeons[j].bossDoor) { bossScene = dungeons[j].bossScene; } diff --git a/soh/soh/Enhancements/randomizer/randomizer_entrance_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_entrance_tracker.cpp index 2fce8ae79..3db2cd1ec 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_entrance_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_entrance_tracker.cpp @@ -1,5 +1,6 @@ #include "randomizer_entrance_tracker.h" #include "soh/OTRGlobals.h" +#include "soh/cvar_prefixes.h" #include "soh/UIWidgets.hpp" #include diff --git a/soh/soh/Enhancements/randomizer/randomizer_grotto.c b/soh/soh/Enhancements/randomizer/randomizer_grotto.c index cb8eacb1a..f9471a2ba 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_grotto.c +++ b/soh/soh/Enhancements/randomizer/randomizer_grotto.c @@ -4,6 +4,7 @@ */ #include "randomizer_grotto.h" +#include "soh/OTRGlobals.h" #include "global.h" @@ -272,7 +273,7 @@ void Grotto_OverrideActorEntrance(Actor* thisx) { void Grotto_ForceGrottoReturnOnSpecialEntrance(void) { if (lastEntranceType == GROTTO_RETURN && (Randomizer_GetSettingValue(RSK_SHUFFLE_GROTTO_ENTRANCES) || Randomizer_GetSettingValue(RSK_SHUFFLE_OVERWORLD_SPAWNS) || Randomizer_GetSettingValue(RSK_SHUFFLE_WARP_SONGS))) { gSaveContext.respawnFlag = 2; - gSaveContext.respawn[RESPAWN_MODE_RETURN].playerParams = 0x4FF; + gSaveContext.respawn[RESPAWN_MODE_RETURN].playerParams = 0x04FF; gSaveContext.respawn[RESPAWN_MODE_RETURN].pos = grottoReturnTable[grottoId].pos; // Clear current temp flags gSaveContext.respawn[RESPAWN_MODE_RETURN].tempSwchFlags = 0; @@ -307,7 +308,7 @@ void Grotto_ForceRegularVoidOut(void) { // so that Sun's Song and Game Over will behave correctly void Grotto_SetupReturnInfoOnFWReturn(void) { if (Randomizer_GetSettingValue(RSK_SHUFFLE_GROTTO_ENTRANCES) || Randomizer_GetSettingValue(RSK_SHUFFLE_OVERWORLD_SPAWNS) || Randomizer_GetSettingValue(RSK_SHUFFLE_WARP_SONGS) && - gSaveContext.fw.playerParams == 0x4FF) { + gSaveContext.fw.playerParams == 0x04FF) { gSaveContext.respawn[RESPAWN_MODE_RETURN] = gSaveContext.respawn[RESPAWN_MODE_TOP]; gSaveContext.respawn[RESPAWN_MODE_RETURN].playerParams = 0x0DFF; lastEntranceType = GROTTO_RETURN; diff --git a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp index 2cb5ba957..69dbf5e2a 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp @@ -1,7 +1,10 @@ #include "randomizer_item_tracker.h" -#include "../../util.h" -#include "../../OTRGlobals.h" -#include "../../UIWidgets.hpp" +#include "soh/util.h" +#include "soh/OTRGlobals.h" +#include "soh/cvar_prefixes.h" +#include "soh/SaveManager.h" +#include "soh/ResourceManagerHelpers.h" +#include "soh/UIWidgets.hpp" #include "randomizerTypes.h" #include @@ -22,7 +25,6 @@ extern PlayState* gPlayState; #include "textures/icon_item_static/icon_item_static.h" #include "textures/icon_item_24_static/icon_item_24_static.h" } -extern "C" uint32_t ResourceMgr_IsSceneMasterQuest(s16 sceneNum); void DrawEquip(ItemTrackerItem item); void DrawItem(ItemTrackerItem item); diff --git a/soh/soh/Enhancements/randomizer/savefile.cpp b/soh/soh/Enhancements/randomizer/savefile.cpp index 2fc16dc82..dd6c27257 100644 --- a/soh/soh/Enhancements/randomizer/savefile.cpp +++ b/soh/soh/Enhancements/randomizer/savefile.cpp @@ -1,5 +1,6 @@ #include "savefile.h" #include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" extern "C" { @@ -8,7 +9,6 @@ extern "C" { #include "functions.h" #include "macros.h" -uint32_t ResourceMgr_IsSceneMasterQuest(s16 sceneNum); uint8_t Randomizer_GetSettingValue(RandomizerSettingKey randoSettingKey); GetItemEntry Randomizer_GetItemFromKnownCheck(RandomizerCheck randomizerCheck, GetItemID ogId); } diff --git a/soh/soh/Enhancements/randomizer/settings.cpp b/soh/soh/Enhancements/randomizer/settings.cpp index 62a8316be..caa9f8304 100644 --- a/soh/soh/Enhancements/randomizer/settings.cpp +++ b/soh/soh/Enhancements/randomizer/settings.cpp @@ -1773,22 +1773,67 @@ void Settings::UpdateOptionProperties() { } } - // Show mixed entrance pool options if mixed entrance pools are enabled at all. - if (CVarGetInteger(CVAR_RANDOMIZER_SETTING("MixedEntrances"), RO_GENERIC_OFF)) { - mOptions[RSK_MIXED_ENTRANCE_POOLS].RemoveFlag(IMFLAG_SEPARATOR_BOTTOM); - mOptions[RSK_MIX_DUNGEON_ENTRANCES].Unhide(); - mOptions[RSK_MIX_BOSS_ENTRANCES].Unhide(); - mOptions[RSK_MIX_OVERWORLD_ENTRANCES].Unhide(); - mOptions[RSK_MIX_INTERIOR_ENTRANCES].Unhide(); - mOptions[RSK_MIX_GROTTO_ENTRANCES].Unhide(); + int dungeonShuffle = CVarGetInteger(CVAR_RANDOMIZER_SETTING("ShuffleDungeonsEntrances"), RO_DUNGEON_ENTRANCE_SHUFFLE_OFF); + int bossShuffle = CVarGetInteger(CVAR_RANDOMIZER_SETTING("ShuffleBossEntrances"), RO_BOSS_ROOM_ENTRANCE_SHUFFLE_OFF); + int overworldShuffle = CVarGetInteger(CVAR_RANDOMIZER_SETTING("ShuffleOverworldEntrances"), RO_GENERIC_OFF); + int interiorShuffle = CVarGetInteger(CVAR_RANDOMIZER_SETTING("ShuffleInteriorsEntrances"), RO_GENERIC_OFF); + int grottoShuffle = CVarGetInteger(CVAR_RANDOMIZER_SETTING("ShuffleGrottosEntrances"), RO_GENERIC_OFF); + + // Hide Mixed Entrances option if no applicable entrance shuffles are visible + if (!dungeonShuffle && !bossShuffle && !overworldShuffle && !interiorShuffle && !grottoShuffle) { + mOptions[RSK_MIXED_ENTRANCE_POOLS].Hide(); } else { + mOptions[RSK_MIXED_ENTRANCE_POOLS].Unhide(); + } + // Show mixed entrance pool options if mixed entrance pools are enabled, but only the ones that aren't off + if (CVarGetInteger(CVAR_RANDOMIZER_SETTING("MixedEntrances"), RO_GENERIC_OFF) == RO_GENERIC_OFF || mOptions[RSK_MIXED_ENTRANCE_POOLS].IsHidden()) { mOptions[RSK_MIXED_ENTRANCE_POOLS].AddFlag(IMFLAG_SEPARATOR_BOTTOM); mOptions[RSK_MIX_DUNGEON_ENTRANCES].Hide(); mOptions[RSK_MIX_BOSS_ENTRANCES].Hide(); mOptions[RSK_MIX_OVERWORLD_ENTRANCES].Hide(); mOptions[RSK_MIX_INTERIOR_ENTRANCES].Hide(); mOptions[RSK_MIX_GROTTO_ENTRANCES].Hide(); + } else { + mOptions[RSK_MIXED_ENTRANCE_POOLS].RemoveFlag(IMFLAG_SEPARATOR_BOTTOM); + mOptions[RSK_MIX_DUNGEON_ENTRANCES].RemoveFlag(IMFLAG_SEPARATOR_BOTTOM); + mOptions[RSK_MIX_BOSS_ENTRANCES].RemoveFlag(IMFLAG_SEPARATOR_BOTTOM); + mOptions[RSK_MIX_OVERWORLD_ENTRANCES].RemoveFlag(IMFLAG_SEPARATOR_BOTTOM); + mOptions[RSK_MIX_INTERIOR_ENTRANCES].RemoveFlag(IMFLAG_SEPARATOR_BOTTOM); + mOptions[RSK_MIX_GROTTO_ENTRANCES].RemoveFlag(IMFLAG_SEPARATOR_BOTTOM); + RandomizerSettingKey lastKey = RSK_MIXED_ENTRANCE_POOLS; + if (CVarGetInteger(CVAR_RANDOMIZER_SETTING("ShuffleDungeonsEntrances"), RO_DUNGEON_ENTRANCE_SHUFFLE_OFF) == RO_DUNGEON_ENTRANCE_SHUFFLE_OFF) { + mOptions[RSK_MIX_DUNGEON_ENTRANCES].Hide(); + } else { + mOptions[RSK_MIX_DUNGEON_ENTRANCES].Unhide(); + lastKey = RSK_MIX_DUNGEON_ENTRANCES; + } + if (CVarGetInteger(CVAR_RANDOMIZER_SETTING("ShuffleBossEntrances"), RO_BOSS_ROOM_ENTRANCE_SHUFFLE_OFF) == RO_BOSS_ROOM_ENTRANCE_SHUFFLE_OFF) { + mOptions[RSK_MIX_BOSS_ENTRANCES].Hide(); + } else { + mOptions[RSK_MIX_BOSS_ENTRANCES].Unhide(); + lastKey = RSK_MIX_BOSS_ENTRANCES; + } + if (CVarGetInteger(CVAR_RANDOMIZER_SETTING("ShuffleOverworldEntrances"), RO_GENERIC_OFF) == RO_GENERIC_OFF) { + mOptions[RSK_MIX_OVERWORLD_ENTRANCES].Hide(); + } else { + mOptions[RSK_MIX_OVERWORLD_ENTRANCES].Unhide(); + lastKey = RSK_MIX_OVERWORLD_ENTRANCES; + } + if (CVarGetInteger(CVAR_RANDOMIZER_SETTING("ShuffleInteriorsEntrances"), RO_GENERIC_OFF) == RO_GENERIC_OFF) { + mOptions[RSK_MIX_INTERIOR_ENTRANCES].Hide(); + } else { + mOptions[RSK_MIX_INTERIOR_ENTRANCES].Unhide(); + lastKey = RSK_MIX_INTERIOR_ENTRANCES; + } + if (CVarGetInteger(CVAR_RANDOMIZER_SETTING("ShuffleGrottosEntrances"), RO_GENERIC_OFF) == RO_GENERIC_OFF) { + mOptions[RSK_MIX_GROTTO_ENTRANCES].Hide(); + } else { + mOptions[RSK_MIX_GROTTO_ENTRANCES].Unhide(); + lastKey = RSK_MIX_GROTTO_ENTRANCES; + } + mOptions[lastKey].AddFlag(IMFLAG_SEPARATOR_BOTTOM); } + // Shuffle Weird Egg - Disabled when Skip Child Zelda is active if (CVarGetInteger(CVAR_RANDOMIZER_SETTING("SkipChildZelda"), RO_GENERIC_DONT_SKIP)) { mOptions[RSK_SHUFFLE_WEIRD_EGG].Disable("This option is disabled because \"Skip Child Zelda\" is enabled."); diff --git a/soh/soh/Enhancements/resolution-editor/ResolutionEditor.cpp b/soh/soh/Enhancements/resolution-editor/ResolutionEditor.cpp index 21d99194e..c15f04364 100644 --- a/soh/soh/Enhancements/resolution-editor/ResolutionEditor.cpp +++ b/soh/soh/Enhancements/resolution-editor/ResolutionEditor.cpp @@ -5,6 +5,7 @@ #include #include #include "soh/OTRGlobals.h" +#include "soh/cvar_prefixes.h" /* Console Variables are grouped under gAdvancedResolution. (e.g. CVAR_PREFIX_ADVANCED_RESOLUTION ".Enabled") diff --git a/soh/soh/Enhancements/timesaver_hook_handlers.cpp b/soh/soh/Enhancements/timesaver_hook_handlers.cpp index 13cf46f88..d3b478dfc 100644 --- a/soh/soh/Enhancements/timesaver_hook_handlers.cpp +++ b/soh/soh/Enhancements/timesaver_hook_handlers.cpp @@ -310,6 +310,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li case ACTOR_BG_SPOT05_SOKO: case ACTOR_BG_SPOT18_BASKET: case ACTOR_BG_HIDAN_CURTAIN: + case ACTOR_BG_MORI_HINERI: *should = false; RateLimitedSuccessChime(); break; @@ -907,114 +908,136 @@ void TimeSaverOnSceneInitHandler(int16_t sceneNum) { GetItemEntry vanillaQueuedItemEntry = GET_ITEM_NONE; void TimeSaverOnFlagSetHandler(int16_t flagType, int16_t flag) { - if (!CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO)) return; + if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO)) { + switch (flagType) { + case FLAG_EVENT_CHECK_INF: + switch (flag) { + case EVENTCHKINF_SPOKE_TO_SARIA_ON_BRIDGE: + vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_FAIRY_OCARINA).GetGIEntry_Copy(); + break; + case EVENTCHKINF_OBTAINED_KOKIRI_EMERALD_DEKU_TREE_DEAD: + vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_KOKIRI_EMERALD).GetGIEntry_Copy(); + break; + case EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP: + vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_GORON_RUBY).GetGIEntry_Copy(); + break; + case EVENTCHKINF_USED_JABU_JABUS_BELLY_BLUE_WARP: + vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_ZORA_SAPPHIRE).GetGIEntry_Copy(); + break; + case EVENTCHKINF_USED_FOREST_TEMPLE_BLUE_WARP: + vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_FOREST_MEDALLION).GetGIEntry_Copy(); + break; + case EVENTCHKINF_USED_FIRE_TEMPLE_BLUE_WARP: + vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_FIRE_MEDALLION).GetGIEntry_Copy(); + break; + case EVENTCHKINF_USED_WATER_TEMPLE_BLUE_WARP: + vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_WATER_MEDALLION).GetGIEntry_Copy(); + break; + case EVENTCHKINF_RETURNED_TO_TEMPLE_OF_TIME_WITH_ALL_MEDALLIONS: + vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_LIGHT_ARROWS).GetGIEntry_Copy(); + break; + case EVENTCHKINF_TIME_TRAVELED_TO_ADULT: + vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_LIGHT_MEDALLION).GetGIEntry_Copy(); + break; + } + break; + case FLAG_RANDOMIZER_INF: + switch (flag) { + case RAND_INF_DUNGEONS_DONE_SHADOW_TEMPLE: + vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_SHADOW_MEDALLION).GetGIEntry_Copy(); + break; + case RAND_INF_DUNGEONS_DONE_SPIRIT_TEMPLE: + vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_SPIRIT_MEDALLION).GetGIEntry_Copy(); + break; + } + break; + } + } - switch (flagType) { - case FLAG_EVENT_CHECK_INF: - switch (flag) { - case EVENTCHKINF_SPOKE_TO_SARIA_ON_BRIDGE: - vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_FAIRY_OCARINA).GetGIEntry_Copy(); - break; - case EVENTCHKINF_LEARNED_ZELDAS_LULLABY: - vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_ZELDAS_LULLABY).GetGIEntry_Copy(); - break; - case EVENTCHKINF_LEARNED_MINUET_OF_FOREST: - vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_MINUET_OF_FOREST).GetGIEntry_Copy(); - break; - case EVENTCHKINF_LEARNED_BOLERO_OF_FIRE: - vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_BOLERO_OF_FIRE).GetGIEntry_Copy(); - break; - case EVENTCHKINF_LEARNED_SERENADE_OF_WATER: - vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_SERENADE_OF_WATER).GetGIEntry_Copy(); - break; - case EVENTCHKINF_LEARNED_REQUIEM_OF_SPIRIT: - vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_REQUIEM_OF_SPIRIT).GetGIEntry_Copy(); - break; - case EVENTCHKINF_BONGO_BONGO_ESCAPED_FROM_WELL: - vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_NOCTURNE_OF_SHADOW).GetGIEntry_Copy(); - break; - case EVENTCHKINF_LEARNED_PRELUDE_OF_LIGHT: - vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_PRELUDE_OF_LIGHT).GetGIEntry_Copy(); - break; - case EVENTCHKINF_LEARNED_SARIAS_SONG: - vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_SARIAS_SONG).GetGIEntry_Copy(); - break; - case EVENTCHKINF_OBTAINED_KOKIRI_EMERALD_DEKU_TREE_DEAD: - vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_KOKIRI_EMERALD).GetGIEntry_Copy(); - break; - case EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP: - vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_GORON_RUBY).GetGIEntry_Copy(); - break; - case EVENTCHKINF_USED_JABU_JABUS_BELLY_BLUE_WARP: - vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_ZORA_SAPPHIRE).GetGIEntry_Copy(); - break; - case EVENTCHKINF_USED_FOREST_TEMPLE_BLUE_WARP: - vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_FOREST_MEDALLION).GetGIEntry_Copy(); - break; - case EVENTCHKINF_USED_FIRE_TEMPLE_BLUE_WARP: - vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_FIRE_MEDALLION).GetGIEntry_Copy(); - break; - case EVENTCHKINF_USED_WATER_TEMPLE_BLUE_WARP: - vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_WATER_MEDALLION).GetGIEntry_Copy(); - break; - case EVENTCHKINF_RETURNED_TO_TEMPLE_OF_TIME_WITH_ALL_MEDALLIONS: - vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_LIGHT_ARROWS).GetGIEntry_Copy(); - break; - case EVENTCHKINF_TIME_TRAVELED_TO_ADULT: - vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_LIGHT_MEDALLION).GetGIEntry_Copy(); - break; - case EVENTCHKINF_LEARNED_SONG_OF_TIME: - vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_SONG_OF_TIME).GetGIEntry_Copy(); - break; - case EVENTCHKINF_LEARNED_SONG_OF_STORMS: - vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_SONG_OF_STORMS).GetGIEntry_Copy(); - break; - case EVENTCHKINF_LEARNED_SUNS_SONG: - vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_SUNS_SONG).GetGIEntry_Copy(); - break; - } - break; - case FLAG_RANDOMIZER_INF: - switch (flag) { - case RAND_INF_LEARNED_EPONA_SONG: - vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_EPONAS_SONG).GetGIEntry_Copy(); - break; - case RAND_INF_DUNGEONS_DONE_SHADOW_TEMPLE: - vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_SHADOW_MEDALLION).GetGIEntry_Copy(); - break; - case RAND_INF_DUNGEONS_DONE_SPIRIT_TEMPLE: - vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_SPIRIT_MEDALLION).GetGIEntry_Copy(); - break; - case RAND_INF_ZF_GREAT_FAIRY_REWARD: - vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_FARORES_WIND).GetGIEntry_Copy(); - break; - case RAND_INF_HC_GREAT_FAIRY_REWARD: - vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_DINS_FIRE).GetGIEntry_Copy(); - break; - case RAND_INF_COLOSSUS_GREAT_FAIRY_REWARD: - vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_NAYRUS_LOVE).GetGIEntry_Copy(); - break; - case RAND_INF_DMT_GREAT_FAIRY_REWARD: - vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_MAGIC_SINGLE).GetGIEntry_Copy(); - break; - case RAND_INF_DMC_GREAT_FAIRY_REWARD: - vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_MAGIC_DOUBLE).GetGIEntry_Copy(); - break; - case RAND_INF_OGC_GREAT_FAIRY_REWARD: - vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_DOUBLE_DEFENSE).GetGIEntry_Copy(); - break; - } - break; - case FLAG_ITEM_GET_INF: - switch (flag) { - case ITEMGETINF_OBTAINED_STICK_UPGRADE_FROM_STAGE: - vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_DEKU_STICK_CAPACITY_30).GetGIEntry_Copy(); - break; - case ITEMGETINF_OBTAINED_NUT_UPGRADE_FROM_STAGE: - vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_DEKU_NUT_CAPACITY_40).GetGIEntry_Copy(); - break; - } - break; + if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipMiscInteractions"), IS_RANDO)) { + switch (flagType) { + case FLAG_RANDOMIZER_INF: + switch (flag) { + case RAND_INF_ZF_GREAT_FAIRY_REWARD: + vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_FARORES_WIND).GetGIEntry_Copy(); + break; + case RAND_INF_HC_GREAT_FAIRY_REWARD: + vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_DINS_FIRE).GetGIEntry_Copy(); + break; + case RAND_INF_COLOSSUS_GREAT_FAIRY_REWARD: + vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_NAYRUS_LOVE).GetGIEntry_Copy(); + break; + case RAND_INF_DMT_GREAT_FAIRY_REWARD: + vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_MAGIC_SINGLE).GetGIEntry_Copy(); + break; + case RAND_INF_DMC_GREAT_FAIRY_REWARD: + vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_MAGIC_DOUBLE).GetGIEntry_Copy(); + break; + case RAND_INF_OGC_GREAT_FAIRY_REWARD: + vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_DOUBLE_DEFENSE).GetGIEntry_Copy(); + break; + } + break; + case FLAG_ITEM_GET_INF: + switch (flag) { + case ITEMGETINF_OBTAINED_STICK_UPGRADE_FROM_STAGE: + vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_DEKU_STICK_CAPACITY_30).GetGIEntry_Copy(); + break; + case ITEMGETINF_OBTAINED_NUT_UPGRADE_FROM_STAGE: + vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_DEKU_NUT_CAPACITY_40).GetGIEntry_Copy(); + break; + } + break; + } + } + + if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.LearnSong"), IS_RANDO)) { + switch (flagType) { + case FLAG_EVENT_CHECK_INF: + switch (flag) { + case EVENTCHKINF_LEARNED_ZELDAS_LULLABY: + vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_ZELDAS_LULLABY).GetGIEntry_Copy(); + break; + case EVENTCHKINF_LEARNED_MINUET_OF_FOREST: + vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_MINUET_OF_FOREST).GetGIEntry_Copy(); + break; + case EVENTCHKINF_LEARNED_BOLERO_OF_FIRE: + vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_BOLERO_OF_FIRE).GetGIEntry_Copy(); + break; + case EVENTCHKINF_LEARNED_SERENADE_OF_WATER: + vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_SERENADE_OF_WATER).GetGIEntry_Copy(); + break; + case EVENTCHKINF_LEARNED_REQUIEM_OF_SPIRIT: + vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_REQUIEM_OF_SPIRIT).GetGIEntry_Copy(); + break; + case EVENTCHKINF_BONGO_BONGO_ESCAPED_FROM_WELL: + vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_NOCTURNE_OF_SHADOW).GetGIEntry_Copy(); + break; + case EVENTCHKINF_LEARNED_PRELUDE_OF_LIGHT: + vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_PRELUDE_OF_LIGHT).GetGIEntry_Copy(); + break; + case EVENTCHKINF_LEARNED_SARIAS_SONG: + vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_SARIAS_SONG).GetGIEntry_Copy(); + break; + case EVENTCHKINF_LEARNED_SONG_OF_TIME: + vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_SONG_OF_TIME).GetGIEntry_Copy(); + break; + case EVENTCHKINF_LEARNED_SONG_OF_STORMS: + vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_SONG_OF_STORMS).GetGIEntry_Copy(); + break; + case EVENTCHKINF_LEARNED_SUNS_SONG: + vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_SUNS_SONG).GetGIEntry_Copy(); + break; + } + break; + case FLAG_RANDOMIZER_INF: + switch (flag) { + case RAND_INF_LEARNED_EPONA_SONG: + vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_EPONAS_SONG).GetGIEntry_Copy(); + break; + } + break; + } } } diff --git a/soh/soh/Enhancements/timesplits/TimeSplits.cpp b/soh/soh/Enhancements/timesplits/TimeSplits.cpp index f5dce9b59..7471acfa7 100644 --- a/soh/soh/Enhancements/timesplits/TimeSplits.cpp +++ b/soh/soh/Enhancements/timesplits/TimeSplits.cpp @@ -745,14 +745,18 @@ void TimeSplitsDrawOptionsMenu() { ImGui::SeparatorText("Window Options"); if (ImGui::ColorEdit4("Background Color", (float*)&windowColor, ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_NoLabel)) { Color_RGBA8 color; - color.r = windowColor.x; - color.g = windowColor.y; - color.b = windowColor.z; - color.a = windowColor.w; + color.r = windowColor.x * 255.0; + color.g = windowColor.y * 255.0; + color.b = windowColor.z * 255.0; + color.a = windowColor.w * 255.0; + CVarSetColor("TimeSplits.WindowColor", color); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } ImGui::SameLine(); if (ImGui::Button("Reset")) { windowColor = { 0.0f, 0.0f, 0.0f, 1.0f }; + CVarSetColor("TimeSplits.WindowColor", {0, 0, 0, 1}); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); } if (UIWidgets::PaddedEnhancementSliderFloat("Window Size: %.1fx", "##windowSize", @@ -914,6 +918,9 @@ static bool initialized = false; void TimeSplitWindow::DrawElement() { ImGui::SetWindowFontScale(timeSplitsWindowSize); if (!initialized) { + Color_RGBA8 defaultColour = {0, 0, 0, 255}; + Color_RGBA8 color = CVarGetColor("TimeSplits.WindowColor", defaultColour); + windowColor = {(float)color.r / 255.0f, (float)color.g / 255.0f, (float)color.b / 255.0f, (float)color.a / 255.0f}; InitializeSplitDataFile(); initialized = true; } diff --git a/soh/soh/ImGuiUtils.cpp b/soh/soh/ImGuiUtils.cpp index 11ad464e8..bfe1293d5 100644 --- a/soh/soh/ImGuiUtils.cpp +++ b/soh/soh/ImGuiUtils.cpp @@ -1,6 +1,7 @@ #include "ImGuiUtils.h" #include #include "assets/soh_assets.h" +#include "soh/Enhancements/randomizer/rando_hash.h" std::map itemMapping = { ITEM_MAP_ENTRY(ITEM_STICK), @@ -150,7 +151,7 @@ std::map questMapping = { QUEST_MAP_ENTRY(QUEST_SKULL_TOKEN, dgQuestIconGoldSkulltulaTex), }; -std::array songMapping = { { +std::map songMapping = { SONG_MAP_ENTRY(QUEST_SONG_LULLABY, 224, 107, 255), SONG_MAP_ENTRY(QUEST_SONG_EPONA, 255, 195, 60), SONG_MAP_ENTRY(QUEST_SONG_SARIA, 127, 255, 137), @@ -163,7 +164,7 @@ std::array songMapping = { { SONG_MAP_ENTRY(QUEST_SONG_REQUIEM, 255, 160, 0), SONG_MAP_ENTRY(QUEST_SONG_NOCTURNE, 255, 100, 255), SONG_MAP_ENTRY(QUEST_SONG_PRELUDE, 255, 240, 100), -} }; +}; std::array vanillaSongMapping = { { VANILLA_SONG_MAP_ENTRY(QUEST_SONG_LULLABY, 255, 255, 255), @@ -212,7 +213,7 @@ void RegisterImGuiItemIcons() { Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.nameFaded, entry.second.texturePath, ImVec4(1, 1, 1, 0.3f)); } - for (const auto& entry : songMapping) { + for (const auto& [quest, entry] : songMapping) { Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.name, gSongNoteTex, entry.color); ImVec4 fadedCol = entry.color; fadedCol.w = 0.3f; @@ -225,4 +226,8 @@ void RegisterImGuiItemIcons() { fadedCol.w = 0.3f; Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.nameFaded, gSongNoteTex, fadedCol); } + + for (const auto& entry : gSeedTextures) { + Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.tex, entry.tex, ImVec4(1, 1, 1, 1)); + } } \ No newline at end of file diff --git a/soh/soh/ImGuiUtils.h b/soh/soh/ImGuiUtils.h index c5545ba74..ed735713a 100644 --- a/soh/soh/ImGuiUtils.h +++ b/soh/soh/ImGuiUtils.h @@ -67,11 +67,11 @@ typedef struct { #define SONG_MAP_ENTRY(id, r, g, b) \ { \ - id, #id, #id "_Faded", ImVec4(r / 255.0f, g / 255.0f, b / 255.0f, 1.0f) \ + id, { id, #id, #id "_Faded", ImVec4(r / 255.0f, g / 255.0f, b / 255.0f, 1.0f) } \ } // Maps song ids to info for use in ImGui -extern std::array songMapping; +extern std::map songMapping; #define VANILLA_SONG_MAP_ENTRY(id, r, g, b) \ { \ diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index 7f58f7e8c..0d3548814 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -6,17 +6,14 @@ #include #include -#include +#include "ResourceManagerHelpers.h" #include "graphic/Fast3D/Fast3dWindow.h" #include #include #include #include -#include "z64animation.h" -#include "z64bgcheck.h" #include "Enhancements/gameconsole.h" -#include #ifdef _WIN32 #include #else @@ -27,7 +24,6 @@ #include "Enhancements/controls/SohInputEditorWindow.h" #include "Enhancements/cosmetics/CosmeticsEditor.h" #include "Enhancements/audio/AudioCollection.h" -#include "Enhancements/audio/AudioEditor.h" #include "Enhancements/enhancementTypes.h" #include "Enhancements/debugconsole.h" #include "Enhancements/randomizer/randomizer.h" @@ -56,7 +52,6 @@ #endif #include -#include #ifdef __APPLE__ #include @@ -77,6 +72,7 @@ #include "Enhancements/item-tables/ItemTableManager.h" #include "SohGui.hpp" #include "ActorDB.h" +#include "SaveManager.h" #ifdef ENABLE_REMOTE_CONTROL #include "soh/Network/CrowdControl/CrowdControl.h" @@ -506,18 +502,11 @@ uint32_t OTRGlobals::GetInterpolationFPS() { return std::min(Ship::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate(), CVarGetInteger(CVAR_SETTING("InterpolationFPS"), 20)); } -struct ExtensionEntry { - std::string path; - std::string ext; -}; - extern "C" void OTRMessage_Init(); extern "C" void AudioMgr_CreateNextAudioBuffer(s16* samples, u32 num_samples); extern "C" void AudioPlayer_Play(const uint8_t* buf, uint32_t len); extern "C" int AudioPlayer_Buffered(void); extern "C" int AudioPlayer_GetDesiredBuffered(void); -extern "C" void ResourceMgr_LoadDirectory(const char* resName); -extern "C" SequenceData ResourceMgr_LoadSeqByName(const char* path); std::unordered_map ExtensionCache; void OTRAudio_Thread() { @@ -1491,269 +1480,7 @@ extern "C" uint16_t OTRGetPixelDepth(float x, float y) { return wnd->GetPixelDepth(x, y); } -extern "C" uint32_t ResourceMgr_GetNumGameVersions() { - return Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions().size(); -} - -extern "C" uint32_t ResourceMgr_GetGameVersion(int index) { - return Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions()[index]; -} - -extern "C" uint32_t ResourceMgr_GetGamePlatform(int index) { - uint32_t version = Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions()[index]; - - switch (version) { - case OOT_NTSC_US_10: - case OOT_NTSC_US_11: - case OOT_NTSC_US_12: - case OOT_PAL_10: - case OOT_PAL_11: - return GAME_PLATFORM_N64; - case OOT_NTSC_JP_GC: - case OOT_NTSC_US_GC: - case OOT_PAL_GC: - case OOT_NTSC_JP_MQ: - case OOT_NTSC_US_MQ: - case OOT_PAL_MQ: - case OOT_PAL_GC_DBG1: - case OOT_PAL_GC_DBG2: - case OOT_PAL_GC_MQ_DBG: - return GAME_PLATFORM_GC; - } -} - -extern "C" uint32_t ResourceMgr_GetGameRegion(int index) { - uint32_t version = Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions()[index]; - - switch (version) { - case OOT_NTSC_US_10: - case OOT_NTSC_US_11: - case OOT_NTSC_US_12: - case OOT_NTSC_JP_GC: - case OOT_NTSC_US_GC: - case OOT_NTSC_JP_MQ: - case OOT_NTSC_US_MQ: - return GAME_REGION_NTSC; - case OOT_PAL_10: - case OOT_PAL_11: - case OOT_PAL_GC: - case OOT_PAL_MQ: - case OOT_PAL_GC_DBG1: - case OOT_PAL_GC_DBG2: - case OOT_PAL_GC_MQ_DBG: - return GAME_REGION_PAL; - } -} - -uint32_t IsSceneMasterQuest(s16 sceneNum) { - uint32_t value = 0; - uint8_t mqMode = CVarGetInteger(CVAR_GENERAL("BetterDebugWarpScreenMQMode"), WARP_MODE_OVERRIDE_OFF); - if (mqMode == WARP_MODE_OVERRIDE_MQ_AS_VANILLA) { - return 1; - } else if (mqMode == WARP_MODE_OVERRIDE_VANILLA_AS_MQ) { - return 0; - } else { - if (OTRGlobals::Instance->HasMasterQuest()) { - if (!OTRGlobals::Instance->HasOriginal()) { - value = 1; - } else if (IS_MASTER_QUEST) { - value = 1; - } else { - value = 0; - if (IS_RANDO) { - auto dungeon = OTRGlobals::Instance->gRandoContext->GetDungeons()->GetDungeonFromScene(sceneNum); - if (dungeon != nullptr && dungeon->IsMQ()) { - value = 1; - } - } - } - } - } - return value; -} - -uint32_t IsGameMasterQuest() { - return gPlayState != NULL ? IsSceneMasterQuest(gPlayState->sceneNum) : 0; -} - -extern "C" uint32_t ResourceMgr_GameHasMasterQuest() { - return OTRGlobals::Instance->HasMasterQuest(); -} - -extern "C" uint32_t ResourceMgr_GameHasOriginal() { - return OTRGlobals::Instance->HasOriginal(); -} - -extern "C" uint32_t ResourceMgr_IsSceneMasterQuest(s16 sceneNum) { - return IsSceneMasterQuest(sceneNum); -} - -extern "C" uint32_t ResourceMgr_IsGameMasterQuest() { - return IsGameMasterQuest(); -} - -extern "C" void ResourceMgr_LoadDirectory(const char* resName) { - Ship::Context::GetInstance()->GetResourceManager()->LoadDirectory(resName); -} -extern "C" void ResourceMgr_DirtyDirectory(const char* resName) { - Ship::Context::GetInstance()->GetResourceManager()->DirtyDirectory(resName); -} - -extern "C" void ResourceMgr_UnloadResource(const char* resName) { - std::string path = resName; - if (path.substr(0, 7) == "__OTR__") { - path = path.substr(7); - } - auto res = Ship::Context::GetInstance()->GetResourceManager()->UnloadResource(path); -} - -// OTRTODO: There is probably a more elegant way to go about this... -// Kenix: This is definitely leaking memory when it's called. -extern "C" char** ResourceMgr_ListFiles(const char* searchMask, int* resultSize) { - auto lst = Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->ListFiles(searchMask); - char** result = (char**)malloc(lst->size() * sizeof(char*)); - - for (size_t i = 0; i < lst->size(); i++) { - char* str = (char*)malloc(lst.get()[0][i].size() + 1); - memcpy(str, lst.get()[0][i].data(), lst.get()[0][i].size()); - str[lst.get()[0][i].size()] = '\0'; - result[i] = str; - } - *resultSize = lst->size(); - - return result; -} - -extern "C" uint8_t ResourceMgr_FileExists(const char* filePath) { - std::string path = filePath; - if(path.substr(0, 7) == "__OTR__"){ - path = path.substr(7); - } - - return ExtensionCache.contains(path); -} - -extern "C" uint8_t ResourceMgr_FileAltExists(const char* filePath) { - std::string path = filePath; - if (path.substr(0, 7) == "__OTR__") { - path = path.substr(7); - } - - if (path.substr(0, 4) != "alt/") { - path = "alt/" + path; - } - - return ExtensionCache.contains(path); -} - -extern "C" bool ResourceMgr_IsAltAssetsEnabled() { - return Ship::Context::GetInstance()->GetResourceManager()->IsAltAssetsEnabled(); -} - -// Unloads a resource if an alternate version exists when alt assets are enabled -// The resource is only removed from the internal cache to prevent it from used in the next resource lookup -extern "C" void ResourceMgr_UnloadOriginalWhenAltExists(const char* resName) { - if (ResourceMgr_IsAltAssetsEnabled() && ResourceMgr_FileAltExists((char*)resName)) { - ResourceMgr_UnloadResource((char*) resName); - } -} - -std::shared_ptr GetResourceByNameHandlingMQ(const char* path) { - std::string Path = path; - if (ResourceMgr_IsGameMasterQuest()) { - size_t pos = 0; - if ((pos = Path.find("/nonmq/", 0)) != std::string::npos) { - Path.replace(pos, 7, "/mq/"); - } - } - return Ship::Context::GetInstance()->GetResourceManager()->LoadResource(Path.c_str()); -} - -extern "C" char* GetResourceDataByNameHandlingMQ(const char* path) { - auto res = GetResourceByNameHandlingMQ(path); - - if (res == nullptr) { - return nullptr; - } - - return (char*)res->GetRawPointer(); -} - -extern "C" uint8_t ResourceMgr_TexIsRaw(const char* texPath) { - auto res = std::static_pointer_cast(GetResourceByNameHandlingMQ(texPath)); - return res->Flags & TEX_FLAG_LOAD_AS_RAW; -} - -extern "C" uint8_t ResourceMgr_ResourceIsBackground(char* texPath) { - auto res = GetResourceByNameHandlingMQ(texPath); - return res->GetInitData()->Type == static_cast(SOH::ResourceType::SOH_Background); -} - -extern "C" char* ResourceMgr_LoadJPEG(char* data, size_t dataSize) -{ - static char* finalBuffer = 0; - - if (finalBuffer == 0) - finalBuffer = (char*)malloc(dataSize); - - int w; - int h; - int comp; - - unsigned char* pixels = stbi_load_from_memory((const unsigned char*)data, 320 * 240 * 2, &w, &h, &comp, STBI_rgb_alpha); - //unsigned char* pixels = stbi_load_from_memory((const unsigned char*)data, 480 * 240 * 2, &w, &h, &comp, STBI_rgb_alpha); - int idx = 0; - - for (int y = 0; y < h; y++) - { - for (int x = 0; x < w; x++) - { - uint16_t* bufferTest = (uint16_t*)finalBuffer; - int pixelIdx = ((y * w) + x) * 4; - - uint8_t r = pixels[pixelIdx + 0] / 8; - uint8_t g = pixels[pixelIdx + 1] / 8; - uint8_t b = pixels[pixelIdx + 2] / 8; - - uint8_t alphaBit = pixels[pixelIdx + 3] != 0; - - uint16_t data = (r << 11) + (g << 6) + (b << 1) + alphaBit; - - finalBuffer[idx++] = (data & 0xFF00) >> 8; - finalBuffer[idx++] = (data & 0x00FF); - } - } - - return (char*)finalBuffer; -} - -extern "C" uint16_t ResourceMgr_LoadTexWidthByName(char* texPath); - -extern "C" uint16_t ResourceMgr_LoadTexHeightByName(char* texPath); - -extern "C" char* ResourceMgr_LoadTexOrDListByName(const char* filePath) { - auto res = GetResourceByNameHandlingMQ(filePath); - - if (res->GetInitData()->Type == static_cast(LUS::ResourceType::DisplayList)) - return (char*)&((std::static_pointer_cast(res))->Instructions[0]); - else if (res->GetInitData()->Type == static_cast(SOH::ResourceType::SOH_Array)) - return (char*)(std::static_pointer_cast(res))->Vertices.data(); - else { - return (char*)GetResourceDataByNameHandlingMQ(filePath); - } -} - -extern "C" char* ResourceMgr_LoadIfDListByName(const char* filePath) { - auto res = GetResourceByNameHandlingMQ(filePath); - - if (res->GetInitData()->Type == static_cast(LUS::ResourceType::DisplayList)) - return (char*)&((std::static_pointer_cast(res))->Instructions[0]); - - return nullptr; -} - extern "C" Sprite* GetSeedTexture(uint8_t index) { - return OTRGlobals::Instance->gRandoContext->GetSeedTexture(index); } @@ -1761,157 +1488,6 @@ extern "C" uint8_t GetSeedIconIndex(uint8_t index) { return OTRGlobals::Instance->gRandoContext->hashIconIndexes[index]; } -extern "C" char* ResourceMgr_LoadPlayerAnimByName(const char* animPath) { - auto anim = std::static_pointer_cast(GetResourceByNameHandlingMQ(animPath)); - - return (char*)&anim->limbRotData[0]; -} - -extern "C" void ResourceMgr_PushCurrentDirectory(char* path) -{ - gfx_push_current_dir(path); -} - -extern "C" Gfx* ResourceMgr_LoadGfxByName(const char* path) -{ - // When an alt resource exists for the DL, we need to unload the original asset - // to clear the cache so the alt asset will be loaded instead - // OTRTODO: If Alt loading over original cache is fixed, this line can most likely be removed - ResourceMgr_UnloadOriginalWhenAltExists(path); - - auto res = std::static_pointer_cast(GetResourceByNameHandlingMQ(path)); - return (Gfx*)&res->Instructions[0]; -} - -extern "C" uint8_t ResourceMgr_FileIsCustomByName(const char* path) { - auto res = std::static_pointer_cast(GetResourceByNameHandlingMQ(path)); - return res->GetInitData()->IsCustom; -} - -typedef struct { - int index; - Gfx instruction; -} GfxPatch; - -std::unordered_map> originalGfx; - -// Attention! This is primarily for cosmetics & bug fixes. For things like mods and model replacement you should be using OTRs -// instead (When that is available). Index can be found using the commented out section below. -extern "C" void ResourceMgr_PatchGfxByName(const char* path, const char* patchName, int index, Gfx instruction) { - auto res = std::static_pointer_cast( - Ship::Context::GetInstance()->GetResourceManager()->LoadResource(path)); - - // Leaving this here for people attempting to find the correct Dlist index to patch - /*if (strcmp("__OTR__objects/object_gi_longsword/gGiBiggoronSwordDL", path) == 0) { - for (int i = 0; i < res->instructions.size(); i++) { - Gfx* gfx = (Gfx*)&res->instructions[i]; - // Log all commands - // SPDLOG_INFO("index:{} command:{}", i, gfx->words.w0 >> 24); - // Log only SetPrimColors - if (gfx->words.w0 >> 24 == 250) { - SPDLOG_INFO("index:{} r:{} g:{} b:{} a:{}", i, _SHIFTR(gfx->words.w1, 24, 8), _SHIFTR(gfx->words.w1, 16, 8), _SHIFTR(gfx->words.w1, 8, 8), _SHIFTR(gfx->words.w1, 0, 8)); - } - } - }*/ - - // Index refers to individual gfx words, which are half the size on 32-bit - // if (sizeof(uintptr_t) < 8) { - // index /= 2; - // } - - // Do not patch custom assets as they most likely do not have the same instructions as authentic assets - if (res->GetInitData()->IsCustom) { - return; - } - - Gfx* gfx = (Gfx*)&res->Instructions[index]; - - if (!originalGfx.contains(path) || !originalGfx[path].contains(patchName)) { - originalGfx[path][patchName] = { - index, - *gfx - }; - } - - *gfx = instruction; -} - -extern "C" void ResourceMgr_PatchGfxCopyCommandByName(const char* path, const char* patchName, int destinationIndex, int sourceIndex) { - auto res = std::static_pointer_cast( - Ship::Context::GetInstance()->GetResourceManager()->LoadResource(path)); - - // Do not patch custom assets as they most likely do not have the same instructions as authentic assets - if (res->GetInitData()->IsCustom) { - return; - } - - Gfx* destinationGfx = (Gfx*)&res->Instructions[destinationIndex]; - Gfx sourceGfx = *(Gfx*)&res->Instructions[sourceIndex]; - - if (!originalGfx.contains(path) || !originalGfx[path].contains(patchName)) { - originalGfx[path][patchName] = { - destinationIndex, - *destinationGfx - }; - } - - *destinationGfx = sourceGfx; -} - -extern "C" void ResourceMgr_UnpatchGfxByName(const char* path, const char* patchName) { - if (originalGfx.contains(path) && originalGfx[path].contains(patchName)) { - auto res = std::static_pointer_cast( - Ship::Context::GetInstance()->GetResourceManager()->LoadResource(path)); - - Gfx* gfx = (Gfx*)&res->Instructions[originalGfx[path][patchName].index]; - *gfx = originalGfx[path][patchName].instruction; - - originalGfx[path].erase(patchName); - } -} - -extern "C" char* ResourceMgr_LoadArrayByName(const char* path) -{ - auto res = std::static_pointer_cast(GetResourceByNameHandlingMQ(path)); - - return (char*)res->Scalars.data(); -} - -// Return of LoadArrayByNameAsVec3s must be freed by the caller -extern "C" char* ResourceMgr_LoadArrayByNameAsVec3s(const char* path) { - auto res = std::static_pointer_cast(GetResourceByNameHandlingMQ(path)); - - // if (res->CachedGameAsset != nullptr) - // return (char*)res->CachedGameAsset; - // else - // { - Vec3s* data = (Vec3s*)malloc(sizeof(Vec3s) * res->Scalars.size()); - - for (size_t i = 0; i < res->Scalars.size(); i += 3) { - data[(i / 3)].x = res->Scalars[i + 0].s16; - data[(i / 3)].y = res->Scalars[i + 1].s16; - data[(i / 3)].z = res->Scalars[i + 2].s16; - } - - // res->CachedGameAsset = data; - - return (char*)data; - // } -} - -extern "C" CollisionHeader* ResourceMgr_LoadColByName(const char* path) { - return (CollisionHeader*) ResourceGetDataByName(path); -} - -extern "C" Vtx* ResourceMgr_LoadVtxByName(char* path) { - return (Vtx*) ResourceGetDataByName(path); -} - -extern "C" SequenceData ResourceMgr_LoadSeqByName(const char* path) { - SequenceData* sequence = (SequenceData*) ResourceGetDataByName(path); - return *sequence; -} - std::map cachedCustomSFs; extern "C" SoundFontSample* ReadCustomSample(const char* path) { @@ -1972,81 +1548,6 @@ extern "C" SoundFontSample* ReadCustomSample(const char* path) { */ } -extern "C" SoundFontSample* ResourceMgr_LoadAudioSample(const char* path) { - return (SoundFontSample*) ResourceGetDataByName(path); -} - -extern "C" SoundFont* ResourceMgr_LoadAudioSoundFont(const char* path) { - return (SoundFont*) ResourceGetDataByName(path); -} - -extern "C" int ResourceMgr_OTRSigCheck(char* imgData) -{ - uintptr_t i = (uintptr_t)(imgData); - -// if (i == 0xD9000000 || i == 0xE7000000 || (i & 1) == 1) - if ((i & 1) == 1) - return 0; - -// if ((i & 0xFF000000) != 0xAB000000 && (i & 0xFF000000) != 0xCD000000 && i != 0) { - if (i != 0) { - if (imgData[0] == '_' && imgData[1] == '_' && imgData[2] == 'O' && imgData[3] == 'T' && imgData[4] == 'R' && - imgData[5] == '_' && imgData[6] == '_') - return 1; - } - - return 0; -} - -extern "C" AnimationHeaderCommon* ResourceMgr_LoadAnimByName(const char* path) { - return (AnimationHeaderCommon*) ResourceGetDataByName(path); -} - -extern "C" SkeletonHeader* ResourceMgr_LoadSkeletonByName(const char* path, SkelAnime* skelAnime) { - std::string pathStr = std::string(path); - static const std::string sOtr = "__OTR__"; - - if (pathStr.starts_with(sOtr)) { - pathStr = pathStr.substr(sOtr.length()); - } - - bool isAlt = ResourceMgr_IsAltAssetsEnabled(); - - if (isAlt) { - pathStr = Ship::IResource::gAltAssetPrefix + pathStr; - } - - SkeletonHeader* skelHeader = (SkeletonHeader*) ResourceGetDataByName(pathStr.c_str()); - - // If there isn't an alternate model, load the regular one - if (isAlt && skelHeader == NULL) { - skelHeader = (SkeletonHeader*) ResourceGetDataByName(path); - } - - // This function is only called when a skeleton is initialized. - // Therefore we can take this oppurtunity to take note of the Skeleton that is created... - if (skelAnime != nullptr) { - auto stringPath = std::string(path); - SOH::SkeletonPatcher::RegisterSkeleton(stringPath, skelAnime); - } - - return skelHeader; -} - -extern "C" void ResourceMgr_UnregisterSkeleton(SkelAnime* skelAnime) { - if (skelAnime != nullptr) - SOH::SkeletonPatcher::UnregisterSkeleton(skelAnime); -} - -extern "C" void ResourceMgr_ClearSkeletons(SkelAnime* skelAnime) { - if (skelAnime != nullptr) - SOH::SkeletonPatcher::ClearSkeletons(); -} - -extern "C" s32* ResourceMgr_LoadCSByName(const char* path) { - return (s32*)GetResourceDataByNameHandlingMQ(path); -} - std::filesystem::path GetSaveFile(std::shared_ptr Conf) { const std::string fileName = Conf->GetString("Game.SaveName", Ship::Context::GetPathRelativeToAppDirectory("oot_save.sav")); std::filesystem::path saveFile = std::filesystem::absolute(fileName); @@ -2897,7 +2398,7 @@ extern "C" void Gfx_TextureCacheDelete(const uint8_t* texAddr) { } if (ResourceMgr_OTRSigCheck(imgName)) { - texAddr = (const uint8_t*)GetResourceDataByNameHandlingMQ(imgName); + texAddr = (const uint8_t*)ResourceMgr_GetResourceDataByNameHandlingMQ(imgName); } gfx_texture_cache_delete(texAddr); diff --git a/soh/soh/OTRGlobals.h b/soh/soh/OTRGlobals.h index 86e411ba9..854ef5b8f 100644 --- a/soh/soh/OTRGlobals.h +++ b/soh/soh/OTRGlobals.h @@ -3,15 +3,6 @@ #pragma once -#include "SaveManager.h" -#include - -#define GAME_REGION_NTSC 0 -#define GAME_REGION_PAL 1 - -#define GAME_PLATFORM_N64 0 -#define GAME_PLATFORM_GC 1 - #define BTN_CUSTOM_MODIFIER1 0x0040 #define BTN_CUSTOM_MODIFIER2 0x0080 @@ -29,6 +20,14 @@ #include "Enhancements/savestates.h" #include "Enhancements/randomizer/randomizer.h" #include +#include + +struct ExtensionEntry { + std::string path; + std::string ext; +}; + +extern std::unordered_map ExtensionCache; #include "Enhancements/randomizer/context.h" const std::string customMessageTableID = "BaseGameOverrides"; @@ -42,60 +41,39 @@ const uint32_t defaultImGuiScale = 1; const float imguiScaleOptionToValue[4] = { 0.75f, 1.0f, 1.5f, 2.0f }; -class OTRGlobals -{ -public: - static OTRGlobals* Instance; +class OTRGlobals { + public: + static OTRGlobals* Instance; std::shared_ptr context; std::shared_ptr gSaveStateMgr; std::shared_ptr gRandomizer; std::shared_ptr gRandoContext; - ImFont* defaultFontSmaller; - ImFont* defaultFontLarger; - ImFont* defaultFontLargest; + ImFont* defaultFontSmaller; + ImFont* defaultFontLarger; + ImFont* defaultFontLargest; - OTRGlobals(); - ~OTRGlobals(); - - void ScaleImGui(); + OTRGlobals(); + ~OTRGlobals(); - bool HasMasterQuest(); - bool HasOriginal(); - uint32_t GetInterpolationFPS(); - std::shared_ptr> ListFiles(std::string path); + void ScaleImGui(); -private: - void CheckSaveFile(size_t sramSize) const; - bool hasMasterQuest; - bool hasOriginal; - ImFont* CreateDefaultFontWithSize(float size); + bool HasMasterQuest(); + bool HasOriginal(); + uint32_t GetInterpolationFPS(); + std::shared_ptr> ListFiles(std::string path); + + private: + void CheckSaveFile(size_t sramSize) const; + bool hasMasterQuest; + bool hasOriginal; + ImFont* CreateDefaultFontWithSize(float size); }; - -uint32_t IsGameMasterQuest(); #endif -#define CVAR_RANDOMIZER_ENHANCEMENT(var) CVAR_PREFIX_RANDOMIZER_ENHANCEMENT "." var -#define CVAR_RANDOMIZER_SETTING(var) CVAR_PREFIX_RANDOMIZER_SETTING "." var -#define CVAR_COSMETIC(var) CVAR_PREFIX_COSMETIC "." var -#define CVAR_AUDIO(var) CVAR_PREFIX_AUDIO "." var -#define CVAR_CHEAT(var) CVAR_PREFIX_CHEAT "." var -#define CVAR_ENHANCEMENT(var) CVAR_PREFIX_ENHANCEMENT "." var -#define CVAR_SETTING(var) CVAR_PREFIX_SETTING "." var -#define CVAR_WINDOW(var) CVAR_PREFIX_WINDOW "." var -#define CVAR_TRACKER(var) CVAR_PREFIX_TRACKER "." var -#define CVAR_TRACKER_ITEM(var) CVAR_TRACKER(".ItemTracker." var) -#define CVAR_TRACKER_CHECK(var) CVAR_TRACKER(".CheckTracker." var) -#define CVAR_TRACKER_ENTRANCE(var) CVAR_TRACKER(".EntranceTracker." var) -#define CVAR_DEVELOPER_TOOLS(var) CVAR_PREFIX_DEVELOPER_TOOLS "." var -#define CVAR_GENERAL(var) CVAR_PREFIX_GENERAL "." var -#define CVAR_REMOTE(var) CVAR_PREFIX_REMOTE "." var -#define CVAR_REMOTE_CROWD_CONTROL(var) CVAR_REMOTE(".CrowdControl." var) -#define CVAR_REMOTE_SAIL(var) CVAR_REMOTE(".Sail." var) - #ifndef __cplusplus - void InitOTR(void); +void InitOTR(void); void DeinitOTR(void); void VanillaItemTable_Init(); void OTRAudio_Init(); @@ -109,53 +87,12 @@ void OTRGfxPrint(const char* str, void* printer, void (*printImpl)(void*, char)) void OTRGetPixelDepthPrepare(float x, float y); uint16_t OTRGetPixelDepth(float x, float y); int32_t OTRGetLastScancode(); -uint32_t ResourceMgr_IsGameMasterQuest(); -uint32_t ResourceMgr_IsSceneMasterQuest(s16 sceneNum); -uint32_t ResourceMgr_GameHasMasterQuest(); -uint32_t ResourceMgr_GameHasOriginal(); -uint32_t ResourceMgr_GetNumGameVersions(); -uint32_t ResourceMgr_GetGameVersion(int index); -uint32_t ResourceMgr_GetGamePlatform(int index); -uint32_t ResourceMgr_GetGameRegion(int index); -void ResourceMgr_LoadDirectory(const char* resName); -void ResourceMgr_UnloadResource(const char* resName); -char** ResourceMgr_ListFiles(const char* searchMask, int* resultSize); -uint8_t ResourceMgr_FileExists(const char* resName); -uint8_t ResourceMgr_FileAltExists(const char* resName); -void ResourceMgr_UnloadOriginalWhenAltExists(const char* resName); char* GetResourceDataByNameHandlingMQ(const char* path); -uint8_t ResourceMgr_TexIsRaw(const char* texPath); -uint8_t ResourceMgr_ResourceIsBackground(char* texPath); -char* ResourceMgr_LoadJPEG(char* data, size_t dataSize); -uint16_t ResourceMgr_LoadTexWidthByName(char* texPath); -uint16_t ResourceMgr_LoadTexHeightByName(char* texPath); -char* ResourceMgr_LoadTexOrDListByName(const char* filePath); -char* ResourceMgr_LoadPlayerAnimByName(const char* animPath); -AnimationHeaderCommon* ResourceMgr_LoadAnimByName(const char* path); -char* ResourceMgr_GetNameByCRC(uint64_t crc, char* alloc); -Gfx* ResourceMgr_LoadGfxByCRC(uint64_t crc); -Gfx* ResourceMgr_LoadGfxByName(const char* path); -uint8_t ResourceMgr_FileIsCustomByName(const char* path); -void ResourceMgr_PatchGfxByName(const char* path, const char* patchName, int index, Gfx instruction); -void ResourceMgr_UnpatchGfxByName(const char* path, const char* patchName); -char* ResourceMgr_LoadArrayByNameAsVec3s(const char* path); -Vtx* ResourceMgr_LoadVtxByCRC(uint64_t crc); -Vtx* ResourceMgr_LoadVtxByName(char* path); -SoundFont* ResourceMgr_LoadAudioSoundFont(const char* path); -SequenceData ResourceMgr_LoadSeqByName(const char* path); -SoundFontSample* ResourceMgr_LoadAudioSample(const char* path); -CollisionHeader* ResourceMgr_LoadColByName(const char* path); void Ctx_ReadSaveFile(uintptr_t addr, void* dramAddr, size_t size); void Ctx_WriteSaveFile(uintptr_t addr, void* dramAddr, size_t size); uint64_t GetPerfCounter(); -bool ResourceMgr_IsAltAssetsEnabled(); -struct SkeletonHeader* ResourceMgr_LoadSkeletonByName(const char* path, SkelAnime* skelAnime); -void ResourceMgr_UnregisterSkeleton(SkelAnime* skelAnime); -void ResourceMgr_ClearSkeletons(); -s32* ResourceMgr_LoadCSByName(const char* path); -int ResourceMgr_OTRSigCheck(char* imgData); uint64_t osGetTime(void); uint32_t osGetCount(void); uint32_t OTRGetCurrentWidth(void); diff --git a/soh/soh/ResourceManagerHelpers.cpp b/soh/soh/ResourceManagerHelpers.cpp new file mode 100644 index 000000000..45ed269f7 --- /dev/null +++ b/soh/soh/ResourceManagerHelpers.cpp @@ -0,0 +1,505 @@ +#include "ResourceManagerHelpers.h" +#include "OTRGlobals.h" +#include "variables.h" +#include "z64.h" +#include "cvar_prefixes.h" +#include "Enhancements/enhancementTypes.h" +#include "Enhancements/randomizer/dungeon.h" +#include +#include +#include "resource/type/SohResourceType.h" +#include "resource/type/Array.h" +#include "resource/type/Skeleton.h" +#include "resource/type/PlayerAnimation.h" +#include +#include + +extern "C" PlayState* gPlayState; + +extern "C" uint32_t ResourceMgr_GetNumGameVersions() { + return Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions().size(); +} + +extern "C" uint32_t ResourceMgr_GetGameVersion(int index) { + return Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions()[index]; +} + +extern "C" uint32_t ResourceMgr_GetGamePlatform(int index) { + uint32_t version = Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions()[index]; + + switch (version) { + case OOT_NTSC_US_10: + case OOT_NTSC_US_11: + case OOT_NTSC_US_12: + case OOT_PAL_10: + case OOT_PAL_11: + return GAME_PLATFORM_N64; + case OOT_NTSC_JP_GC: + case OOT_NTSC_US_GC: + case OOT_PAL_GC: + case OOT_NTSC_JP_MQ: + case OOT_NTSC_US_MQ: + case OOT_PAL_MQ: + case OOT_PAL_GC_DBG1: + case OOT_PAL_GC_DBG2: + case OOT_PAL_GC_MQ_DBG: + return GAME_PLATFORM_GC; + } +} + +extern "C" uint32_t ResourceMgr_GetGameRegion(int index) { + uint32_t version = Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions()[index]; + + switch (version) { + case OOT_NTSC_US_10: + case OOT_NTSC_US_11: + case OOT_NTSC_US_12: + case OOT_NTSC_JP_GC: + case OOT_NTSC_US_GC: + case OOT_NTSC_JP_MQ: + case OOT_NTSC_US_MQ: + return GAME_REGION_NTSC; + case OOT_PAL_10: + case OOT_PAL_11: + case OOT_PAL_GC: + case OOT_PAL_MQ: + case OOT_PAL_GC_DBG1: + case OOT_PAL_GC_DBG2: + case OOT_PAL_GC_MQ_DBG: + return GAME_REGION_PAL; + } +} + +u32 IsSceneMasterQuest(s16 sceneNum) { + u8 mqMode = CVarGetInteger(CVAR_GENERAL("BetterDebugWarpScreenMQMode"), WARP_MODE_OVERRIDE_OFF); + if (mqMode == WARP_MODE_OVERRIDE_MQ_AS_VANILLA) { + return true; + } + + if (mqMode == WARP_MODE_OVERRIDE_VANILLA_AS_MQ) { + return false; + } + + if (OTRGlobals::Instance->HasMasterQuest()) { + if (!OTRGlobals::Instance->HasOriginal()) { + return true; + } + + if (IS_MASTER_QUEST) { + return true; + } + + if (IS_RANDO) { + auto dungeon = OTRGlobals::Instance->gRandoContext->GetDungeons()->GetDungeonFromScene(sceneNum); + if (dungeon != nullptr && dungeon->IsMQ()) { + return true; + } + } + } + + return false; +} + +extern "C" uint32_t ResourceMgr_GameHasMasterQuest() { + return OTRGlobals::Instance->HasMasterQuest(); +} + +extern "C" uint32_t ResourceMgr_GameHasOriginal() { + return OTRGlobals::Instance->HasOriginal(); +} + +extern "C" uint32_t ResourceMgr_IsSceneMasterQuest(s16 sceneNum) { + return IsSceneMasterQuest(sceneNum); +} + +extern "C" uint32_t ResourceMgr_IsGameMasterQuest() { + return gPlayState != NULL ? IsSceneMasterQuest(gPlayState->sceneNum) : 0; +} + +extern "C" void ResourceMgr_LoadDirectory(const char* resName) { + Ship::Context::GetInstance()->GetResourceManager()->LoadDirectory(resName); +} + +extern "C" void ResourceMgr_DirtyDirectory(const char* resName) { + Ship::Context::GetInstance()->GetResourceManager()->DirtyDirectory(resName); +} + +extern "C" void ResourceMgr_UnloadResource(const char* resName) { + std::string path = resName; + if (path.substr(0, 7) == "__OTR__") { + path = path.substr(7); + } + auto res = Ship::Context::GetInstance()->GetResourceManager()->UnloadResource(path); +} + +// OTRTODO: There is probably a more elegant way to go about this... +// Kenix: This is definitely leaking memory when it's called. +extern "C" char** ResourceMgr_ListFiles(const char* searchMask, int* resultSize) { + auto lst = Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->ListFiles(searchMask); + char** result = (char**)malloc(lst->size() * sizeof(char*)); + + for (size_t i = 0; i < lst->size(); i++) { + char* str = (char*)malloc(lst.get()[0][i].size() + 1); + memcpy(str, lst.get()[0][i].data(), lst.get()[0][i].size()); + str[lst.get()[0][i].size()] = '\0'; + result[i] = str; + } + *resultSize = lst->size(); + + return result; +} + +extern "C" uint8_t ResourceMgr_FileExists(const char* filePath) { + std::string path = filePath; + if(path.substr(0, 7) == "__OTR__"){ + path = path.substr(7); + } + + return ExtensionCache.contains(path); +} + +extern "C" uint8_t ResourceMgr_FileAltExists(const char* filePath) { + std::string path = filePath; + if (path.substr(0, 7) == "__OTR__") { + path = path.substr(7); + } + + if (path.substr(0, 4) != "alt/") { + path = "alt/" + path; + } + + return ExtensionCache.contains(path); +} + +extern "C" bool ResourceMgr_IsAltAssetsEnabled() { + return Ship::Context::GetInstance()->GetResourceManager()->IsAltAssetsEnabled(); +} + +// Unloads a resource if an alternate version exists when alt assets are enabled +// The resource is only removed from the internal cache to prevent it from used in the next resource lookup +extern "C" void ResourceMgr_UnloadOriginalWhenAltExists(const char* resName) { + if (ResourceMgr_IsAltAssetsEnabled() && ResourceMgr_FileAltExists((char*)resName)) { + ResourceMgr_UnloadResource((char*) resName); + } +} + +std::shared_ptr ResourceMgr_GetResourceByNameHandlingMQ(const char* path) { + std::string Path = path; + if (ResourceMgr_IsGameMasterQuest()) { + size_t pos = 0; + if ((pos = Path.find("/nonmq/", 0)) != std::string::npos) { + Path.replace(pos, 7, "/mq/"); + } + } + return Ship::Context::GetInstance()->GetResourceManager()->LoadResource(Path.c_str()); +} + +extern "C" char* ResourceMgr_GetResourceDataByNameHandlingMQ(const char* path) { + auto res = ResourceMgr_GetResourceByNameHandlingMQ(path); + + if (res == nullptr) { + return nullptr; + } + + return (char*)res->GetRawPointer(); +} + +extern "C" uint8_t ResourceMgr_TexIsRaw(const char* texPath) { + auto res = std::static_pointer_cast(ResourceMgr_GetResourceByNameHandlingMQ(texPath)); + return res->Flags & TEX_FLAG_LOAD_AS_RAW; +} + +extern "C" uint8_t ResourceMgr_ResourceIsBackground(char* texPath) { + auto res = ResourceMgr_GetResourceByNameHandlingMQ(texPath); + return res->GetInitData()->Type == static_cast(SOH::ResourceType::SOH_Background); +} + +extern "C" char* ResourceMgr_LoadJPEG(char* data, size_t dataSize) { + static char* finalBuffer = 0; + + if (finalBuffer == 0) { + finalBuffer = (char*)malloc(dataSize); + } + + int w; + int h; + int comp; + + unsigned char* pixels = stbi_load_from_memory((const unsigned char*)data, 320 * 240 * 2, &w, &h, &comp, STBI_rgb_alpha); + //unsigned char* pixels = stbi_load_from_memory((const unsigned char*)data, 480 * 240 * 2, &w, &h, &comp, STBI_rgb_alpha); + int idx = 0; + + for (int y = 0; y < h; y++) { + for (int x = 0; x < w; x++) { + uint16_t* bufferTest = (uint16_t*)finalBuffer; + int pixelIdx = ((y * w) + x) * 4; + + uint8_t r = pixels[pixelIdx + 0] / 8; + uint8_t g = pixels[pixelIdx + 1] / 8; + uint8_t b = pixels[pixelIdx + 2] / 8; + + uint8_t alphaBit = pixels[pixelIdx + 3] != 0; + + uint16_t data = (r << 11) + (g << 6) + (b << 1) + alphaBit; + + finalBuffer[idx++] = (data & 0xFF00) >> 8; + finalBuffer[idx++] = (data & 0x00FF); + } + } + + return (char*)finalBuffer; +} + +extern "C" char* ResourceMgr_LoadTexOrDListByName(const char* filePath) { + auto res = ResourceMgr_GetResourceByNameHandlingMQ(filePath); + + if (res->GetInitData()->Type == static_cast(LUS::ResourceType::DisplayList)) { + return (char*)&((std::static_pointer_cast(res))->Instructions[0]); + } + + if (res->GetInitData()->Type == static_cast(SOH::ResourceType::SOH_Array)) { + return (char*)(std::static_pointer_cast(res))->Vertices.data(); + } + + return (char*)ResourceMgr_GetResourceDataByNameHandlingMQ(filePath); +} + +extern "C" char* ResourceMgr_LoadIfDListByName(const char* filePath) { + auto res = ResourceMgr_GetResourceByNameHandlingMQ(filePath); + + if (res->GetInitData()->Type == static_cast(LUS::ResourceType::DisplayList)) { + return (char*)&((std::static_pointer_cast(res))->Instructions[0]); + } + + return nullptr; +} + +extern "C" char* ResourceMgr_LoadPlayerAnimByName(const char* animPath) { + auto anim = std::static_pointer_cast(ResourceMgr_GetResourceByNameHandlingMQ(animPath)); + + return (char*)&anim->limbRotData[0]; +} + +extern "C" void ResourceMgr_PushCurrentDirectory(char* path) { + gfx_push_current_dir(path); +} + +extern "C" Gfx* ResourceMgr_LoadGfxByName(const char* path) { + // When an alt resource exists for the DL, we need to unload the original asset + // to clear the cache so the alt asset will be loaded instead + // OTRTODO: If Alt loading over original cache is fixed, this line can most likely be removed + ResourceMgr_UnloadOriginalWhenAltExists(path); + + auto res = std::static_pointer_cast(ResourceMgr_GetResourceByNameHandlingMQ(path)); + return (Gfx*)&res->Instructions[0]; +} + +extern "C" uint8_t ResourceMgr_FileIsCustomByName(const char* path) { + auto res = std::static_pointer_cast(ResourceMgr_GetResourceByNameHandlingMQ(path)); + return res->GetInitData()->IsCustom; +} + +typedef struct { + int index; + Gfx instruction; +} GfxPatch; + +std::unordered_map> originalGfx; + +// Attention! This is primarily for cosmetics & bug fixes. For things like mods and model replacement you should be using OTRs +// instead (When that is available). Index can be found using the commented out section below. +extern "C" void ResourceMgr_PatchGfxByName(const char* path, const char* patchName, int index, Gfx instruction) { + auto res = std::static_pointer_cast( + Ship::Context::GetInstance()->GetResourceManager()->LoadResource(path)); + + // Leaving this here for people attempting to find the correct Dlist index to patch + /*if (strcmp("__OTR__objects/object_gi_longsword/gGiBiggoronSwordDL", path) == 0) { + for (int i = 0; i < res->instructions.size(); i++) { + Gfx* gfx = (Gfx*)&res->instructions[i]; + // Log all commands + // SPDLOG_INFO("index:{} command:{}", i, gfx->words.w0 >> 24); + // Log only SetPrimColors + if (gfx->words.w0 >> 24 == 250) { + SPDLOG_INFO("index:{} r:{} g:{} b:{} a:{}", i, _SHIFTR(gfx->words.w1, 24, 8), _SHIFTR(gfx->words.w1, 16, 8), _SHIFTR(gfx->words.w1, 8, 8), _SHIFTR(gfx->words.w1, 0, 8)); + } + } + }*/ + + // Index refers to individual gfx words, which are half the size on 32-bit + // if (sizeof(uintptr_t) < 8) { + // index /= 2; + // } + + // Do not patch custom assets as they most likely do not have the same instructions as authentic assets + if (res->GetInitData()->IsCustom) { + return; + } + + Gfx* gfx = (Gfx*)&res->Instructions[index]; + + if (!originalGfx.contains(path) || !originalGfx[path].contains(patchName)) { + originalGfx[path][patchName] = { + index, + *gfx + }; + } + + *gfx = instruction; +} + +extern "C" void ResourceMgr_PatchGfxCopyCommandByName(const char* path, const char* patchName, int destinationIndex, int sourceIndex) { + auto res = std::static_pointer_cast( + Ship::Context::GetInstance()->GetResourceManager()->LoadResource(path)); + + // Do not patch custom assets as they most likely do not have the same instructions as authentic assets + if (res->GetInitData()->IsCustom) { + return; + } + + Gfx* destinationGfx = (Gfx*)&res->Instructions[destinationIndex]; + Gfx sourceGfx = *(Gfx*)&res->Instructions[sourceIndex]; + + if (!originalGfx.contains(path) || !originalGfx[path].contains(patchName)) { + originalGfx[path][patchName] = { + destinationIndex, + *destinationGfx + }; + } + + *destinationGfx = sourceGfx; +} + +extern "C" void ResourceMgr_UnpatchGfxByName(const char* path, const char* patchName) { + if (originalGfx.contains(path) && originalGfx[path].contains(patchName)) { + auto res = std::static_pointer_cast( + Ship::Context::GetInstance()->GetResourceManager()->LoadResource(path)); + + Gfx* gfx = (Gfx*)&res->Instructions[originalGfx[path][patchName].index]; + *gfx = originalGfx[path][patchName].instruction; + + originalGfx[path].erase(patchName); + } +} + +extern "C" char* ResourceMgr_LoadArrayByName(const char* path) { + auto res = std::static_pointer_cast(ResourceMgr_GetResourceByNameHandlingMQ(path)); + + return (char*)res->Scalars.data(); +} + +// Return of LoadArrayByNameAsVec3s must be freed by the caller +extern "C" char* ResourceMgr_LoadArrayByNameAsVec3s(const char* path) { + auto res = std::static_pointer_cast(ResourceMgr_GetResourceByNameHandlingMQ(path)); + + // if (res->CachedGameAsset != nullptr) + // return (char*)res->CachedGameAsset; + // else + // { + Vec3s* data = (Vec3s*)malloc(sizeof(Vec3s) * res->Scalars.size()); + + for (size_t i = 0; i < res->Scalars.size(); i += 3) { + data[(i / 3)].x = res->Scalars[i + 0].s16; + data[(i / 3)].y = res->Scalars[i + 1].s16; + data[(i / 3)].z = res->Scalars[i + 2].s16; + } + + // res->CachedGameAsset = data; + + return (char*)data; + // } +} + +extern "C" CollisionHeader* ResourceMgr_LoadColByName(const char* path) { + return (CollisionHeader*) ResourceGetDataByName(path); +} + +extern "C" Vtx* ResourceMgr_LoadVtxByName(char* path) { + return (Vtx*) ResourceGetDataByName(path); +} + +extern "C" SequenceData ResourceMgr_LoadSeqByName(const char* path) { + SequenceData* sequence = (SequenceData*) ResourceGetDataByName(path); + return *sequence; +} + +extern "C" SoundFontSample* ResourceMgr_LoadAudioSample(const char* path) { + return (SoundFontSample*) ResourceGetDataByName(path); +} + +extern "C" SoundFont* ResourceMgr_LoadAudioSoundFont(const char* path) { + return (SoundFont*) ResourceGetDataByName(path); +} + +extern "C" int ResourceMgr_OTRSigCheck(char* imgData) { + uintptr_t i = (uintptr_t)(imgData); + +// if (i == 0xD9000000 || i == 0xE7000000 || (i & 1) == 1) + if ((i & 1) == 1) + return 0; + +// if ((i & 0xFF000000) != 0xAB000000 && (i & 0xFF000000) != 0xCD000000 && i != 0) { + if (i != 0) { + if ( + imgData[0] == '_' && + imgData[1] == '_' && + imgData[2] == 'O' && + imgData[3] == 'T' && + imgData[4] == 'R' && + imgData[5] == '_' && + imgData[6] == '_' + ) { + return 1; + } + } + + return 0; +} + +extern "C" AnimationHeaderCommon* ResourceMgr_LoadAnimByName(const char* path) { + return (AnimationHeaderCommon*) ResourceGetDataByName(path); +} + +extern "C" SkeletonHeader* ResourceMgr_LoadSkeletonByName(const char* path, SkelAnime* skelAnime) { + std::string pathStr = std::string(path); + static const std::string sOtr = "__OTR__"; + + if (pathStr.starts_with(sOtr)) { + pathStr = pathStr.substr(sOtr.length()); + } + + bool isAlt = ResourceMgr_IsAltAssetsEnabled(); + + if (isAlt) { + pathStr = Ship::IResource::gAltAssetPrefix + pathStr; + } + + SkeletonHeader* skelHeader = (SkeletonHeader*) ResourceGetDataByName(pathStr.c_str()); + + // If there isn't an alternate model, load the regular one + if (isAlt && skelHeader == NULL) { + skelHeader = (SkeletonHeader*) ResourceGetDataByName(path); + } + + // This function is only called when a skeleton is initialized. + // Therefore we can take this oppurtunity to take note of the Skeleton that is created... + if (skelAnime != nullptr) { + auto stringPath = std::string(path); + SOH::SkeletonPatcher::RegisterSkeleton(stringPath, skelAnime); + } + + return skelHeader; +} + +extern "C" void ResourceMgr_UnregisterSkeleton(SkelAnime* skelAnime) { + if (skelAnime != nullptr) { + SOH::SkeletonPatcher::UnregisterSkeleton(skelAnime); + } +} + +extern "C" void ResourceMgr_ClearSkeletons() { + SOH::SkeletonPatcher::ClearSkeletons(); +} + +extern "C" s32* ResourceMgr_LoadCSByName(const char* path) { + return (s32*)ResourceMgr_GetResourceDataByNameHandlingMQ(path); +} diff --git a/soh/soh/ResourceManagerHelpers.h b/soh/soh/ResourceManagerHelpers.h new file mode 100644 index 000000000..3b14188b7 --- /dev/null +++ b/soh/soh/ResourceManagerHelpers.h @@ -0,0 +1,66 @@ +#pragma once + +#include "libultraship/libultra/types.h" + +#define GAME_REGION_NTSC 0 +#define GAME_REGION_PAL 1 + +#define GAME_PLATFORM_N64 0 +#define GAME_PLATFORM_GC 1 + +#ifdef __cplusplus +#include +#include + +std::shared_ptr ResourceMgr_GetResourceByNameHandlingMQ(const char* path); + +extern "C" { +#endif // __cplusplus + #include "z64animation.h" + #include "z64audio.h" + #include "z64bgcheck.h" + uint32_t ResourceMgr_IsGameMasterQuest(); + uint32_t ResourceMgr_IsSceneMasterQuest(s16 sceneNum); + uint32_t ResourceMgr_GameHasMasterQuest(); + uint32_t ResourceMgr_GameHasOriginal(); + uint32_t ResourceMgr_GetNumGameVersions(); + uint32_t ResourceMgr_GetGameVersion(int index); + uint32_t ResourceMgr_GetGamePlatform(int index); + uint32_t ResourceMgr_GetGameRegion(int index); + void ResourceMgr_LoadDirectory(const char* resName); + void ResourceMgr_UnloadResource(const char* resName); + char** ResourceMgr_ListFiles(const char* searchMask, int* resultSize); + uint8_t ResourceMgr_FileExists(const char* resName); + uint8_t ResourceMgr_FileAltExists(const char* resName); + void ResourceMgr_UnloadOriginalWhenAltExists(const char* resName); + uint8_t ResourceMgr_TexIsRaw(const char* texPath); + uint8_t ResourceMgr_ResourceIsBackground(char* texPath); + char* ResourceMgr_LoadJPEG(char* data, size_t dataSize); + uint16_t ResourceMgr_LoadTexWidthByName(char* texPath); + uint16_t ResourceMgr_LoadTexHeightByName(char* texPath); + char* ResourceMgr_LoadTexOrDListByName(const char* filePath); + char* ResourceMgr_LoadPlayerAnimByName(const char* animPath); + AnimationHeaderCommon* ResourceMgr_LoadAnimByName(const char* path); + char* ResourceMgr_GetNameByCRC(uint64_t crc, char* alloc); + Gfx* ResourceMgr_LoadGfxByCRC(uint64_t crc); + Gfx* ResourceMgr_LoadGfxByName(const char* path); + uint8_t ResourceMgr_FileIsCustomByName(const char* path); + void ResourceMgr_PatchGfxByName(const char* path, const char* patchName, int index, Gfx instruction); + void ResourceMgr_UnpatchGfxByName(const char* path, const char* patchName); + char* ResourceMgr_LoadArrayByNameAsVec3s(const char* path); + Vtx* ResourceMgr_LoadVtxByCRC(uint64_t crc); + Vtx* ResourceMgr_LoadVtxByName(char* path); + SoundFont* ResourceMgr_LoadAudioSoundFont(const char* path); + SequenceData ResourceMgr_LoadSeqByName(const char* path); + SoundFontSample* ResourceMgr_LoadAudioSample(const char* path); + CollisionHeader* ResourceMgr_LoadColByName(const char* path); + bool ResourceMgr_IsAltAssetsEnabled(); + SkeletonHeader* ResourceMgr_LoadSkeletonByName(const char* path, SkelAnime* skelAnime); + void ResourceMgr_UnregisterSkeleton(SkelAnime* skelAnime); + void ResourceMgr_ClearSkeletons(); + s32* ResourceMgr_LoadCSByName(const char* path); + int ResourceMgr_OTRSigCheck(char* imgData); + char* ResourceMgr_GetResourceDataByNameHandlingMQ(const char* path); +#ifdef __cplusplus +} +#endif // __cplusplus \ No newline at end of file diff --git a/soh/soh/SaveManager.cpp b/soh/soh/SaveManager.cpp index 1e92cb3bf..f2cc04fe9 100644 --- a/soh/soh/SaveManager.cpp +++ b/soh/soh/SaveManager.cpp @@ -10,6 +10,7 @@ #include "Enhancements/randomizer/item.h" #include "z64.h" +#include "cvar_prefixes.h" #include "functions.h" #include "macros.h" #include diff --git a/soh/soh/SaveManager.h b/soh/soh/SaveManager.h index c17f3d125..1eb6ee87a 100644 --- a/soh/soh/SaveManager.h +++ b/soh/soh/SaveManager.h @@ -1,6 +1,7 @@ #pragma once #include +#include "z64save.h" #define SECTION_PARENT_NONE -1 typedef struct { @@ -45,8 +46,6 @@ typedef struct { #define BS_THREAD_POOL_ENABLE_PAUSE #include -#include "z64save.h" - #include class SaveManager { diff --git a/soh/soh/SohGui.cpp b/soh/soh/SohGui.cpp index 3c5e4e985..4280c8114 100644 --- a/soh/soh/SohGui.cpp +++ b/soh/soh/SohGui.cpp @@ -132,6 +132,7 @@ namespace SohGui { std::shared_ptr mItemTrackerSettingsWindow; std::shared_ptr mItemTrackerWindow; std::shared_ptr mTimeSplitWindow; + std::shared_ptr mPlandomizerWindow; std::shared_ptr mRandomizerSettingsWindow; std::shared_ptr mAdvancedResolutionSettingsWindow; std::shared_ptr mModalWindow; @@ -212,6 +213,8 @@ namespace SohGui { gui->AddGuiWindow(mRandomizerSettingsWindow); mTimeSplitWindow = std::make_shared(CVAR_WINDOW("TimeSplitEnabled"), "Time Splits", ImVec2(450, 660)); gui->AddGuiWindow(mTimeSplitWindow); + mPlandomizerWindow = std::make_shared(CVAR_WINDOW("PlandomizerWindow"), "Plandomizer Editor", ImVec2(850, 760)); + gui->AddGuiWindow(mPlandomizerWindow); mAdvancedResolutionSettingsWindow = std::make_shared(CVAR_WINDOW("AdvancedResolutionEditor"), "Advanced Resolution Settings", ImVec2(497, 599)); gui->AddGuiWindow(mAdvancedResolutionSettingsWindow); mModalWindow = std::make_shared(CVAR_WINDOW("ModalWindow"), "Modal Window"); @@ -258,6 +261,7 @@ namespace SohGui { mInputViewerSettings = nullptr; mTimeSplitWindow = nullptr; mCaladiusWindow = nullptr; + mPlandomizerWindow = nullptr; } void RegisterPopup(std::string title, std::string message, std::string button1, std::string button2, std::function button1callback, std::function button2callback) { diff --git a/soh/soh/SohGui.hpp b/soh/soh/SohGui.hpp index 1c8eecb79..5502b6757 100644 --- a/soh/soh/SohGui.hpp +++ b/soh/soh/SohGui.hpp @@ -25,6 +25,7 @@ #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 "SohModals.h" #ifdef __cplusplus diff --git a/soh/soh/SohMenuBar.cpp b/soh/soh/SohMenuBar.cpp index d8684fb61..28d68a16f 100644 --- a/soh/soh/SohMenuBar.cpp +++ b/soh/soh/SohMenuBar.cpp @@ -10,7 +10,9 @@ #include "include/z64audio.h" #include "graphic/Fast3D/gfx_rendering_api.h" #include "OTRGlobals.h" +#include "SaveManager.h" #include "z64.h" +#include "cvar_prefixes.h" #include "macros.h" #include "Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/presets.h" @@ -42,6 +44,7 @@ #include "Enhancements/enemyrandomizer.h" #include "Enhancements/timesplits/TimeSplits.h" #include "Enhancements/Holiday/Holiday.hpp" +#include "Enhancements/randomizer/Plandomizer.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 @@ -2047,6 +2050,7 @@ extern std::shared_ptr mEntranceTrackerWindow; extern std::shared_ptr mEntranceTrackerSettingsWindow; extern std::shared_ptr mCheckTrackerWindow; extern std::shared_ptr mCheckTrackerSettingsWindow; +extern std::shared_ptr mPlandomizerWindow; extern "C" u8 Randomizer_GetSettingValue(RandomizerSettingKey randoSettingKey); void DrawRandomizerMenu() { @@ -2076,6 +2080,14 @@ void DrawRandomizerMenu() { static float separationToOptionsButton = 5.0f; #endif + if (mPlandomizerWindow) { + if (ImGui::Button(GetWindowButtonText("Plandomizer Editor", CVarGetInteger(CVAR_WINDOW("PlandomizerWindow"), 0)).c_str(), buttonSize)) { + mPlandomizerWindow->ToggleVisibility(); + } + } + + UIWidgets::Spacer(0); + if (mRandomizerSettingsWindow) { if (ImGui::Button(GetWindowButtonText("Randomizer Settings", CVarGetInteger(CVAR_WINDOW("RandomizerSettings"), 0)).c_str(), buttonSize)) { mRandomizerSettingsWindow->ToggleVisibility(); diff --git a/soh/soh/cvar_prefixes.h b/soh/soh/cvar_prefixes.h new file mode 100644 index 000000000..6ddde97bd --- /dev/null +++ b/soh/soh/cvar_prefixes.h @@ -0,0 +1,17 @@ +#define CVAR_RANDOMIZER_ENHANCEMENT(var) CVAR_PREFIX_RANDOMIZER_ENHANCEMENT "." var +#define CVAR_RANDOMIZER_SETTING(var) CVAR_PREFIX_RANDOMIZER_SETTING "." var +#define CVAR_COSMETIC(var) CVAR_PREFIX_COSMETIC "." var +#define CVAR_AUDIO(var) CVAR_PREFIX_AUDIO "." var +#define CVAR_CHEAT(var) CVAR_PREFIX_CHEAT "." var +#define CVAR_ENHANCEMENT(var) CVAR_PREFIX_ENHANCEMENT "." var +#define CVAR_SETTING(var) CVAR_PREFIX_SETTING "." var +#define CVAR_WINDOW(var) CVAR_PREFIX_WINDOW "." var +#define CVAR_TRACKER(var) CVAR_PREFIX_TRACKER "." var +#define CVAR_TRACKER_ITEM(var) CVAR_TRACKER(".ItemTracker." var) +#define CVAR_TRACKER_CHECK(var) CVAR_TRACKER(".CheckTracker." var) +#define CVAR_TRACKER_ENTRANCE(var) CVAR_TRACKER(".EntranceTracker." var) +#define CVAR_DEVELOPER_TOOLS(var) CVAR_PREFIX_DEVELOPER_TOOLS "." var +#define CVAR_GENERAL(var) CVAR_PREFIX_GENERAL "." var +#define CVAR_REMOTE(var) CVAR_PREFIX_REMOTE "." var +#define CVAR_REMOTE_CROWD_CONTROL(var) CVAR_REMOTE(".CrowdControl." var) +#define CVAR_REMOTE_SAIL(var) CVAR_REMOTE(".Sail." var) \ No newline at end of file diff --git a/soh/soh/resource/logging/PathLogger.h b/soh/soh/resource/logging/PathLogger.h index a5e42aeaf..91274db76 100644 --- a/soh/soh/resource/logging/PathLogger.h +++ b/soh/soh/resource/logging/PathLogger.h @@ -1,5 +1,6 @@ #include "Resource.h" #include "soh/OTRGlobals.h" +#include "soh/cvar_prefixes.h" namespace SOH { void LogPathAsXML(std::shared_ptr resource); diff --git a/soh/soh/resource/logging/SceneCommandLoggers.h b/soh/soh/resource/logging/SceneCommandLoggers.h index f952ac766..d8a7ac2d5 100644 --- a/soh/soh/resource/logging/SceneCommandLoggers.h +++ b/soh/soh/resource/logging/SceneCommandLoggers.h @@ -1,5 +1,6 @@ #include "Resource.h" #include "soh/OTRGlobals.h" +#include "soh/cvar_prefixes.h" namespace SOH { diff --git a/soh/soh/z_play_otr.cpp b/soh/soh/z_play_otr.cpp index 22345af88..279b4e696 100644 --- a/soh/soh/z_play_otr.cpp +++ b/soh/soh/z_play_otr.cpp @@ -1,4 +1,5 @@ #include "OTRGlobals.h" +#include "ResourceManagerHelpers.h" #include #include "soh/resource/type/Scene.h" #include @@ -35,7 +36,7 @@ extern "C" void OTRPlay_SpawnScene(PlayState* play, s32 sceneId, s32 spawn) { std::string sceneVersion = "shared"; if (inNonSharedScene) { - sceneVersion = IsGameMasterQuest() ? "mq" : "nonmq"; + sceneVersion = ResourceMgr_IsGameMasterQuest() ? "mq" : "nonmq"; } std::string scenePath = StringHelper::Sprintf("scenes/%s/%s/%s", sceneVersion.c_str(), scene->sceneFile.fileName, scene->sceneFile.fileName); diff --git a/soh/soh/z_scene_otr.cpp b/soh/soh/z_scene_otr.cpp index 7422ee6e1..4e05cd7a8 100644 --- a/soh/soh/z_scene_otr.cpp +++ b/soh/soh/z_scene_otr.cpp @@ -1,4 +1,5 @@ #include "OTRGlobals.h" +#include "ResourceManagerHelpers.h" #include #include "soh/resource/type/Scene.h" #include @@ -39,9 +40,6 @@ extern "C" s32 Object_Spawn(ObjectContext* objectCtx, s16 objectId); extern "C" RomFile sNaviMsgFiles[]; s32 OTRScene_ExecuteCommands(PlayState* play, SOH::Scene* scene); -// Forward Declaration of function declared in OTRGlobals.cpp -std::shared_ptr GetResourceByNameHandlingMQ(const char* path); - bool Scene_CommandSpawnList(PlayState* play, SOH::ISceneCommand* cmd) { // SOH::SetStartPositionList* cmdStartPos = std::static_pointer_cast(cmd); SOH::SetStartPositionList* cmdStartPos = (SOH::SetStartPositionList*)cmd; @@ -512,7 +510,7 @@ extern "C" s32 OTRfunc_8009728C(PlayState* play, RoomContext* roomCtx, s32 roomN //&roomCtx->loadQueue, NULL, __FILE__, __LINE__); auto roomData = - std::static_pointer_cast(GetResourceByNameHandlingMQ(play->roomList[roomNum].fileName)); + std::static_pointer_cast(ResourceMgr_GetResourceByNameHandlingMQ(play->roomList[roomNum].fileName)); roomCtx->status = 1; roomCtx->roomToLoad = roomData.get(); diff --git a/soh/src/code/audio_load.c b/soh/src/code/audio_load.c index cb7ba60bb..3c7224612 100644 --- a/soh/src/code/audio_load.c +++ b/soh/src/code/audio_load.c @@ -7,6 +7,7 @@ #include "soh/OTRGlobals.h" #include "soh/Enhancements/audio/AudioCollection.h" #include "soh/Enhancements/audio/AudioEditor.h" +#include "soh/ResourceManagerHelpers.h" #define MK_ASYNC_MSG(retData, tableType, id, status) (((retData) << 24) | ((tableType) << 16) | ((id) << 8) | (status)) #define ASYNC_TBLTYPE(v) ((u8)(v >> 16)) diff --git a/soh/src/code/audio_playback.c b/soh/src/code/audio_playback.c index 39be0c3a7..3b3089e2c 100644 --- a/soh/src/code/audio_playback.c +++ b/soh/src/code/audio_playback.c @@ -1,4 +1,5 @@ #include "global.h" +#include "soh/ResourceManagerHelpers.h" #include extern bool gUseLegacySD; diff --git a/soh/src/code/audio_seqplayer.c b/soh/src/code/audio_seqplayer.c index 8d484575d..e194fd28b 100644 --- a/soh/src/code/audio_seqplayer.c +++ b/soh/src/code/audio_seqplayer.c @@ -4,6 +4,7 @@ #include "global.h" #include "soh/Enhancements/audio/AudioEditor.h" +#include "soh/ResourceManagerHelpers.h" extern char** sequenceMap; diff --git a/soh/src/code/code_800EC960.c b/soh/src/code/code_800EC960.c index 90e49bbd3..d8da87bb4 100644 --- a/soh/src/code/code_800EC960.c +++ b/soh/src/code/code_800EC960.c @@ -1,5 +1,6 @@ #include #include "global.h" +#include "soh/OTRGlobals.h" #include "soh/Enhancements/audio/AudioEditor.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" diff --git a/soh/src/code/game.c b/soh/src/code/game.c index 90438b5db..a14266719 100644 --- a/soh/src/code/game.c +++ b/soh/src/code/game.c @@ -4,6 +4,7 @@ #include "libultraship/bridge.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" SpeedMeter D_801664D0; VisCvg sVisCvg; diff --git a/soh/src/code/gfxprint.c b/soh/src/code/gfxprint.c index 6d8686074..42e9c3e16 100644 --- a/soh/src/code/gfxprint.c +++ b/soh/src/code/gfxprint.c @@ -1,5 +1,7 @@ #include "global.h" #include "align_asset_macro.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" u16 sGfxPrintFontTLUT[64] = { 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, diff --git a/soh/src/code/padmgr.c b/soh/src/code/padmgr.c index 57dd2c6f7..8665fb448 100644 --- a/soh/src/code/padmgr.c +++ b/soh/src/code/padmgr.c @@ -3,6 +3,8 @@ #include #include "soh/Enhancements/game-interactor/GameInteractor.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" s32 D_8012D280 = 1; diff --git a/soh/src/code/z_actor.c b/soh/src/code/z_actor.c index 1c514f92f..e00fa81bf 100644 --- a/soh/src/code/z_actor.c +++ b/soh/src/code/z_actor.c @@ -13,6 +13,7 @@ #include "soh/Enhancements/nametag.h" #include "soh/ActorDB.h" +#include "soh/OTRGlobals.h" #include #include diff --git a/soh/src/code/z_bgcheck.c b/soh/src/code/z_bgcheck.c index 2a385f966..df7dd0600 100644 --- a/soh/src/code/z_bgcheck.c +++ b/soh/src/code/z_bgcheck.c @@ -1,7 +1,8 @@ #include "global.h" #include "vt.h" -#include +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include #define SS_NULL 0xFFFF diff --git a/soh/src/code/z_cheap_proc.c b/soh/src/code/z_cheap_proc.c index cf52db2d3..4af2867e5 100644 --- a/soh/src/code/z_cheap_proc.c +++ b/soh/src/code/z_cheap_proc.c @@ -1,4 +1,5 @@ #include "global.h" +#include "soh/ResourceManagerHelpers.h" void Gfx_DrawDListOpa(PlayState* play, Gfx* dlist) { OPEN_DISPS(play->state.gfxCtx); diff --git a/soh/src/code/z_demo.c b/soh/src/code/z_demo.c index 5c2348829..2129dbf10 100644 --- a/soh/src/code/z_demo.c +++ b/soh/src/code/z_demo.c @@ -32,6 +32,8 @@ #include "scenes/misc/hakaana_ouke/hakaana_ouke_scene.h" #include "soh/Enhancements/randomizer/randomizer_entrance.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" u16 D_8011E1C0 = 0; diff --git a/soh/src/code/z_elf_message.c b/soh/src/code/z_elf_message.c index e586c1bcc..91f00105f 100644 --- a/soh/src/code/z_elf_message.c +++ b/soh/src/code/z_elf_message.c @@ -1,6 +1,7 @@ #include "global.h" #include "z64elf_message.h" #include +#include "soh/OTRGlobals.h" ElfMessage sChildSariaMsgs[] = { ELF_MSG_STRENGTH_UPG(SKIP, 3, false, 0), diff --git a/soh/src/code/z_en_item00.c b/soh/src/code/z_en_item00.c index 9e2ec53cf..93e5fad42 100644 --- a/soh/src/code/z_en_item00.c +++ b/soh/src/code/z_en_item00.c @@ -4,6 +4,7 @@ #include "overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.h" #include "textures/icon_item_static/icon_item_static.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" +#include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS 0 diff --git a/soh/src/code/z_fbdemo_circle.c b/soh/src/code/z_fbdemo_circle.c index 8d92b03f9..f077d5171 100644 --- a/soh/src/code/z_fbdemo_circle.c +++ b/soh/src/code/z_fbdemo_circle.c @@ -1,5 +1,7 @@ #include "global.h" #include +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" // unused Gfx sCircleNullDList[] = { diff --git a/soh/src/code/z_fcurve_data_skelanime.c b/soh/src/code/z_fcurve_data_skelanime.c index c75450be2..3daa6528a 100644 --- a/soh/src/code/z_fcurve_data_skelanime.c +++ b/soh/src/code/z_fcurve_data_skelanime.c @@ -1,5 +1,6 @@ #include "global.h" #include +#include "soh/ResourceManagerHelpers.h" void SkelCurve_Clear(SkelAnimeCurve* skelCurve) { skelCurve->limbCount = 0; diff --git a/soh/src/code/z_game_over.c b/soh/src/code/z_game_over.c index 2d46a1899..a2bdfc1a5 100644 --- a/soh/src/code/z_game_over.c +++ b/soh/src/code/z_game_over.c @@ -1,4 +1,5 @@ #include "global.h" +#include "soh/OTRGlobals.h" void GameOver_Init(PlayState* play) { play->gameOverCtx.state = GAMEOVER_INACTIVE; diff --git a/soh/src/code/z_kankyo.c b/soh/src/code/z_kankyo.c index aed323533..ad4883a77 100644 --- a/soh/src/code/z_kankyo.c +++ b/soh/src/code/z_kankyo.c @@ -4,6 +4,8 @@ #include "objects/gameplay_keep/gameplay_keep.h" #include "objects/gameplay_field_keep/gameplay_field_keep.h" #include "soh/frame_interpolation.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" typedef enum { /* 0 */ LENS_FLARE_CIRCLE0, diff --git a/soh/src/code/z_lifemeter.c b/soh/src/code/z_lifemeter.c index 15d136eab..52742bc62 100644 --- a/soh/src/code/z_lifemeter.c +++ b/soh/src/code/z_lifemeter.c @@ -1,6 +1,7 @@ #include "global.h" #include "textures/parameter_static/parameter_static.h" #include "soh/frame_interpolation.h" +#include "soh/OTRGlobals.h" s16 Top_LM_Margin = 0; s16 Left_LM_Margin = 0; diff --git a/soh/src/code/z_lights.c b/soh/src/code/z_lights.c index aed55eda0..d45d10cc9 100644 --- a/soh/src/code/z_lights.c +++ b/soh/src/code/z_lights.c @@ -5,6 +5,7 @@ #include "objects/gameplay_keep/gameplay_keep.h" #include "soh/frame_interpolation.h" +#include "soh/OTRGlobals.h" #define LIGHTS_BUFFER_SIZE 32 //#define LIGHTS_BUFFER_SIZE 1024 // Kill me diff --git a/soh/src/code/z_map_exp.c b/soh/src/code/z_map_exp.c index 637823b57..be358f075 100644 --- a/soh/src/code/z_map_exp.c +++ b/soh/src/code/z_map_exp.c @@ -5,6 +5,7 @@ #include "textures/map_i_static/map_i_static.h" #include "textures/map_grand_static/map_grand_static.h" #include +#include "soh/OTRGlobals.h" MapData* gMapData; diff --git a/soh/src/code/z_map_mark.c b/soh/src/code/z_map_mark.c index df8ef4464..1831b8fdd 100644 --- a/soh/src/code/z_map_mark.c +++ b/soh/src/code/z_map_mark.c @@ -1,6 +1,8 @@ #include "global.h" #include "vt.h" #include "textures/parameter_static/parameter_static.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" typedef struct { /* 0x00 */ void* texture; diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index aeeaed138..8cd28d4df 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -21,6 +21,9 @@ #include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include "soh/Enhancements/randomizer/randomizer_grotto.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" +#include "soh/Enhancements/gameplaystats.h" #define DO_ACTION_TEX_WIDTH() 48 #define DO_ACTION_TEX_HEIGHT() 16 diff --git a/soh/src/code/z_play.c b/soh/src/code/z_play.c index 369f0a11a..920136057 100644 --- a/soh/src/code/z_play.c +++ b/soh/src/code/z_play.c @@ -11,6 +11,8 @@ #include #include "soh/Enhancements/enhancementTypes.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/OTRGlobals.h" +#include "soh/SaveManager.h" #include "soh/framebuffer_effects.h" #include diff --git a/soh/src/code/z_player_lib.c b/soh/src/code/z_player_lib.c index ce44011f4..f44f21a18 100644 --- a/soh/src/code/z_player_lib.c +++ b/soh/src/code/z_player_lib.c @@ -8,6 +8,7 @@ #include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/randomizer/draw.h" +#include "soh/ResourceManagerHelpers.h" #include #include @@ -1761,7 +1762,7 @@ Vec3f sLeftHandArrowVec3 = { 398.0f, 1419.0f, 244.0f }; BowStringData sBowStringData[] = { { gLinkAdultBowStringDL, { 0.0f, -360.4f, 0.0f } }, // bow - { gLinkChildSlinghotStringDL, { 606.0f, 236.0f, 0.0f } }, // slingshot + { gLinkChildSlingshotStringDL, { 606.0f, 236.0f, 0.0f } }, // slingshot }; Vec3f sRightHandLimbModelShieldQuadVertices[] = { diff --git a/soh/src/code/z_rcp.c b/soh/src/code/z_rcp.c index 978c04d3c..767772949 100644 --- a/soh/src/code/z_rcp.c +++ b/soh/src/code/z_rcp.c @@ -1,5 +1,6 @@ #include "global.h" #include +#include "soh/OTRGlobals.h" Gfx sSetupDL[SETUPDL_MAX][6] = { { diff --git a/soh/src/code/z_room.c b/soh/src/code/z_room.c index 1478d50f8..2e8cdc655 100644 --- a/soh/src/code/z_room.c +++ b/soh/src/code/z_room.c @@ -9,6 +9,8 @@ #include #include "public/bridge/gfxbridge.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" void func_80095AB4(PlayState* play, Room* room, u32 flags); void func_80095D04(PlayState* play, Room* room, u32 flags); diff --git a/soh/src/code/z_scene_table.c b/soh/src/code/z_scene_table.c index 9cb9a31d7..c7d76db01 100644 --- a/soh/src/code/z_scene_table.c +++ b/soh/src/code/z_scene_table.c @@ -25,6 +25,8 @@ #include "soh/mq_asset_hacks.h" #include "soh/Enhancements/randomizer/adult_trade_shuffle.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" // Entrance Table definition #define DEFINE_ENTRANCE(_0, sceneId, spawn, continueBgm, displayTitleCard, endTransType, startTransType) \ diff --git a/soh/src/code/z_skelanime.c b/soh/src/code/z_skelanime.c index 0bcf39236..e91de847b 100644 --- a/soh/src/code/z_skelanime.c +++ b/soh/src/code/z_skelanime.c @@ -3,6 +3,8 @@ #include #include #include +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #define ANIM_INTERP 1 diff --git a/soh/src/code/z_skin_awb.c b/soh/src/code/z_skin_awb.c index d0ebe75b4..3627797b4 100644 --- a/soh/src/code/z_skin_awb.c +++ b/soh/src/code/z_skin_awb.c @@ -1,6 +1,7 @@ #include "global.h" #include "overlays/actors/ovl_En_fHG/z_en_fhg.h" #include +#include "soh/ResourceManagerHelpers.h" /** * Initialises the Vtx buffers used for limb at index `limbIndex` diff --git a/soh/src/code/z_sram.c b/soh/src/code/z_sram.c index 388d59ec9..e7e43a823 100644 --- a/soh/src/code/z_sram.c +++ b/soh/src/code/z_sram.c @@ -5,6 +5,8 @@ #include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include "soh/Enhancements/randomizer/savefile.h" +#include "soh/OTRGlobals.h" +#include "soh/SaveManager.h" #define NUM_DUNGEONS 8 #define NUM_COWS 10 diff --git a/soh/src/code/z_ss_sram.c b/soh/src/code/z_ss_sram.c index 51f28a068..8cea4b5d4 100644 --- a/soh/src/code/z_ss_sram.c +++ b/soh/src/code/z_ss_sram.c @@ -1,5 +1,6 @@ #include #include "global.h" +#include "soh/OTRGlobals.h" #include #include diff --git a/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c b/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c index ba75c10e8..9f89e7980 100644 --- a/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c +++ b/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c @@ -8,6 +8,7 @@ #include "scenes/dungeons/ddan/ddan_scene.h" #include "objects/object_bwall/object_bwall.h" #include "objects/object_kingdodongo/object_kingdodongo.h" +#include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" diff --git a/soh/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c b/soh/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c index 799a46c62..fecb650bf 100644 --- a/soh/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c +++ b/soh/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c @@ -11,6 +11,8 @@ #include "scenes/indoors/yousei_izumi_yoko/yousei_izumi_yoko_scene.h" #include "scenes/indoors/daiyousei_izumi/daiyousei_izumi_scene.h" #include "soh/frame_interpolation.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED | ACTOR_FLAG_NO_FREEZE_OCARINA) diff --git a/soh/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c b/soh/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c index 3307b6148..2c4ef32ec 100644 --- a/soh/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c +++ b/soh/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c @@ -7,6 +7,7 @@ #include "z_bg_gate_shutter.h" #include "objects/object_spot01_matoyab/object_spot01_matoyab.h" #include "vt.h" +#include "soh/OTRGlobals.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c b/soh/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c index 18eae69fb..59c72119f 100644 --- a/soh/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c +++ b/soh/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c @@ -7,6 +7,7 @@ #include "z_bg_gjyo_bridge.h" #include "objects/object_gjyo_objects/object_gjyo_objects.h" #include "scenes/dungeons/ganon_tou/ganon_tou_scene.h" +#include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c b/soh/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c index ab832198e..9810f2749 100644 --- a/soh/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c +++ b/soh/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c @@ -1,5 +1,6 @@ #include "z_bg_ice_shelter.h" #include "objects/object_ice_objects/object_ice_objects.h" +#include "soh/OTRGlobals.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c b/soh/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c index 19bef1b67..f8dea0c01 100644 --- a/soh/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c +++ b/soh/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c @@ -6,6 +6,7 @@ #include "z_bg_jya_lift.h" #include "objects/object_jya_obj/object_jya_obj.h" +#include "soh/OTRGlobals.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED diff --git a/soh/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c b/soh/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c index 905106dce..a914c204c 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c @@ -6,6 +6,7 @@ #include "z_bg_spot01_idosoko.h" #include "objects/object_spot01_matoya/object_spot01_matoya.h" +#include "soh/OTRGlobals.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED diff --git a/soh/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c b/soh/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c index 71341097b..28c2769f4 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c @@ -6,6 +6,7 @@ #include "z_bg_spot03_taki.h" #include "objects/object_spot03_object/object_spot03_object.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c b/soh/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c index 5d73c277f..10c6ac559 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c @@ -6,6 +6,7 @@ #include "z_bg_spot12_saku.h" #include "objects/object_spot12_obj/object_spot12_obj.h" +#include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c b/soh/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c index f62f09128..af63fdcd2 100644 --- a/soh/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c +++ b/soh/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c @@ -6,6 +6,7 @@ #include "z_bg_sst_floor.h" #include "objects/object_sst/object_sst.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c b/soh/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c index 621ed0e7f..671831539 100644 --- a/soh/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c +++ b/soh/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c @@ -6,6 +6,7 @@ #include "z_bg_toki_swd.h" #include "objects/object_toki_objects/object_toki_objects.h" +#include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED diff --git a/soh/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c b/soh/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c index b6bd559d2..334161c2d 100644 --- a/soh/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c +++ b/soh/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c @@ -7,6 +7,7 @@ #include "z_bg_treemouth.h" #include "objects/object_spot04_objects/object_spot04_objects.h" #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" +#include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c b/soh/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c index f197bff4d..e8a757d04 100644 --- a/soh/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c +++ b/soh/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c @@ -6,6 +6,7 @@ #include "z_bg_ydan_sp.h" #include "objects/object_ydan_objects/object_ydan_objects.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c b/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c index 63a2e8226..af5da8b88 100644 --- a/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c +++ b/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c @@ -6,6 +6,8 @@ #include "soh/frame_interpolation.h" #include "soh_assets.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include // malloc #include // memcpy diff --git a/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c b/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c index 168b5474c..2842e5a38 100644 --- a/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c +++ b/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c @@ -12,6 +12,7 @@ #include "soh_assets.h" #include "soh/frame_interpolation.h" +#include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include diff --git a/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c b/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c index fa46b7f03..a774d63b8 100644 --- a/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c +++ b/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c @@ -7,6 +7,8 @@ #include "objects/object_ganon_anime3/object_ganon_anime3.h" #include "objects/object_geff/object_geff.h" #include "soh/frame_interpolation.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include "soh_assets.h" diff --git a/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c b/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c index e6947a693..e256042ee 100644 --- a/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c +++ b/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c @@ -11,6 +11,7 @@ #include "overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.h" #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" +#include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include "soh_assets.h" diff --git a/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c b/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c index 0644f73a8..e3551d90f 100644 --- a/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c +++ b/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c @@ -4,6 +4,7 @@ #include "overlays/actors/ovl_En_Goma/z_en_goma.h" #include "overlays/actors/ovl_Door_Shutter/z_door_shutter.h" #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" +#include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" diff --git a/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c b/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c index 7eede228b..005a8a089 100644 --- a/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c +++ b/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c @@ -11,6 +11,7 @@ #include "overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.h" #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" #include "soh/frame_interpolation.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" diff --git a/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c b/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c index 1d21a0372..8a7368647 100644 --- a/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c +++ b/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c @@ -14,6 +14,7 @@ #include "objects/gameplay_keep/gameplay_keep.h" #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" +#include "soh/OTRGlobals.h" #include "soh/frame_interpolation.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" diff --git a/soh/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c b/soh/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c index c7f74ed39..8b68506f2 100644 --- a/soh/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c +++ b/soh/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c @@ -12,6 +12,7 @@ #include "overlays/actors/ovl_Eff_Dust/z_eff_dust.h" #include "soh/frame_interpolation.h" #include +#include "soh/ResourceManagerHelpers.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED diff --git a/soh/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c b/soh/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c index 79fcad873..46102096a 100644 --- a/soh/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c +++ b/soh/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c @@ -10,6 +10,8 @@ #include "objects/object_efc_tw/object_efc_tw.h" #include "objects/object_gi_jewel/object_gi_jewel.h" #include +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c b/soh/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c index 9e7bad0e1..c641f72bf 100644 --- a/soh/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c +++ b/soh/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c @@ -1,6 +1,7 @@ #include "z_demo_ik.h" #include "vt.h" #include "objects/object_ik/object_ik.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED diff --git a/soh/src/overlays/actors/ovl_Demo_Im/z_demo_im.c b/soh/src/overlays/actors/ovl_Demo_Im/z_demo_im.c index d67e1cb9f..9be309322 100644 --- a/soh/src/overlays/actors/ovl_Demo_Im/z_demo_im.c +++ b/soh/src/overlays/actors/ovl_Demo_Im/z_demo_im.c @@ -10,6 +10,8 @@ #include "scenes/indoors/nakaniwa/nakaniwa_scene.h" #include "objects/object_im/object_im.h" #include "vt.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c b/soh/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c index c90ec3237..a7a637d3e 100644 --- a/soh/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c +++ b/soh/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c @@ -5,6 +5,7 @@ #include "objects/object_toki_objects/object_toki_objects.h" #include "soh/frame_interpolation.h" #include +#include "soh/OTRGlobals.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c b/soh/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c index 40164012d..b85ccf744 100644 --- a/soh/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c +++ b/soh/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c @@ -7,6 +7,7 @@ #include "z_demo_kekkai.h" #include "objects/object_demo_kekkai/object_demo_kekkai.h" #include "scenes/dungeons/ganontika/ganontika_scene.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_Door_Ana/z_door_ana.c b/soh/src/overlays/actors/ovl_Door_Ana/z_door_ana.c index 67ba7a2ee..786da7768 100644 --- a/soh/src/overlays/actors/ovl_Door_Ana/z_door_ana.c +++ b/soh/src/overlays/actors/ovl_Door_Ana/z_door_ana.c @@ -8,6 +8,7 @@ #include "objects/gameplay_field_keep/gameplay_field_keep.h" #include "soh/Enhancements/randomizer/randomizer_entrance.h" #include "soh/Enhancements/randomizer/randomizer_grotto.h" +#include "soh/OTRGlobals.h" #define FLAGS ACTOR_FLAG_NO_FREEZE_OCARINA diff --git a/soh/src/overlays/actors/ovl_Door_Killer/z_door_killer.c b/soh/src/overlays/actors/ovl_Door_Killer/z_door_killer.c index 058b5cb23..aeb3e1f33 100644 --- a/soh/src/overlays/actors/ovl_Door_Killer/z_door_killer.c +++ b/soh/src/overlays/actors/ovl_Door_Killer/z_door_killer.c @@ -11,6 +11,7 @@ #include "objects/object_haka_door/object_haka_door.h" #include "objects/object_door_killer/object_door_killer.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED diff --git a/soh/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c b/soh/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c index 61e97a560..e767135e3 100644 --- a/soh/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c +++ b/soh/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c @@ -2,6 +2,7 @@ #include "objects/object_warp1/object_warp1.h" #include "soh/Enhancements/randomizer/randomizer_entrance.h" #include "soh/Enhancements/boss-rush/BossRush.h" +#include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_En_Am/z_en_am.c b/soh/src/overlays/actors/ovl_En_Am/z_en_am.c index 587845d8f..a619b2bf0 100644 --- a/soh/src/overlays/actors/ovl_En_Am/z_en_am.c +++ b/soh/src/overlays/actors/ovl_En_Am/z_en_am.c @@ -9,6 +9,7 @@ #include "overlays/actors/ovl_En_Bom/z_en_bom.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include "soh_assets.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_CAN_PRESS_SWITCH) diff --git a/soh/src/overlays/actors/ovl_En_Ani/z_en_ani.c b/soh/src/overlays/actors/ovl_En_Ani/z_en_ani.c index 98918771c..c4dfbe731 100644 --- a/soh/src/overlays/actors/ovl_En_Ani/z_en_ani.c +++ b/soh/src/overlays/actors/ovl_En_Ani/z_en_ani.c @@ -6,6 +6,8 @@ #include "z_en_ani.h" #include "objects/object_ani/object_ani.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include "soh_assets.h" diff --git a/soh/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c b/soh/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c index 07a47e5bd..8b7cc4edd 100644 --- a/soh/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c +++ b/soh/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c @@ -10,6 +10,7 @@ #include "overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.h" #include "vt.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c b/soh/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c index 0fd7a83e1..1fb194dcc 100644 --- a/soh/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c +++ b/soh/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c @@ -7,6 +7,7 @@ #include "z_en_attack_niw.h" #include "objects/object_niw/object_niw.h" #include "overlays/actors/ovl_En_Niw/z_en_niw.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED diff --git a/soh/src/overlays/actors/ovl_En_Bb/z_en_bb.c b/soh/src/overlays/actors/ovl_En_Bb/z_en_bb.c index 8024c09e3..9ff8bc3c0 100644 --- a/soh/src/overlays/actors/ovl_En_Bb/z_en_bb.c +++ b/soh/src/overlays/actors/ovl_En_Bb/z_en_bb.c @@ -9,6 +9,7 @@ #include "objects/object_Bb/object_Bb.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include "soh_assets.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_PLAY_HIT_SFX) diff --git a/soh/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c b/soh/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c index 2f1c4abe4..ca210b62b 100644 --- a/soh/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c +++ b/soh/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c @@ -1,6 +1,7 @@ #include "z_en_bigokuta.h" #include "objects/object_bigokuta/object_bigokuta.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Bili/z_en_bili.c b/soh/src/overlays/actors/ovl_En_Bili/z_en_bili.c index a50dabe01..f1edce83b 100644 --- a/soh/src/overlays/actors/ovl_En_Bili/z_en_bili.c +++ b/soh/src/overlays/actors/ovl_En_Bili/z_en_bili.c @@ -7,6 +7,7 @@ #include "z_en_bili.h" #include "objects/object_bl/object_bl.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_ARROW_DRAGGABLE) diff --git a/soh/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c b/soh/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c index 9e3c9c1b2..2cb108703 100644 --- a/soh/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c +++ b/soh/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c @@ -3,6 +3,8 @@ #include "overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.h" #include "overlays/actors/ovl_En_Ex_Item/z_en_ex_item.h" #include "objects/object_bg/object_bg.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" diff --git a/soh/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c b/soh/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c index 5e94f3fa8..6c68b3831 100644 --- a/soh/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c +++ b/soh/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c @@ -2,6 +2,7 @@ #include "vt.h" #include "overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.h" #include "overlays/actors/ovl_En_Ex_Item/z_en_ex_item.h" +#include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED diff --git a/soh/src/overlays/actors/ovl_En_Box/z_en_box.c b/soh/src/overlays/actors/ovl_En_Box/z_en_box.c index 841236b36..28b7c6361 100644 --- a/soh/src/overlays/actors/ovl_En_Box/z_en_box.c +++ b/soh/src/overlays/actors/ovl_En_Box/z_en_box.c @@ -3,6 +3,8 @@ #include "soh_assets.h" #include "soh/Enhancements/enhancementTypes.h" #include +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_En_Brob/z_en_brob.c b/soh/src/overlays/actors/ovl_En_Brob/z_en_brob.c index a7d1b7a6c..4d7243455 100644 --- a/soh/src/overlays/actors/ovl_En_Brob/z_en_brob.c +++ b/soh/src/overlays/actors/ovl_En_Brob/z_en_brob.c @@ -6,6 +6,7 @@ #include "z_en_brob.h" #include "objects/object_brob/object_brob.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE) diff --git a/soh/src/overlays/actors/ovl_En_Butte/z_en_butte.c b/soh/src/overlays/actors/ovl_En_Butte/z_en_butte.c index 7dac97580..36cd8195d 100644 --- a/soh/src/overlays/actors/ovl_En_Butte/z_en_butte.c +++ b/soh/src/overlays/actors/ovl_En_Butte/z_en_butte.c @@ -8,6 +8,7 @@ #include "overlays/actors/ovl_En_Elf/z_en_elf.h" #include "objects/gameplay_keep/gameplay_keep.h" #include "objects/gameplay_field_keep/gameplay_field_keep.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_En_Bw/z_en_bw.c b/soh/src/overlays/actors/ovl_En_Bw/z_en_bw.c index 501c7ec9e..2dd6a7ae3 100644 --- a/soh/src/overlays/actors/ovl_En_Bw/z_en_bw.c +++ b/soh/src/overlays/actors/ovl_En_Bw/z_en_bw.c @@ -8,6 +8,7 @@ #include "objects/gameplay_keep/gameplay_keep.h" #include "objects/object_bw/object_bw.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_ChristmasTree/z_en_christmastree.c b/soh/src/overlays/actors/ovl_En_ChristmasTree/z_en_christmastree.c index 32a2cf81f..467bc6d31 100644 --- a/soh/src/overlays/actors/ovl_En_ChristmasTree/z_en_christmastree.c +++ b/soh/src/overlays/actors/ovl_En_ChristmasTree/z_en_christmastree.c @@ -7,6 +7,7 @@ #include "z_en_christmastree.h" #include "soh_assets.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" +#include "soh/OTRGlobals.h" void EnChristmasTree_Init(Actor* thisx, PlayState* play); void EnChristmasTree_Destroy(Actor* thisx, PlayState* play); diff --git a/soh/src/overlays/actors/ovl_En_Cow/z_en_cow.c b/soh/src/overlays/actors/ovl_En_Cow/z_en_cow.c index c01ac30b5..512a9ce80 100644 --- a/soh/src/overlays/actors/ovl_En_Cow/z_en_cow.c +++ b/soh/src/overlays/actors/ovl_En_Cow/z_en_cow.c @@ -6,6 +6,8 @@ #include "z_en_cow.h" #include "objects/object_cow/object_cow.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Crow/z_en_crow.c b/soh/src/overlays/actors/ovl_En_Crow/z_en_crow.c index bb7236e04..22f4857ec 100644 --- a/soh/src/overlays/actors/ovl_En_Crow/z_en_crow.c +++ b/soh/src/overlays/actors/ovl_En_Crow/z_en_crow.c @@ -1,6 +1,7 @@ #include "z_en_crow.h" #include "objects/object_crow/object_crow.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_ARROW_DRAGGABLE) diff --git a/soh/src/overlays/actors/ovl_En_Cs/z_en_cs.c b/soh/src/overlays/actors/ovl_En_Cs/z_en_cs.c index 19d47ed22..f3f18f11d 100644 --- a/soh/src/overlays/actors/ovl_En_Cs/z_en_cs.c +++ b/soh/src/overlays/actors/ovl_En_Cs/z_en_cs.c @@ -2,6 +2,7 @@ #include "objects/object_cs/object_cs.h" #include "objects/object_link_child/object_link_child.h" #include "soh_assets.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c b/soh/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c index 50ec1532e..be43c9194 100644 --- a/soh/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c +++ b/soh/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c @@ -2,6 +2,7 @@ #include "overlays/actors/ovl_En_GeldB/z_en_geldb.h" #include "objects/object_daiku/object_daiku.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c b/soh/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c index ea01c116a..300763507 100644 --- a/soh/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c +++ b/soh/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c @@ -7,6 +7,7 @@ #include "z_en_daiku_kakariko.h" #include "objects/object_daiku/object_daiku.h" #include "soh_assets.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c b/soh/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c index 524579aa9..ad1416af7 100644 --- a/soh/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c +++ b/soh/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c @@ -4,6 +4,7 @@ #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include "soh_assets.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE) diff --git a/soh/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c b/soh/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c index 79ed4433e..22b2e5a06 100644 --- a/soh/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c +++ b/soh/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c @@ -8,6 +8,7 @@ #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" #include "objects/object_dekunuts/object_dekunuts.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE) diff --git a/soh/src/overlays/actors/ovl_En_Dh/z_en_dh.c b/soh/src/overlays/actors/ovl_En_Dh/z_en_dh.c index 997d9aaa5..456e7bd20 100644 --- a/soh/src/overlays/actors/ovl_En_Dh/z_en_dh.c +++ b/soh/src/overlays/actors/ovl_En_Dh/z_en_dh.c @@ -1,6 +1,7 @@ #include "z_en_dh.h" #include "objects/object_dh/object_dh.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAGGED_BY_HOOKSHOT) diff --git a/soh/src/overlays/actors/ovl_En_Dha/z_en_dha.c b/soh/src/overlays/actors/ovl_En_Dha/z_en_dha.c index da6f43388..2b6b036b2 100644 --- a/soh/src/overlays/actors/ovl_En_Dha/z_en_dha.c +++ b/soh/src/overlays/actors/ovl_En_Dha/z_en_dha.c @@ -7,6 +7,7 @@ #include "z_en_dha.h" #include "overlays/actors/ovl_En_Dh/z_en_dh.h" #include "objects/object_dh/object_dh.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c b/soh/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c index a0ba0ad66..40663941b 100644 --- a/soh/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c +++ b/soh/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c @@ -8,6 +8,8 @@ #include "overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.h" #include "objects/object_zo/object_zo.h" #include "vt.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Dns/z_en_dns.c b/soh/src/overlays/actors/ovl_En_Dns/z_en_dns.c index aef178231..323fee59f 100644 --- a/soh/src/overlays/actors/ovl_En_Dns/z_en_dns.c +++ b/soh/src/overlays/actors/ovl_En_Dns/z_en_dns.c @@ -9,6 +9,8 @@ #include "vt.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include "soh_assets.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c b/soh/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c index 40a34073b..ef9228dc2 100644 --- a/soh/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c +++ b/soh/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c @@ -9,6 +9,7 @@ #include "overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.h" #include "overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.h" #include "vt.h" +#include "soh/OTRGlobals.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c b/soh/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c index 95dbb144a..aff1f146e 100644 --- a/soh/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c +++ b/soh/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c @@ -9,6 +9,7 @@ #include "overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.h" #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" #include "vt.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c b/soh/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c index 76dd0af70..1990abd45 100644 --- a/soh/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c +++ b/soh/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c @@ -12,6 +12,7 @@ #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" #include "objects/object_hintnuts/object_hintnuts.h" #include "vt.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c b/soh/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c index 96b18b372..f0f9ff746 100644 --- a/soh/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c +++ b/soh/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c @@ -8,6 +8,7 @@ #include "overlays/actors/ovl_En_Bom/z_en_bom.h" #include "objects/object_dodojr/object_dodojr.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE) diff --git a/soh/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c b/soh/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c index a342e9412..8f6a51957 100644 --- a/soh/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c +++ b/soh/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c @@ -4,6 +4,7 @@ #include "objects/object_dodongo/object_dodongo.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include "soh_assets.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Dog/z_en_dog.c b/soh/src/overlays/actors/ovl_En_Dog/z_en_dog.c index e9f3d877f..d786f258f 100644 --- a/soh/src/overlays/actors/ovl_En_Dog/z_en_dog.c +++ b/soh/src/overlays/actors/ovl_En_Dog/z_en_dog.c @@ -7,6 +7,7 @@ #include "z_en_dog.h" #include "objects/object_dog/object_dog.h" #include "soh_assets.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_En_Door/z_en_door.c b/soh/src/overlays/actors/ovl_En_Door/z_en_door.c index cbfd5f018..56f1f5b1e 100644 --- a/soh/src/overlays/actors/ovl_En_Door/z_en_door.c +++ b/soh/src/overlays/actors/ovl_En_Door/z_en_door.c @@ -10,6 +10,7 @@ #include "objects/object_hidan_objects/object_hidan_objects.h" #include "objects/object_mizu_objects/object_mizu_objects.h" #include "objects/object_haka_door/object_haka_door.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED diff --git a/soh/src/overlays/actors/ovl_En_Ds/z_en_ds.c b/soh/src/overlays/actors/ovl_En_Ds/z_en_ds.c index 903c5b60f..0899a4683 100644 --- a/soh/src/overlays/actors/ovl_En_Ds/z_en_ds.c +++ b/soh/src/overlays/actors/ovl_En_Ds/z_en_ds.c @@ -6,6 +6,9 @@ #include "z_en_ds.h" #include "objects/object_ds/object_ds.h" +#include "soh/Enhancements/randomizer/adult_trade_shuffle.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include "soh_assets.h" diff --git a/soh/src/overlays/actors/ovl_En_Du/z_en_du.c b/soh/src/overlays/actors/ovl_En_Du/z_en_du.c index ea0678926..537f531fa 100644 --- a/soh/src/overlays/actors/ovl_En_Du/z_en_du.c +++ b/soh/src/overlays/actors/ovl_En_Du/z_en_du.c @@ -1,6 +1,7 @@ #include "z_en_du.h" #include "objects/object_du/object_du.h" #include "scenes/overworld/spot18/spot18_scene.h" +#include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include "soh_assets.h" diff --git a/soh/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c b/soh/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c index 7018da6ca..2ba1972e4 100644 --- a/soh/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c +++ b/soh/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c @@ -7,6 +7,7 @@ #include "z_en_dy_extra.h" #include "objects/object_dy_obj/object_dy_obj.h" #include "vt.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c b/soh/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c index 7340d9cf5..6e764cedc 100644 --- a/soh/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c +++ b/soh/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c @@ -1,6 +1,7 @@ #include "z_en_eiyer.h" #include "objects/object_ei/object_ei.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE) diff --git a/soh/src/overlays/actors/ovl_En_Elf/z_en_elf.c b/soh/src/overlays/actors/ovl_En_Elf/z_en_elf.c index 4fb9b14e7..ff7e7aed4 100644 --- a/soh/src/overlays/actors/ovl_En_Elf/z_en_elf.c +++ b/soh/src/overlays/actors/ovl_En_Elf/z_en_elf.c @@ -8,6 +8,7 @@ #include "objects/gameplay_keep/gameplay_keep.h" #include #include "soh_assets.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED | ACTOR_FLAG_NO_FREEZE_OCARINA) diff --git a/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c b/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c index 65a030485..c85154c7f 100644 --- a/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c +++ b/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c @@ -8,6 +8,7 @@ #include "overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.h" #include "objects/gameplay_keep/gameplay_keep.h" #include "vt.h" +#include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Fd/z_en_fd.c b/soh/src/overlays/actors/ovl_En_Fd/z_en_fd.c index 277ee851a..ea55ad855 100644 --- a/soh/src/overlays/actors/ovl_En_Fd/z_en_fd.c +++ b/soh/src/overlays/actors/ovl_En_Fd/z_en_fd.c @@ -9,6 +9,7 @@ #include "objects/object_fw/object_fw.h" #include "soh/frame_interpolation.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_HOOKSHOT_DRAGS) diff --git a/soh/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c b/soh/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c index 7797cba9c..5b23ce7eb 100644 --- a/soh/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c +++ b/soh/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c @@ -8,6 +8,7 @@ #include "objects/object_firefly/object_firefly.h" #include "overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_ARROW_DRAGGABLE) diff --git a/soh/src/overlays/actors/ovl_En_Fish/z_en_fish.c b/soh/src/overlays/actors/ovl_En_Fish/z_en_fish.c index 766b15640..aa21e3ef1 100644 --- a/soh/src/overlays/actors/ovl_En_Fish/z_en_fish.c +++ b/soh/src/overlays/actors/ovl_En_Fish/z_en_fish.c @@ -7,6 +7,7 @@ #include "z_en_fish.h" #include "objects/gameplay_keep/gameplay_keep.h" #include "vt.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c b/soh/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c index 1a906e5b7..b09bf8f07 100644 --- a/soh/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c +++ b/soh/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c @@ -7,6 +7,7 @@ #include "z_en_floormas.h" #include "objects/object_wallmaster/object_wallmaster.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_DRAGGED_BY_HOOKSHOT) diff --git a/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c b/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c index f1b299807..1a65cd579 100644 --- a/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c +++ b/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c @@ -4,6 +4,8 @@ #include "objects/object_fr/object_fr.h" #include #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_NO_FREEZE_OCARINA) diff --git a/soh/src/overlays/actors/ovl_En_Fu/z_en_fu.c b/soh/src/overlays/actors/ovl_En_Fu/z_en_fu.c index 59b3fc098..8abc7e86e 100644 --- a/soh/src/overlays/actors/ovl_En_Fu/z_en_fu.c +++ b/soh/src/overlays/actors/ovl_En_Fu/z_en_fu.c @@ -8,6 +8,8 @@ #include "objects/object_fu/object_fu.h" #include "scenes/indoors/hakasitarelay/hakasitarelay_scene.h" #include "soh_assets.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_NO_FREEZE_OCARINA) diff --git a/soh/src/overlays/actors/ovl_En_Fw/z_en_fw.c b/soh/src/overlays/actors/ovl_En_Fw/z_en_fw.c index 61f009e47..d69582e6a 100644 --- a/soh/src/overlays/actors/ovl_En_Fw/z_en_fw.c +++ b/soh/src/overlays/actors/ovl_En_Fw/z_en_fw.c @@ -9,6 +9,7 @@ #include "overlays/actors/ovl_En_Bom/z_en_bom.h" #include "objects/gameplay_keep/gameplay_keep.h" #include "soh/frame_interpolation.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_HOOKSHOT_DRAGS) diff --git a/soh/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c b/soh/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c index 0fc08ba4a..3c3b40295 100644 --- a/soh/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c +++ b/soh/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c @@ -6,6 +6,8 @@ #include "z_en_ganon_mant.h" #include "overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Gb/z_en_gb.c b/soh/src/overlays/actors/ovl_En_Gb/z_en_gb.c index 8fd732aeb..935e3dc40 100644 --- a/soh/src/overlays/actors/ovl_En_Gb/z_en_gb.c +++ b/soh/src/overlays/actors/ovl_En_Gb/z_en_gb.c @@ -7,6 +7,8 @@ #include "z_en_gb.h" #include "objects/object_ps/object_ps.h" #include "soh/frame_interpolation.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c b/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c index 1038a7014..235320ff4 100644 --- a/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c +++ b/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c @@ -8,6 +8,8 @@ #include "vt.h" #include "objects/object_ge1/object_ge1.h" #include "soh/Enhancements/randomizer/randomizer_entrance.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c b/soh/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c index 3abbf7533..deb29c3a8 100644 --- a/soh/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c +++ b/soh/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c @@ -10,6 +10,8 @@ #include "soh/Enhancements/randomizer/randomizer_entrance.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c b/soh/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c index eb3042dd3..e2f037cdb 100644 --- a/soh/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c +++ b/soh/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c @@ -6,6 +6,8 @@ #include "z_en_ge3.h" #include "objects/object_geldb/object_geldb.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c b/soh/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c index 47b045e53..cd7c92075 100644 --- a/soh/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c +++ b/soh/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c @@ -8,6 +8,7 @@ #include "objects/object_geldb/object_geldb.h" #include "soh/Enhancements/randomizer/randomizer_entrance.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Gm/z_en_gm.c b/soh/src/overlays/actors/ovl_En_Gm/z_en_gm.c index 5ca459672..2a653edc9 100644 --- a/soh/src/overlays/actors/ovl_En_Gm/z_en_gm.c +++ b/soh/src/overlays/actors/ovl_En_Gm/z_en_gm.c @@ -10,6 +10,8 @@ #include "vt.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Go/z_en_go.c b/soh/src/overlays/actors/ovl_En_Go/z_en_go.c index c3d74e1c3..e538949b8 100644 --- a/soh/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/soh/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -3,6 +3,8 @@ #include "objects/gameplay_keep/gameplay_keep.h" #include "objects/object_oF1d_map/object_oF1d_map.h" #include "soh/frame_interpolation.h" +#include "soh/Enhancements/randomizer/adult_trade_shuffle.h" +#include "soh/OTRGlobals.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c b/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c index 3edec1ebe..a483de7d5 100644 --- a/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c +++ b/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c @@ -3,6 +3,9 @@ #include "objects/gameplay_keep/gameplay_keep.h" #include "objects/object_oF1d_map/object_oF1d_map.h" #include "soh/frame_interpolation.h" +#include "soh/Enhancements/randomizer/adult_trade_shuffle.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Goma/z_en_goma.c b/soh/src/overlays/actors/ovl_En_Goma/z_en_goma.c index 8ba162f77..0bb7409a3 100644 --- a/soh/src/overlays/actors/ovl_En_Goma/z_en_goma.c +++ b/soh/src/overlays/actors/ovl_En_Goma/z_en_goma.c @@ -4,6 +4,7 @@ #include "overlays/actors/ovl_Boss_Goma/z_boss_goma.h" #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Guest/z_en_guest.c b/soh/src/overlays/actors/ovl_En_Guest/z_en_guest.c index 2d09ea016..e69e4e610 100644 --- a/soh/src/overlays/actors/ovl_En_Guest/z_en_guest.c +++ b/soh/src/overlays/actors/ovl_En_Guest/z_en_guest.c @@ -9,6 +9,7 @@ #include "objects/object_boj/object_boj.h" #include "vt.h" #include +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c b/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c index 837c0ec0f..90d47b098 100644 --- a/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c +++ b/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c @@ -7,6 +7,7 @@ #include "z_en_heishi1.h" #include "objects/object_sd/object_sd.h" #include "vt.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED diff --git a/soh/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c b/soh/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c index 9c37164a6..763f73df4 100644 --- a/soh/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c +++ b/soh/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c @@ -11,6 +11,7 @@ #include "overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.h" #include "overlays/actors/ovl_En_Bom/z_en_bom.h" #include "overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c b/soh/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c index 1ac928e81..755c687bf 100644 --- a/soh/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c +++ b/soh/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c @@ -7,6 +7,7 @@ #include "z_en_heishi3.h" #include "objects/object_sd/object_sd.h" #include "vt.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c b/soh/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c index 0c2079a3f..40d61a15e 100644 --- a/soh/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c +++ b/soh/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c @@ -2,6 +2,8 @@ #include "objects/object_sd/object_sd.h" #include "vt.h" #include "soh_assets.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c b/soh/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c index e956457da..27daeff0c 100644 --- a/soh/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c +++ b/soh/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c @@ -7,6 +7,7 @@ #include "z_en_hintnuts.h" #include "objects/object_hintnuts/object_hintnuts.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE) diff --git a/soh/src/overlays/actors/ovl_En_Hs/z_en_hs.c b/soh/src/overlays/actors/ovl_En_Hs/z_en_hs.c index f816870a5..c5998ea36 100644 --- a/soh/src/overlays/actors/ovl_En_Hs/z_en_hs.c +++ b/soh/src/overlays/actors/ovl_En_Hs/z_en_hs.c @@ -7,6 +7,9 @@ #include "z_en_hs.h" #include "vt.h" #include "objects/object_hs/object_hs.h" +#include "soh/Enhancements/randomizer/adult_trade_shuffle.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c b/soh/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c index 84eb63d58..dc187d517 100644 --- a/soh/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c +++ b/soh/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c @@ -8,6 +8,7 @@ #include "vt.h" #include "objects/object_hs/object_hs.h" #include "soh_assets.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Hy/z_en_hy.c b/soh/src/overlays/actors/ovl_En_Hy/z_en_hy.c index fa94348d3..309664e30 100644 --- a/soh/src/overlays/actors/ovl_En_Hy/z_en_hy.c +++ b/soh/src/overlays/actors/ovl_En_Hy/z_en_hy.c @@ -14,6 +14,8 @@ #include "objects/object_cne/object_cne.h" #include "objects/object_cob/object_cob.h" #include "objects/object_os_anime/object_os_anime.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include "soh_assets.h" diff --git a/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c b/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c index 84d9c84c6..53712235e 100644 --- a/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -10,6 +10,7 @@ #include "vt.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include "soh_assets.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED diff --git a/soh/src/overlays/actors/ovl_En_In/z_en_in.c b/soh/src/overlays/actors/ovl_En_In/z_en_in.c index 31f4e8337..17df55638 100644 --- a/soh/src/overlays/actors/ovl_En_In/z_en_in.c +++ b/soh/src/overlays/actors/ovl_En_In/z_en_in.c @@ -2,6 +2,7 @@ #include "overlays/actors/ovl_En_Horse/z_en_horse.h" #include "objects/object_in/object_in.h" #include "soh_assets.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED) @@ -1020,4 +1021,4 @@ void EnIn_Draw(Actor* thisx, PlayState* play) { void EnIn_Reset(void) { D_80A7B998 = 0; -} \ No newline at end of file +} diff --git a/soh/src/overlays/actors/ovl_En_Insect/z_en_insect.c b/soh/src/overlays/actors/ovl_En_Insect/z_en_insect.c index c207a6310..74df59756 100644 --- a/soh/src/overlays/actors/ovl_En_Insect/z_en_insect.c +++ b/soh/src/overlays/actors/ovl_En_Insect/z_en_insect.c @@ -7,6 +7,7 @@ #include "z_en_insect.h" #include "vt.h" #include "objects/gameplay_keep/gameplay_keep.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c b/soh/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c index c79033250..55cd4001e 100644 --- a/soh/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c +++ b/soh/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c @@ -7,6 +7,7 @@ #include "z_en_ishi.h" #include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h" #include "objects/gameplay_field_keep/gameplay_field_keep.h" +#include "soh/OTRGlobals.h" #include "vt.h" diff --git a/soh/src/overlays/actors/ovl_En_Jj/z_en_jj.c b/soh/src/overlays/actors/ovl_En_Jj/z_en_jj.c index 9322330ca..fa1a4a776 100644 --- a/soh/src/overlays/actors/ovl_En_Jj/z_en_jj.c +++ b/soh/src/overlays/actors/ovl_En_Jj/z_en_jj.c @@ -8,6 +8,7 @@ #include "objects/object_jj/object_jj.h" #include "overlays/actors/ovl_Eff_Dust/z_eff_dust.h" #include "soh_assets.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Js/z_en_js.c b/soh/src/overlays/actors/ovl_En_Js/z_en_js.c index ef6646bbd..8a31b8588 100644 --- a/soh/src/overlays/actors/ovl_En_Js/z_en_js.c +++ b/soh/src/overlays/actors/ovl_En_Js/z_en_js.c @@ -6,6 +6,8 @@ #include "z_en_js.h" #include "objects/object_js/object_js.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c b/soh/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c index 8af7f4d83..ffd428f21 100644 --- a/soh/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c +++ b/soh/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c @@ -6,6 +6,7 @@ #include "z_en_jsjutan.h" #include "overlays/actors/ovl_En_Bom/z_en_bom.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c b/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c index e8ce00c6a..efc324678 100644 --- a/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c +++ b/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c @@ -7,6 +7,7 @@ #include "z_en_kakasi2.h" #include "vt.h" #include "objects/object_ka/object_ka.h" +#include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" diff --git a/soh/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c b/soh/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c index d78cf0820..0e36e476a 100644 --- a/soh/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c +++ b/soh/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c @@ -9,6 +9,7 @@ #include "objects/gameplay_keep/gameplay_keep.h" #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE) diff --git a/soh/src/overlays/actors/ovl_En_Ko/z_en_ko.c b/soh/src/overlays/actors/ovl_En_Ko/z_en_ko.c index 2c16f042c..89a8c2ad8 100644 --- a/soh/src/overlays/actors/ovl_En_Ko/z_en_ko.c +++ b/soh/src/overlays/actors/ovl_En_Ko/z_en_ko.c @@ -10,6 +10,9 @@ #include "objects/object_km1/object_km1.h" #include "objects/object_kw1/object_kw1.h" #include "vt.h" +#include "soh/Enhancements/randomizer/adult_trade_shuffle.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c b/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c index 882bc3f5d..d5f14c959 100644 --- a/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c +++ b/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c @@ -6,6 +6,9 @@ #include "z_en_kz.h" #include "objects/object_kz/object_kz.h" +#include "soh/Enhancements/randomizer/adult_trade_shuffle.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c b/soh/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c index 5fef81bcf..4176b5d1f 100644 --- a/soh/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c +++ b/soh/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c @@ -6,6 +6,7 @@ #include "z_en_ma1.h" #include "objects/object_ma1/object_ma1.h" +#include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include "soh_assets.h" diff --git a/soh/src/overlays/actors/ovl_En_Mag/z_en_mag.c b/soh/src/overlays/actors/ovl_En_Mag/z_en_mag.c index 21b4c5f94..bad7e9b52 100644 --- a/soh/src/overlays/actors/ovl_En_Mag/z_en_mag.c +++ b/soh/src/overlays/actors/ovl_En_Mag/z_en_mag.c @@ -7,6 +7,7 @@ #include "z_en_mag.h" #include "objects/object_mag/object_mag.h" #include +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Mb/z_en_mb.c b/soh/src/overlays/actors/ovl_En_Mb/z_en_mb.c index b0aff3750..979cc8d68 100644 --- a/soh/src/overlays/actors/ovl_En_Mb/z_en_mb.c +++ b/soh/src/overlays/actors/ovl_En_Mb/z_en_mb.c @@ -7,6 +7,7 @@ #include "z_en_mb.h" #include "objects/object_mb/object_mb.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" /* * This actor can have three behaviors: diff --git a/soh/src/overlays/actors/ovl_En_Md/z_en_md.c b/soh/src/overlays/actors/ovl_En_Md/z_en_md.c index d6264ee80..7902b1bb8 100644 --- a/soh/src/overlays/actors/ovl_En_Md/z_en_md.c +++ b/soh/src/overlays/actors/ovl_En_Md/z_en_md.c @@ -7,6 +7,7 @@ #include "z_en_md.h" #include "objects/object_md/object_md.h" #include "overlays/actors/ovl_En_Elf/z_en_elf.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_NO_FREEZE_OCARINA) diff --git a/soh/src/overlays/actors/ovl_En_Mk/z_en_mk.c b/soh/src/overlays/actors/ovl_En_Mk/z_en_mk.c index 81d62df50..f5549f86e 100644 --- a/soh/src/overlays/actors/ovl_En_Mk/z_en_mk.c +++ b/soh/src/overlays/actors/ovl_En_Mk/z_en_mk.c @@ -6,6 +6,9 @@ #include "z_en_mk.h" #include "objects/object_mk/object_mk.h" +#include "soh/Enhancements/randomizer/adult_trade_shuffle.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Mm/z_en_mm.c b/soh/src/overlays/actors/ovl_En_Mm/z_en_mm.c index d1d495093..520d66f92 100644 --- a/soh/src/overlays/actors/ovl_En_Mm/z_en_mm.c +++ b/soh/src/overlays/actors/ovl_En_Mm/z_en_mm.c @@ -7,6 +7,7 @@ #include "z_en_mm.h" #include "objects/object_mm/object_mm.h" #include "objects/object_link_child/object_link_child.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c b/soh/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c index b1bbc09a5..32fffa9e2 100644 --- a/soh/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c +++ b/soh/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c @@ -7,6 +7,7 @@ #include "z_en_mm2.h" #include "vt.h" #include "objects/object_mm/object_mm.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Ms/z_en_ms.c b/soh/src/overlays/actors/ovl_En_Ms/z_en_ms.c index c2798dae7..89011a59c 100644 --- a/soh/src/overlays/actors/ovl_En_Ms/z_en_ms.c +++ b/soh/src/overlays/actors/ovl_En_Ms/z_en_ms.c @@ -6,6 +6,8 @@ #include "z_en_ms.h" #include "objects/object_ms/object_ms.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Nb/z_en_nb.c b/soh/src/overlays/actors/ovl_En_Nb/z_en_nb.c index f5f66dbf6..ace23084e 100644 --- a/soh/src/overlays/actors/ovl_En_Nb/z_en_nb.c +++ b/soh/src/overlays/actors/ovl_En_Nb/z_en_nb.c @@ -8,6 +8,7 @@ #include "vt.h" #include "objects/object_nb/object_nb.h" #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED diff --git a/soh/src/overlays/actors/ovl_En_Niw/z_en_niw.c b/soh/src/overlays/actors/ovl_En_Niw/z_en_niw.c index 50ed827b0..f754f6ae8 100644 --- a/soh/src/overlays/actors/ovl_En_Niw/z_en_niw.c +++ b/soh/src/overlays/actors/ovl_En_Niw/z_en_niw.c @@ -10,6 +10,7 @@ #include "vt.h" #include "soh/frame_interpolation.h" #include "soh_assets.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_ALWAYS_THROWN) diff --git a/soh/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c b/soh/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c index e67a75161..30e1f08bd 100644 --- a/soh/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c +++ b/soh/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c @@ -8,6 +8,7 @@ #include "objects/object_gr/object_gr.h" #include "vt.h" #include "soh_assets.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c b/soh/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c index 228420d1e..76fb5ebb2 100644 --- a/soh/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c +++ b/soh/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c @@ -3,6 +3,9 @@ #include "objects/object_os_anime/object_os_anime.h" #include "overlays/actors/ovl_En_Niw/z_en_niw.h" #include "vt.h" +#include "soh/Enhancements/randomizer/adult_trade_shuffle.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include diff --git a/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c b/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c index b205e61c5..b0d9ecda4 100644 --- a/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c +++ b/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c @@ -8,6 +8,7 @@ #include "scenes/misc/hakaana_ouke/hakaana_ouke_scene.h" #include "scenes/overworld/spot02/spot02_scene.h" #include "vt.h" +#include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_NO_FREEZE_OCARINA) diff --git a/soh/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c b/soh/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c index a89b3d123..7dcc6f45a 100644 --- a/soh/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c +++ b/soh/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c @@ -3,6 +3,7 @@ #include "objects/gameplay_field_keep/gameplay_field_keep.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE) diff --git a/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c b/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c index ee33dc7a4..21edc5eca 100644 --- a/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -18,6 +18,7 @@ #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include "soh_assets.h" #include +#include "soh/OTRGlobals.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Owl/z_en_owl.c b/soh/src/overlays/actors/ovl_En_Owl/z_en_owl.c index fb03af25c..f5d981031 100644 --- a/soh/src/overlays/actors/ovl_En_Owl/z_en_owl.c +++ b/soh/src/overlays/actors/ovl_En_Owl/z_en_owl.c @@ -10,6 +10,8 @@ #include "scenes/overworld/spot16/spot16_scene.h" #include "vt.h" #include +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Partner/z_en_partner.c b/soh/src/overlays/actors/ovl_En_Partner/z_en_partner.c index a1dd91e6f..c155052f1 100644 --- a/soh/src/overlays/actors/ovl_En_Partner/z_en_partner.c +++ b/soh/src/overlays/actors/ovl_En_Partner/z_en_partner.c @@ -11,6 +11,8 @@ #include #include #include +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED | ACTOR_FLAG_DRAGGED_BY_HOOKSHOT | ACTOR_FLAG_CAN_PRESS_SWITCH) diff --git a/soh/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c b/soh/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c index 5526ad49c..2084dc5e7 100644 --- a/soh/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c +++ b/soh/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c @@ -3,6 +3,7 @@ #include "overlays/actors/ovl_En_Bom/z_en_bom.h" #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_PLAY_HIT_SFX) diff --git a/soh/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c b/soh/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c index 2c00b284b..a40ae376e 100644 --- a/soh/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c +++ b/soh/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c @@ -6,6 +6,7 @@ #include "z_en_po_desert.h" #include "objects/object_po_field/object_po_field.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_LENS | ACTOR_FLAG_IGNORE_QUAKE) diff --git a/soh/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c b/soh/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c index 33add9d1b..e1bb232f8 100644 --- a/soh/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c +++ b/soh/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c @@ -8,6 +8,7 @@ #include "objects/gameplay_keep/gameplay_keep.h" #include "objects/object_po_field/object_po_field.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #include diff --git a/soh/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c b/soh/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c index ba6a1e85c..efa56d7ff 100644 --- a/soh/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c +++ b/soh/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c @@ -8,6 +8,7 @@ #include "overlays/actors/ovl_En_Honotrap/z_en_honotrap.h" #include "objects/object_tk/object_tk.h" #include "soh_assets.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_WILL_TALK) diff --git a/soh/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c b/soh/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c index 13ace8899..c667a67e1 100644 --- a/soh/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c +++ b/soh/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c @@ -9,6 +9,8 @@ #include "objects/object_po_sisters/object_po_sisters.h" #include "soh/frame_interpolation.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_HOOKSHOT_DRAGS | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_ARROW_DRAGGABLE) diff --git a/soh/src/overlays/actors/ovl_En_Poh/z_en_poh.c b/soh/src/overlays/actors/ovl_En_Poh/z_en_poh.c index 2c7e90416..c1e4c28eb 100644 --- a/soh/src/overlays/actors/ovl_En_Poh/z_en_poh.c +++ b/soh/src/overlays/actors/ovl_En_Poh/z_en_poh.c @@ -8,6 +8,7 @@ #include "objects/object_poh/object_poh.h" #include "objects/object_po_composer/object_po_composer.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_IGNORE_QUAKE) diff --git a/soh/src/overlays/actors/ovl_En_Rd/z_en_rd.c b/soh/src/overlays/actors/ovl_En_Rd/z_en_rd.c index 8990f67ea..db65300d8 100644 --- a/soh/src/overlays/actors/ovl_En_Rd/z_en_rd.c +++ b/soh/src/overlays/actors/ovl_En_Rd/z_en_rd.c @@ -1,6 +1,7 @@ #include "z_en_rd.h" #include "objects/object_rd/object_rd.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAGGED_BY_HOOKSHOT) diff --git a/soh/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c b/soh/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c index 76e5ae871..7a1293178 100644 --- a/soh/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c +++ b/soh/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c @@ -10,6 +10,7 @@ #include "vt.h" #include "objects/object_reeba/object_reeba.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_NO_LOCKON) diff --git a/soh/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c b/soh/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c index 8257df479..9b6e4601e 100644 --- a/soh/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c +++ b/soh/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c @@ -7,6 +7,7 @@ #include "z_en_ru1.h" #include "objects/object_ru1/object_ru1.h" #include "vt.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_CAN_PRESS_SWITCH) diff --git a/soh/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c b/soh/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c index ac777f7de..162db0512 100644 --- a/soh/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c +++ b/soh/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c @@ -8,6 +8,7 @@ #include "objects/object_ru2/object_ru2.h" #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" #include "vt.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED diff --git a/soh/src/overlays/actors/ovl_En_Sa/z_en_sa.c b/soh/src/overlays/actors/ovl_En_Sa/z_en_sa.c index 664e29d1d..ed09470a0 100644 --- a/soh/src/overlays/actors/ovl_En_Sa/z_en_sa.c +++ b/soh/src/overlays/actors/ovl_En_Sa/z_en_sa.c @@ -3,6 +3,8 @@ #include "objects/object_sa/object_sa.h" #include "scenes/overworld/spot04/spot04_scene.h" #include "scenes/overworld/spot05/spot05_scene.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_NO_FREEZE_OCARINA) diff --git a/soh/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c b/soh/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c index 62558ee25..90e8724ad 100644 --- a/soh/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c +++ b/soh/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c @@ -1,5 +1,7 @@ #include "z_en_shopnuts.h" #include "objects/object_shopnuts/object_shopnuts.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include "soh_assets.h" diff --git a/soh/src/overlays/actors/ovl_En_Si/z_en_si.c b/soh/src/overlays/actors/ovl_En_Si/z_en_si.c index 832e3c45d..246cbcd11 100644 --- a/soh/src/overlays/actors/ovl_En_Si/z_en_si.c +++ b/soh/src/overlays/actors/ovl_En_Si/z_en_si.c @@ -7,6 +7,7 @@ #include "z_en_si.h" #include "soh/Enhancements/custom-message/CustomMessageTypes.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/OTRGlobals.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOOKSHOT_DRAGS) diff --git a/soh/src/overlays/actors/ovl_En_Skb/z_en_skb.c b/soh/src/overlays/actors/ovl_En_Skb/z_en_skb.c index fcde867db..febf3e9a1 100644 --- a/soh/src/overlays/actors/ovl_En_Skb/z_en_skb.c +++ b/soh/src/overlays/actors/ovl_En_Skb/z_en_skb.c @@ -3,6 +3,7 @@ #include "objects/object_skb/object_skb.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include "soh_assets.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c b/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c index c21465736..aa0df870e 100644 --- a/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c +++ b/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c @@ -2,6 +2,8 @@ #include "overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.h" #include "objects/object_skj/object_skj.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_NO_FREEZE_OCARINA) diff --git a/soh/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c b/soh/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c index fc814f915..e17932496 100644 --- a/soh/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c +++ b/soh/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c @@ -1,5 +1,7 @@ #include "z_en_ssh.h" #include "objects/object_ssh/object_ssh.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_St/z_en_st.c b/soh/src/overlays/actors/ovl_En_St/z_en_st.c index 59d4be6f3..a330cca94 100644 --- a/soh/src/overlays/actors/ovl_En_St/z_en_st.c +++ b/soh/src/overlays/actors/ovl_En_St/z_en_st.c @@ -7,6 +7,7 @@ #include "z_en_st.h" #include "objects/object_st/object_st.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Sth/z_en_sth.c b/soh/src/overlays/actors/ovl_En_Sth/z_en_sth.c index 1d946fbf0..3587729b9 100644 --- a/soh/src/overlays/actors/ovl_En_Sth/z_en_sth.c +++ b/soh/src/overlays/actors/ovl_En_Sth/z_en_sth.c @@ -11,6 +11,8 @@ #include #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include "soh_assets.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c b/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c index caa07d1d6..212bec00f 100644 --- a/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -1,6 +1,7 @@ #include "z_en_sw.h" #include "objects/object_st/object_st.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c b/soh/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c index 30b13c8ea..39c251ac3 100644 --- a/soh/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c +++ b/soh/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c @@ -4,6 +4,8 @@ #include "objects/object_ossan/object_ossan.h" #include "soh/Enhancements/randomizer/randomizer_entrance.h" #include "soh/Enhancements/custom-message/CustomMessageTypes.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include "soh_assets.h" diff --git a/soh/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c b/soh/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c index afe9ce537..41b4bdb5f 100644 --- a/soh/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c +++ b/soh/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c @@ -8,6 +8,7 @@ #include "objects/object_niw/object_niw.h" #include "vt.h" #include "soh/frame_interpolation.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED diff --git a/soh/src/overlays/actors/ovl_En_Ta/z_en_ta.c b/soh/src/overlays/actors/ovl_En_Ta/z_en_ta.c index 4e393b184..eccc467d0 100644 --- a/soh/src/overlays/actors/ovl_En_Ta/z_en_ta.c +++ b/soh/src/overlays/actors/ovl_En_Ta/z_en_ta.c @@ -7,6 +7,8 @@ #include "z_en_ta.h" #include "vt.h" #include "objects/object_ta/object_ta.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include "soh_assets.h" diff --git a/soh/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c b/soh/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c index e15d481fd..3afae38cf 100644 --- a/soh/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c +++ b/soh/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c @@ -7,6 +7,8 @@ #include "z_en_takara_man.h" #include "vt.h" #include "objects/object_ts/object_ts.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED | ACTOR_FLAG_NO_LOCKON) diff --git a/soh/src/overlays/actors/ovl_En_Test/z_en_test.c b/soh/src/overlays/actors/ovl_En_Test/z_en_test.c index 5b2821c3f..2306ef2f9 100644 --- a/soh/src/overlays/actors/ovl_En_Test/z_en_test.c +++ b/soh/src/overlays/actors/ovl_En_Test/z_en_test.c @@ -8,6 +8,7 @@ #include "objects/object_sk2/object_sk2.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include "soh_assets.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Tite/z_en_tite.c b/soh/src/overlays/actors/ovl_En_Tite/z_en_tite.c index ba583c155..f87465fb8 100644 --- a/soh/src/overlays/actors/ovl_En_Tite/z_en_tite.c +++ b/soh/src/overlays/actors/ovl_En_Tite/z_en_tite.c @@ -10,6 +10,7 @@ #include "vt.h" #include "objects/object_tite/object_tite.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Tk/z_en_tk.c b/soh/src/overlays/actors/ovl_En_Tk/z_en_tk.c index 9ea727acc..8043cc95e 100644 --- a/soh/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/soh/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -8,6 +8,7 @@ #include "objects/gameplay_keep/gameplay_keep.h" #include "objects/object_tk/object_tk.h" #include "soh/frame_interpolation.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include "soh_assets.h" diff --git a/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c b/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c index ab216871e..356eb4462 100644 --- a/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c +++ b/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c @@ -6,6 +6,9 @@ #include "z_en_toryo.h" #include "objects/object_toryo/object_toryo.h" +#include "soh/Enhancements/randomizer/adult_trade_shuffle.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include "soh_assets.h" diff --git a/soh/src/overlays/actors/ovl_En_Tr/z_en_tr.c b/soh/src/overlays/actors/ovl_En_Tr/z_en_tr.c index 6790f8b74..989a48244 100644 --- a/soh/src/overlays/actors/ovl_En_Tr/z_en_tr.c +++ b/soh/src/overlays/actors/ovl_En_Tr/z_en_tr.c @@ -7,6 +7,7 @@ #include "z_en_tr.h" #include "objects/object_tr/object_tr.h" #include +#include "soh/ResourceManagerHelpers.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED diff --git a/soh/src/overlays/actors/ovl_En_Vali/z_en_vali.c b/soh/src/overlays/actors/ovl_En_Vali/z_en_vali.c index 11772cd90..e6c62d961 100644 --- a/soh/src/overlays/actors/ovl_En_Vali/z_en_vali.c +++ b/soh/src/overlays/actors/ovl_En_Vali/z_en_vali.c @@ -8,6 +8,7 @@ #include "objects/object_vali/object_vali.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_IGNORE_QUAKE) diff --git a/soh/src/overlays/actors/ovl_En_Vm/z_en_vm.c b/soh/src/overlays/actors/ovl_En_Vm/z_en_vm.c index bff8380cd..d30607ea0 100644 --- a/soh/src/overlays/actors/ovl_En_Vm/z_en_vm.c +++ b/soh/src/overlays/actors/ovl_En_Vm/z_en_vm.c @@ -10,6 +10,7 @@ #include "objects/gameplay_keep/gameplay_keep.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include "soh_assets.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c b/soh/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c index 56950809d..8b7157e78 100644 --- a/soh/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c +++ b/soh/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c @@ -8,6 +8,7 @@ #include "objects/object_wallmaster/object_wallmaster.h" #include "objects/gameplay_keep/gameplay_keep.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c b/soh/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c index e3f19a3ed..3ed75bd4d 100644 --- a/soh/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c +++ b/soh/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c @@ -7,6 +7,7 @@ #include "z_en_weiyer.h" #include "objects/object_ei/object_ei.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE) diff --git a/soh/src/overlays/actors/ovl_En_Wf/z_en_wf.c b/soh/src/overlays/actors/ovl_En_Wf/z_en_wf.c index c9ffb6f8a..8f836da92 100644 --- a/soh/src/overlays/actors/ovl_En_Wf/z_en_wf.c +++ b/soh/src/overlays/actors/ovl_En_Wf/z_en_wf.c @@ -10,6 +10,7 @@ #include "objects/object_wf/object_wf.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include "soh_assets.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Xc/z_en_xc.c b/soh/src/overlays/actors/ovl_En_Xc/z_en_xc.c index 9a9c94e21..546ec24f8 100644 --- a/soh/src/overlays/actors/ovl_En_Xc/z_en_xc.c +++ b/soh/src/overlays/actors/ovl_En_Xc/z_en_xc.c @@ -13,6 +13,8 @@ #include "scenes/indoors/tokinoma/tokinoma_scene.h" #include "scenes/dungeons/ice_doukutu/ice_doukutu_scene.h" #include "vt.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED diff --git a/soh/src/overlays/actors/ovl_En_Zf/z_en_zf.c b/soh/src/overlays/actors/ovl_En_Zf/z_en_zf.c index 562f22a4e..2ef15102c 100644 --- a/soh/src/overlays/actors/ovl_En_Zf/z_en_zf.c +++ b/soh/src/overlays/actors/ovl_En_Zf/z_en_zf.c @@ -8,6 +8,7 @@ #include "objects/object_zf/object_zf.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include "soh_assets.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c b/soh/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c index af1d0dc75..125b7351a 100644 --- a/soh/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c +++ b/soh/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c @@ -11,6 +11,7 @@ #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" #include "objects/object_zl2/object_zl2.h" #include "objects/object_zl2_anime2/object_zl2_anime2.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED diff --git a/soh/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c b/soh/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c index cdb88cc48..a50d64766 100644 --- a/soh/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c +++ b/soh/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c @@ -7,6 +7,8 @@ #include "z_en_zl4.h" #include "objects/object_zl4/object_zl4.h" #include "scenes/indoors/nakaniwa/nakaniwa_scene.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Zo/z_en_zo.c b/soh/src/overlays/actors/ovl_En_Zo/z_en_zo.c index 57ac15ecf..09a12ec8c 100644 --- a/soh/src/overlays/actors/ovl_En_Zo/z_en_zo.c +++ b/soh/src/overlays/actors/ovl_En_Zo/z_en_zo.c @@ -8,6 +8,7 @@ #include "objects/object_zo/object_zo.h" #include "soh/frame_interpolation.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_Fishing/z_fishing.c b/soh/src/overlays/actors/ovl_Fishing/z_fishing.c index 5f185b02d..930235618 100644 --- a/soh/src/overlays/actors/ovl_Fishing/z_fishing.c +++ b/soh/src/overlays/actors/ovl_Fishing/z_fishing.c @@ -11,6 +11,7 @@ #include "vt.h" #include "soh/frame_interpolation.h" +#include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED @@ -5090,16 +5091,14 @@ void Fishing_HandleOwnerDialog(Fishing* this, PlayState* play) { if (sLinkAge == LINK_AGE_CHILD) { // 9 lbs //if we should give the main prize AND it's not rando - if (GameInteractor_Should(VB_SHOULD_GIVE_VANILLA_FISHING_PRIZE, false, &fishData)){ - //((sFishingRecordLength >= 50.0f) && !(HIGH_SCORE(HS_FISHING) & HS_FISH_PRIZE_CHILD)) { + if (GameInteractor_Should(VB_SHOULD_GIVE_VANILLA_FISHING_PRIZE, (sFishingRecordLength >= 50.0f) && !(HIGH_SCORE(HS_FISHING) & HS_FISH_PRIZE_CHILD), &fishData)){ HIGH_SCORE(HS_FISHING) |= HS_FISH_PRIZE_CHILD; getItemId = GI_HEART_PIECE; sSinkingLureLocation = (u8)Rand_ZeroFloat(3.999f) + 1; } } else { // 13 lbs //if we should give the main prize AND it's not rando - if (GameInteractor_Should(VB_SHOULD_GIVE_VANILLA_FISHING_PRIZE, false, &fishData)){ - //(sFishingRecordLength >= 60.0f) && !(HIGH_SCORE(HS_FISHING) & HS_FISH_PRIZE_ADULT)) { + if (GameInteractor_Should(VB_SHOULD_GIVE_VANILLA_FISHING_PRIZE, (sFishingRecordLength >= 60.0f) && !(HIGH_SCORE(HS_FISHING) & HS_FISH_PRIZE_ADULT), &fishData)){ HIGH_SCORE(HS_FISHING) |= HS_FISH_PRIZE_ADULT; getItemId = GI_SCALE_GOLDEN; sSinkingLureLocation = (u8)Rand_ZeroFloat(3.999f) + 1; diff --git a/soh/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c b/soh/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c index 85a81af85..9d3c9c240 100644 --- a/soh/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c +++ b/soh/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c @@ -6,6 +6,7 @@ #include "z_item_b_heart.h" #include "objects/object_gi_hearts/object_gi_hearts.h" +#include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c b/soh/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c index 5aa223290..d2bbff4b7 100644 --- a/soh/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c +++ b/soh/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c @@ -6,6 +6,7 @@ #include "z_item_etcetera.h" #include +#include "soh/OTRGlobals.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED diff --git a/soh/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c b/soh/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c index 7a16f2a71..c1dd7f781 100644 --- a/soh/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c +++ b/soh/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c @@ -6,6 +6,7 @@ #include "z_item_ocarina.h" #include "scenes/overworld/spot00/spot00_scene.h" +#include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED diff --git a/soh/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c b/soh/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c index f785124f4..46fdccaa6 100644 --- a/soh/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c +++ b/soh/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c @@ -5,6 +5,7 @@ */ #include "z_magic_fire.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_NO_FREEZE_OCARINA) diff --git a/soh/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c b/soh/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c index ac7a35036..3d8d0cff0 100644 --- a/soh/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c +++ b/soh/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c @@ -5,6 +5,7 @@ */ #include "z_magic_wind.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_NO_FREEZE_OCARINA) diff --git a/soh/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c b/soh/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c index 18c898547..59d1b6203 100644 --- a/soh/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c +++ b/soh/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c @@ -8,6 +8,7 @@ #include "vt.h" #include "overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.h" #include "objects/object_lightswitch/object_lightswitch.h" +#include "soh/OTRGlobals.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED diff --git a/soh/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c b/soh/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c index 5b1eecbd4..2be6ea478 100644 --- a/soh/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c +++ b/soh/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c @@ -5,6 +5,7 @@ */ #include "z_obj_mure2.h" +#include "soh/OTRGlobals.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c b/soh/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c index 026598ac9..78c39649a 100644 --- a/soh/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c +++ b/soh/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c @@ -7,6 +7,7 @@ #include "z_obj_oshihiki.h" #include "overlays/actors/ovl_Obj_Switch/z_obj_switch.h" #include "objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED diff --git a/soh/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c b/soh/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c index 3869fa6e4..228e13d21 100644 --- a/soh/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c +++ b/soh/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c @@ -5,6 +5,8 @@ */ #include "z_oceff_storm.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED | ACTOR_FLAG_NO_FREEZE_OCARINA) diff --git a/soh/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c b/soh/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c index dfc236251..052de7f0d 100644 --- a/soh/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c +++ b/soh/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c @@ -6,6 +6,7 @@ #include "z_oceff_wipe.h" #include "vt.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_NO_FREEZE_OCARINA) diff --git a/soh/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c b/soh/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c index a6b422062..a9eabca24 100644 --- a/soh/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c +++ b/soh/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c @@ -6,6 +6,7 @@ #include "z_oceff_wipe2.h" #include "vt.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_NO_FREEZE_OCARINA) diff --git a/soh/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c b/soh/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c index 28f02100d..e0ceadeb4 100644 --- a/soh/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c +++ b/soh/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c @@ -6,6 +6,7 @@ #include "z_oceff_wipe3.h" #include "vt.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_NO_FREEZE_OCARINA) diff --git a/soh/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c b/soh/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c index 6c96e639f..5a1cb54ce 100644 --- a/soh/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c +++ b/soh/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c @@ -6,6 +6,7 @@ #include "z_oceff_wipe4.h" #include "vt.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_NO_FREEZE_OCARINA) diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index 151a47c13..cd79fc591 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -30,7 +30,8 @@ #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include "soh/Enhancements/randomizer/randomizer_grotto.h" #include "soh/frame_interpolation.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include #include diff --git a/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c b/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c index 18c57d6ff..b093a746c 100644 --- a/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c +++ b/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c @@ -22,6 +22,9 @@ #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include #include "z64save.h" +#include "soh/SaveManager.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" typedef struct { s16 left; @@ -1005,6 +1008,7 @@ void DrawSeedHashSprites(FileChooseContext* this) { } u8 generating; +int retries = 0; bool fileSelectSpoilerFileLoaded = false; void FileChoose_UpdateRandomizer() { @@ -1015,6 +1019,7 @@ void FileChoose_UpdateRandomizer() { } else if (CVarGetInteger(CVAR_GENERAL("RandoGenerating"), 0) == 0 && generating) { if (Randomizer_IsSeedGenerated()) { Audio_PlayFanfare(NA_BGM_HORSE_GOAL); + retries = 0; } else { Sfx_PlaySfxCentered(NA_SE_SY_OCARINA_ERROR); } @@ -1337,6 +1342,7 @@ void FileChoose_GenerateRandoSeed(GameState* thisx) { Audio_PlayFanfare(NA_BGM_HORSE_GOAL); func_800F5E18(SEQ_PLAYER_BGM_MAIN, NA_BGM_FILE_SELECT, 0, 7, 1); generating = 0; + retries = 0; Randomizer_SetSpoilerLoaded(true); static u8 emptyName[] = { 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E }; static u8 linkName[] = { 0x15, 0x2C, 0x31, 0x2E, 0x3E, 0x3E, 0x3E, 0x3E }; @@ -1358,7 +1364,13 @@ void FileChoose_GenerateRandoSeed(GameState* thisx) { return; } if (!generating) { - Randomizer_GenerateSeed(); + if (retries >= 5 || (retries >= 1 && Randomizer_IsSpoilerLoaded())){ + this->configMode = CM_QUEST_MENU; + retries = 0; + } else { + Randomizer_GenerateSeed(); + retries++; + } } } diff --git a/soh/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c b/soh/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c index 1ca66eb12..89092e77c 100644 --- a/soh/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c +++ b/soh/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c @@ -1,5 +1,6 @@ #include "file_choose.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/SaveManager.h" // when choosing a file to copy or erase, the 6 main menu buttons are placed at these offsets static s16 sChooseFileYOffsets[] = { -48, -48, -48, -24, -24, 0 }; diff --git a/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c b/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c index 6d73b0014..fba1f4a70 100644 --- a/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c +++ b/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c @@ -3,6 +3,9 @@ #include "assets/overlays/ovl_File_Choose/ovl_file_choose.h" #include "assets/soh_assets.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" +#include "soh/SaveManager.h" static s16 D_808124C0[] = { diff --git a/soh/src/overlays/gamestates/ovl_select/z_select.c b/soh/src/overlays/gamestates/ovl_select/z_select.c index 051aa3c00..6d826dd61 100644 --- a/soh/src/overlays/gamestates/ovl_select/z_select.c +++ b/soh/src/overlays/gamestates/ovl_select/z_select.c @@ -11,6 +11,8 @@ #include "soh/Enhancements/enhancementTypes.h" #include "soh/Enhancements/randomizer/randomizer_entrance.h" #include "soh/Enhancements/randomizer/randomizer_grotto.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" void Select_SwitchBetterWarpMode(SelectContext* this, u8 isBetterWarpMode); void Sram_InitDebugSave(void); diff --git a/soh/src/overlays/gamestates/ovl_title/z_title.c b/soh/src/overlays/gamestates/ovl_title/z_title.c index 649261575..b40291bd0 100644 --- a/soh/src/overlays/gamestates/ovl_title/z_title.c +++ b/soh/src/overlays/gamestates/ovl_title/z_title.c @@ -13,6 +13,7 @@ #include #include #include +#include "soh/ResourceManagerHelpers.h" #include #include "time.h" diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c index d4a586b2b..3bbb81e0c 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c @@ -5,6 +5,7 @@ #include "soh/Enhancements/randomizer/randomizerTypes.h" #include "soh/Enhancements/enhancementTypes.h" #include "soh/Enhancements/cosmetics/cosmeticsTypes.h" +#include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c index 903d78173..217ec24e3 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c @@ -18,6 +18,9 @@ #include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/cosmetics/cosmeticsTypes.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" +#include "soh/SaveManager.h" #include "soh/Enhancements/kaleido.h" diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_lmap_mark.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_lmap_mark.c index 0de1d117a..f884d5a28 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_lmap_mark.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_lmap_mark.c @@ -1,5 +1,6 @@ #include "z_kaleido_scope.h" #include "textures/parameter_static/parameter_static.h" +#include "soh/ResourceManagerHelpers.h" typedef struct { /* 0x00 */ void* texture;