From 289cb2e1c46b1613e466c22063bdc0c49a9144bd Mon Sep 17 00:00:00 2001 From: sitton76 <58642183+sitton76@users.noreply.github.com> Date: Tue, 18 Jul 2023 19:07:09 -0500 Subject: [PATCH 1/8] Changed method of mod loading to read off a .json file --- soh/soh/OTRGlobals.cpp | 44 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index b044c05339b..62d172f0fb0 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -16,6 +16,10 @@ #include "z64bgcheck.h" #include "Enhancements/gameconsole.h" #include + +#include +using json = nlohmann::json; + #ifdef _WIN32 #include #else @@ -220,16 +224,40 @@ OTRGlobals::OTRGlobals() { if (std::filesystem::exists(sohOtrPath)) { OTRFiles.push_back(sohOtrPath); } - std::string patchesPath = LUS::Context::GetPathRelativeToAppDirectory("mods"); - if (patchesPath.length() > 0 && std::filesystem::exists(patchesPath)) { - if (std::filesystem::is_directory(patchesPath)) { - for (const auto& p : std::filesystem::recursive_directory_iterator(patchesPath)) { - if (StringHelper::IEquals(p.path().extension().string(), ".otr")) { - OTRFiles.push_back(p.path().generic_string()); - } - } + //Old Method Start + // std::string patchesPath = LUS::Context::GetPathRelativeToAppDirectory("mods"); + // if (patchesPath.length() > 0 && std::filesystem::exists(patchesPath)) { + // if (std::filesystem::is_directory(patchesPath)) { + // for (const auto& p : std::filesystem::recursive_directory_iterator(patchesPath)) { + // if (StringHelper::IEquals(p.path().extension().string(), ".otr")) { + // OTRFiles.push_back(p.path().generic_string()); + // } + // } + // } + // } + //Old Method Ends + //New Method + + std::string modOrderJsonPath = LUS::Context::GetPathRelativeToAppBundle("load-order.json"); + if (std::filesystem::exists(modOrderJsonPath)) { + std::cout << "\nMod file located at: " << modOrderJsonPath; + std::ifstream modJson(modOrderJsonPath); + json modData = json::parse(modJson); + std::string modCountStr = modData.at("List-size"); + int modCountInt = std::stoi(modCountStr); + std::cout << "\nMod order size is: " << modCountInt << "\n"; + int iter_count = 0; + while (iter_count < modCountInt) { + if (std::filesystem::exists(modData.at(std::to_string(iter_count)))) { + std::cout << "\nMod found in: " << modData.at(std::to_string(iter_count)) << "\n"; + OTRFiles.push_back(modData.at(std::to_string(iter_count))); + } + iter_count += 1; } + } else { + std::cout << "Could not find JSON file"; } + std::unordered_set ValidHashes = { OOT_PAL_MQ, OOT_NTSC_JP_MQ, From 297cdd411abb21e8c5b5cbea0a1f3757be8292fb Mon Sep 17 00:00:00 2001 From: sitton76 <58642183+sitton76@users.noreply.github.com> Date: Tue, 18 Jul 2023 19:24:14 -0500 Subject: [PATCH 2/8] Forgot to include the last entry in the .json file --- soh/soh/OTRGlobals.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index 62d172f0fb0..78c3dbec8ff 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -245,9 +245,9 @@ OTRGlobals::OTRGlobals() { json modData = json::parse(modJson); std::string modCountStr = modData.at("List-size"); int modCountInt = std::stoi(modCountStr); - std::cout << "\nMod order size is: " << modCountInt << "\n"; + std::cout << "\nMod order size is: " << modCountInt + 1 << "\n"; int iter_count = 0; - while (iter_count < modCountInt) { + while (iter_count <= modCountInt) { if (std::filesystem::exists(modData.at(std::to_string(iter_count)))) { std::cout << "\nMod found in: " << modData.at(std::to_string(iter_count)) << "\n"; OTRFiles.push_back(modData.at(std::to_string(iter_count))); From 05d8fe4615455b4e9de43267ced4c638ba2903d6 Mon Sep 17 00:00:00 2001 From: sitton76 <58642183+sitton76@users.noreply.github.com> Date: Tue, 18 Jul 2023 20:47:20 -0500 Subject: [PATCH 3/8] Added proper logging messages + fallback to old behavior when .json file is not found --- soh/soh/OTRGlobals.cpp | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index 78c3dbec8ff..7be8b295121 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -240,22 +240,32 @@ OTRGlobals::OTRGlobals() { std::string modOrderJsonPath = LUS::Context::GetPathRelativeToAppBundle("load-order.json"); if (std::filesystem::exists(modOrderJsonPath)) { - std::cout << "\nMod file located at: " << modOrderJsonPath; + spdlog::info("\nMod file located at: {}", modOrderJsonPath); std::ifstream modJson(modOrderJsonPath); json modData = json::parse(modJson); std::string modCountStr = modData.at("List-size"); int modCountInt = std::stoi(modCountStr); - std::cout << "\nMod order size is: " << modCountInt + 1 << "\n"; + spdlog::info("\nMod order size is: {} ", modCountInt + 1, "\n"); int iter_count = 0; while (iter_count <= modCountInt) { - if (std::filesystem::exists(modData.at(std::to_string(iter_count)))) { - std::cout << "\nMod found in: " << modData.at(std::to_string(iter_count)) << "\n"; - OTRFiles.push_back(modData.at(std::to_string(iter_count))); - } - iter_count += 1; + if (std::filesystem::exists(modData.at(std::to_string(iter_count)))) { + spdlog::info("\nMod found in: {}{}", modData.at(std::to_string(iter_count)), "\n"); + OTRFiles.push_back(modData.at(std::to_string(iter_count))); + } + iter_count += 1; } } else { - std::cout << "Could not find JSON file"; + spdlog::warn("\nCould not find 'load-order.json' file, loading from mods folder...\n"); + std::string patchesPath = LUS::Context::GetPathRelativeToAppDirectory("mods"); + if (patchesPath.length() > 0 && std::filesystem::exists(patchesPath)) { + if (std::filesystem::is_directory(patchesPath)) { + for (const auto& p : std::filesystem::recursive_directory_iterator(patchesPath)) { + if (StringHelper::IEquals(p.path().extension().string(), ".otr")) { + OTRFiles.push_back(p.path().generic_string()); + } + } + } + } } std::unordered_set ValidHashes = { From 9bd20bd51afd750dcc4134cc047b99edc8e57fdf Mon Sep 17 00:00:00 2001 From: sitton76 <58642183+sitton76@users.noreply.github.com> Date: Tue, 18 Jul 2023 21:26:59 -0500 Subject: [PATCH 4/8] Added comments and additional logging when using the fallback behavior --- soh/soh/OTRGlobals.cpp | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index 7be8b295121..558cbb877cb 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -224,22 +224,13 @@ OTRGlobals::OTRGlobals() { if (std::filesystem::exists(sohOtrPath)) { OTRFiles.push_back(sohOtrPath); } - //Old Method Start - // std::string patchesPath = LUS::Context::GetPathRelativeToAppDirectory("mods"); - // if (patchesPath.length() > 0 && std::filesystem::exists(patchesPath)) { - // if (std::filesystem::is_directory(patchesPath)) { - // for (const auto& p : std::filesystem::recursive_directory_iterator(patchesPath)) { - // if (StringHelper::IEquals(p.path().extension().string(), ".otr")) { - // OTRFiles.push_back(p.path().generic_string()); - // } - // } - // } - // } - //Old Method Ends - //New Method + //Attempts to find a 'load-order.json' file, if it fails to find one it will fallback to the previous behavior of how mods are loaded. std::string modOrderJsonPath = LUS::Context::GetPathRelativeToAppBundle("load-order.json"); if (std::filesystem::exists(modOrderJsonPath)) { + //Ideally I would like to put some sort of error handling here to prevent improperly formated .json files from preventing the program from running. + //(example: when its looking for non-existant indexes.) + //If anyone knows how to go about that in a way that the game continues execution please feel free. spdlog::info("\nMod file located at: {}", modOrderJsonPath); std::ifstream modJson(modOrderJsonPath); json modData = json::parse(modJson); @@ -261,6 +252,7 @@ OTRGlobals::OTRGlobals() { if (std::filesystem::is_directory(patchesPath)) { for (const auto& p : std::filesystem::recursive_directory_iterator(patchesPath)) { if (StringHelper::IEquals(p.path().extension().string(), ".otr")) { + spdlog::info("\nMod Found in: {}{}", p.path().generic_string(), "\n"); OTRFiles.push_back(p.path().generic_string()); } } From 46d5a434893142a6ff9b98b96a46cadb22691d38 Mon Sep 17 00:00:00 2001 From: sitton76 <58642183+sitton76@users.noreply.github.com> Date: Thu, 20 Jul 2023 18:15:26 -0500 Subject: [PATCH 5/8] Made it so it only loads mods from the /mods folder, added check to prevent execution hang if .json entry required is missing, now reads mod load order from shipofharknian.json. --- soh/soh/OTRGlobals.cpp | 43 +++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index 558cbb877cb..4226b5b6ff7 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -225,29 +225,38 @@ OTRGlobals::OTRGlobals() { OTRFiles.push_back(sohOtrPath); } + std::string patchesPath = LUS::Context::GetPathRelativeToAppDirectory("mods"); //Attempts to find a 'load-order.json' file, if it fails to find one it will fallback to the previous behavior of how mods are loaded. - std::string modOrderJsonPath = LUS::Context::GetPathRelativeToAppBundle("load-order.json"); - if (std::filesystem::exists(modOrderJsonPath)) { + std::string sohJsonPath = LUS::Context::GetPathRelativeToAppBundle("shipofharkinian.json"); + + bool useLoadOrder = false; + if (std::filesystem::exists(sohJsonPath)) { //Ideally I would like to put some sort of error handling here to prevent improperly formated .json files from preventing the program from running. //(example: when its looking for non-existant indexes.) //If anyone knows how to go about that in a way that the game continues execution please feel free. - spdlog::info("\nMod file located at: {}", modOrderJsonPath); - std::ifstream modJson(modOrderJsonPath); - json modData = json::parse(modJson); - std::string modCountStr = modData.at("List-size"); - int modCountInt = std::stoi(modCountStr); - spdlog::info("\nMod order size is: {} ", modCountInt + 1, "\n"); - int iter_count = 0; - while (iter_count <= modCountInt) { - if (std::filesystem::exists(modData.at(std::to_string(iter_count)))) { - spdlog::info("\nMod found in: {}{}", modData.at(std::to_string(iter_count)), "\n"); - OTRFiles.push_back(modData.at(std::to_string(iter_count))); + std::ifstream sohJsonData(sohJsonPath); + json modData = json::parse(sohJsonData); + if (modData.contains("Mod-Load-Order")) { + useLoadOrder = true; + spdlog::info("\nLoading mods using load order from shipofharknian.json...\n"); + int modCountInt = modData["Mod-Load-Order"]["List-size"]; + spdlog::info("\nThe mod count is: {} ", modCountInt, "\n"); + int iter_count = 1; + while (iter_count <= modCountInt) { + std::string foundModEntry = modData["Mod-Load-Order"][std::to_string(iter_count)]; + std::string gotModPath = patchesPath + "/" + foundModEntry; + if (std::filesystem::exists(gotModPath)) { + spdlog::info("\nMod file {} found!{}", gotModPath, "\n"); + OTRFiles.push_back(gotModPath); + } else { + spdlog::warn("\nMod file {} missing...{}", gotModPath, "\n"); + } + iter_count += 1; } - iter_count += 1; } - } else { - spdlog::warn("\nCould not find 'load-order.json' file, loading from mods folder...\n"); - std::string patchesPath = LUS::Context::GetPathRelativeToAppDirectory("mods"); + } + if (useLoadOrder == false) { + spdlog::info("\nLoad order listing not found in shipofharknian.json, loading attempts to load mods from mods folder...\n"); if (patchesPath.length() > 0 && std::filesystem::exists(patchesPath)) { if (std::filesystem::is_directory(patchesPath)) { for (const auto& p : std::filesystem::recursive_directory_iterator(patchesPath)) { From eb79f37b5419f4d8ff9cab57c0f7ef8fcfb8f5f5 Mon Sep 17 00:00:00 2001 From: sitton76 <58642183+sitton76@users.noreply.github.com> Date: Thu, 20 Jul 2023 19:42:44 -0500 Subject: [PATCH 6/8] Cleaned up outdated comments --- soh/soh/OTRGlobals.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index 4226b5b6ff7..32d2b13e10e 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -226,14 +226,9 @@ OTRGlobals::OTRGlobals() { } std::string patchesPath = LUS::Context::GetPathRelativeToAppDirectory("mods"); - //Attempts to find a 'load-order.json' file, if it fails to find one it will fallback to the previous behavior of how mods are loaded. std::string sohJsonPath = LUS::Context::GetPathRelativeToAppBundle("shipofharkinian.json"); - bool useLoadOrder = false; if (std::filesystem::exists(sohJsonPath)) { - //Ideally I would like to put some sort of error handling here to prevent improperly formated .json files from preventing the program from running. - //(example: when its looking for non-existant indexes.) - //If anyone knows how to go about that in a way that the game continues execution please feel free. std::ifstream sohJsonData(sohJsonPath); json modData = json::parse(sohJsonData); if (modData.contains("Mod-Load-Order")) { From c20018e80bf883d8cfede7168b8a0a71c1b7b817 Mon Sep 17 00:00:00 2001 From: sitton76 <58642183+sitton76@users.noreply.github.com> Date: Mon, 14 Aug 2023 21:51:48 -0500 Subject: [PATCH 7/8] Synced to current SoH, updated LUS, possibly fixed Linux appimage load order --- soh/soh/OTRGlobals.cpp | 114 ++++++++++++++++++++++++++++++++++------- 1 file changed, 96 insertions(+), 18 deletions(-) diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index 32d2b13e10e..f5b247c8451 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -12,14 +12,13 @@ #include #include +#include +using json = nlohmann::json; + #include "z64animation.h" #include "z64bgcheck.h" #include "Enhancements/gameconsole.h" #include - -#include -using json = nlohmann::json; - #ifdef _WIN32 #include #else @@ -212,11 +211,11 @@ const char* constCameraStrings[] = { OTRGlobals::OTRGlobals() { std::vector OTRFiles; - std::string mqPath = LUS::Context::GetPathRelativeToAppDirectory("oot-mq.otr"); + std::string mqPath = LUS::Context::LocateFileAcrossAppDirs("oot-mq.otr", appShortName); if (std::filesystem::exists(mqPath)) { OTRFiles.push_back(mqPath); } - std::string ootPath = LUS::Context::GetPathRelativeToAppDirectory("oot.otr"); + std::string ootPath = LUS::Context::LocateFileAcrossAppDirs("oot.otr", appShortName); if (std::filesystem::exists(ootPath)) { OTRFiles.push_back(ootPath); } @@ -225,8 +224,8 @@ OTRGlobals::OTRGlobals() { OTRFiles.push_back(sohOtrPath); } - std::string patchesPath = LUS::Context::GetPathRelativeToAppDirectory("mods"); - std::string sohJsonPath = LUS::Context::GetPathRelativeToAppBundle("shipofharkinian.json"); + std::string patchesPath = LUS::Context::LocateFileAcrossAppDirs("mods", appShortName); + std::string sohJsonPath = LUS::Context::LocateFileAcrossAppDirs("shipofharkinian.json", appShortName); bool useLoadOrder = false; if (std::filesystem::exists(sohJsonPath)) { std::ifstream sohJsonData(sohJsonPath); @@ -263,7 +262,6 @@ OTRGlobals::OTRGlobals() { } } } - std::unordered_set ValidHashes = { OOT_PAL_MQ, OOT_NTSC_JP_MQ, @@ -282,7 +280,7 @@ OTRGlobals::OTRGlobals() { OOT_PAL_GC_DBG2 }; // tell LUS to reserve 3 SoH specific threads (Game, Audio, Save) - context = LUS::Context::CreateInstance("Ship of Harkinian", "soh", "shipofharkinian.json", OTRFiles, {}, 3); + context = LUS::Context::CreateInstance("Ship of Harkinian", appShortName, "shipofharkinian.json", OTRFiles, {}, 3); context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(LUS::ResourceType::SOH_Animation, "Animation", std::make_shared()); context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(LUS::ResourceType::SOH_PlayerAnimation, "PlayerAnimation", std::make_shared()); @@ -751,8 +749,16 @@ extern "C" void OTRExtScanner() { extern "C" void InitOTR() { #if not defined (__SWITCH__) && not defined(__WIIU__) - if (!std::filesystem::exists(LUS::Context::GetPathRelativeToAppDirectory("oot-mq.otr")) && - !std::filesystem::exists(LUS::Context::GetPathRelativeToAppDirectory("oot.otr"))){ + if (!std::filesystem::exists(LUS::Context::LocateFileAcrossAppDirs("oot-mq.otr", appShortName)) && + !std::filesystem::exists(LUS::Context::LocateFileAcrossAppDirs("oot.otr", appShortName))){ + + std::string installPath = LUS::Context::GetAppBundlePath(); + if (!std::filesystem::exists(installPath + "/assets/extractor")) { + Extractor::ShowErrorBox("Extractor assets not found", + "No OTR files found. Missing assets/extractor folder needed to generate OTR file. Exiting..."); + exit(1); + } + bool generatedOtrIsMQ = false; if (Extractor::ShowYesNoBox("No OTR Files", "No OTR files found. Generate one now?") == IDYES) { Extractor extract; @@ -760,7 +766,7 @@ extern "C" void InitOTR() { Extractor::ShowErrorBox("Error", "An error occured, no OTR file was generated. Exiting..."); exit(1); } - extract.CallZapd(); + extract.CallZapd(installPath, LUS::Context::GetAppDirectoryPath(appShortName)); generatedOtrIsMQ = extract.IsMasterQuest(); } else { exit(1); @@ -770,7 +776,7 @@ extern "C" void InitOTR() { if (!extract.Run(generatedOtrIsMQ ? RomSearchMode::Vanilla : RomSearchMode::MQ)) { Extractor::ShowErrorBox("Error", "An error occured, an OTR file may have been generated by a different step. Continuing..."); } else { - extract.CallZapd(); + extract.CallZapd(installPath, LUS::Context::GetAppDirectoryPath(appShortName)); } } } @@ -1064,6 +1070,52 @@ extern "C" uint32_t ResourceMgr_GetGameVersion(int index) { return LUS::Context::GetInstance()->GetResourceManager()->GetArchive()->GetGameVersions()[index]; } +extern "C" uint32_t ResourceMgr_GetGamePlatform(int index) { + uint32_t version = LUS::Context::GetInstance()->GetResourceManager()->GetArchive()->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 = LUS::Context::GetInstance()->GetResourceManager()->GetArchive()->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("gBetterDebugWarpScreenMQMode", WARP_MODE_OVERRIDE_OFF); @@ -1932,19 +1984,45 @@ extern "C" int CustomMessage_RetrieveIfExists(PlayState* play) { CustomMessage messageEntry; s16 actorParams = 0; if (gSaveContext.n64ddFlag) { + Player* player = GET_PLAYER(play); if (textId == TEXT_RANDOMIZER_CUSTOM_ITEM) { - Player* player = GET_PLAYER(play); if (player->getItemEntry.getItemId == RG_ICE_TRAP) { u16 iceTrapTextId = Random(0, NUM_ICE_TRAP_MESSAGES); messageEntry = CustomMessageManager::Instance->RetrieveMessage(Randomizer::IceTrapRandoMessageTableID, iceTrapTextId); if (CVarGetInteger("gLetItSnow", 0)) { messageEntry = CustomMessageManager::Instance->RetrieveMessage(Randomizer::IceTrapRandoMessageTableID, NUM_ICE_TRAP_MESSAGES + 1); } - } else if (player->getItemEntry.getItemId >= RG_DEKU_TREE_MAP && player->getItemEntry.getItemId <= RG_ICE_CAVERN_MAP) { - messageEntry = OTRGlobals::Instance->gRandomizer->GetMapGetItemMessageWithHint(player->getItemEntry); } else { messageEntry = Randomizer_GetCustomGetItemMessage(player); } + } else if (textId == TEXT_ITEM_DUNGEON_MAP || textId == TEXT_ITEM_COMPASS) { + if (DUNGEON_ITEMS_CAN_BE_OUTSIDE_DUNGEON(RSK_STARTING_MAPS_COMPASSES)) { + if (textId == TEXT_ITEM_DUNGEON_MAP) { + messageEntry = OTRGlobals::Instance->gRandomizer->GetMapGetItemMessageWithHint(player->getItemEntry); + } else { + messageEntry = Randomizer_GetCustomGetItemMessage(player); + } + } + } else if (textId == TEXT_ITEM_KEY_BOSS) { + if (player->getItemEntry.getItemId == RG_GANONS_CASTLE_BOSS_KEY) { + if (DUNGEON_ITEMS_CAN_BE_OUTSIDE_DUNGEON(RSK_GANONS_BOSS_KEY)) { + messageEntry = Randomizer_GetCustomGetItemMessage(player); + } + } else { + if (DUNGEON_ITEMS_CAN_BE_OUTSIDE_DUNGEON(RSK_BOSS_KEYSANITY)) { + messageEntry = Randomizer_GetCustomGetItemMessage(player); + } + } + } else if (textId == TEXT_ITEM_KEY_SMALL) { + if (player->getItemEntry.getItemId == RG_GERUDO_FORTRESS_SMALL_KEY) { + if (Randomizer_GetSettingValue(RSK_GERUDO_KEYS) != RO_GERUDO_KEYS_VANILLA) { + messageEntry = Randomizer_GetCustomGetItemMessage(player); + } + } else { + if (DUNGEON_ITEMS_CAN_BE_OUTSIDE_DUNGEON(RSK_KEYSANITY)) { + messageEntry = Randomizer_GetCustomGetItemMessage(player); + } + } } else if (textId == TEXT_RANDOMIZER_GOSSIP_STONE_HINTS && Randomizer_GetSettingValue(RSK_GOSSIP_STONE_HINTS) != RO_GOSSIP_STONES_NONE && (Randomizer_GetSettingValue(RSK_GOSSIP_STONE_HINTS) == RO_GOSSIP_STONES_NEED_NOTHING || (Randomizer_GetSettingValue(RSK_GOSSIP_STONE_HINTS) == RO_GOSSIP_STONES_NEED_TRUTH && @@ -2128,4 +2206,4 @@ extern "C" void EntranceTracker_SetLastEntranceOverride(s16 entranceIndex) { extern "C" void Gfx_RegisterBlendedTexture(const char* name, u8* mask, u8* replacement) { gfx_register_blended_texture(name, mask, replacement); -} +} \ No newline at end of file From 9054ddfa278744e0f95777de89b46b461fab7b95 Mon Sep 17 00:00:00 2001 From: sitton76 <58642183+sitton76@users.noreply.github.com> Date: Tue, 15 Aug 2023 10:00:36 -0500 Subject: [PATCH 8/8] Removed the testing spdlog calls --- soh/soh/OTRGlobals.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index f5b247c8451..a8358fa578b 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -232,30 +232,23 @@ OTRGlobals::OTRGlobals() { json modData = json::parse(sohJsonData); if (modData.contains("Mod-Load-Order")) { useLoadOrder = true; - spdlog::info("\nLoading mods using load order from shipofharknian.json...\n"); int modCountInt = modData["Mod-Load-Order"]["List-size"]; - spdlog::info("\nThe mod count is: {} ", modCountInt, "\n"); int iter_count = 1; while (iter_count <= modCountInt) { std::string foundModEntry = modData["Mod-Load-Order"][std::to_string(iter_count)]; std::string gotModPath = patchesPath + "/" + foundModEntry; if (std::filesystem::exists(gotModPath)) { - spdlog::info("\nMod file {} found!{}", gotModPath, "\n"); OTRFiles.push_back(gotModPath); - } else { - spdlog::warn("\nMod file {} missing...{}", gotModPath, "\n"); } iter_count += 1; } } } if (useLoadOrder == false) { - spdlog::info("\nLoad order listing not found in shipofharknian.json, loading attempts to load mods from mods folder...\n"); if (patchesPath.length() > 0 && std::filesystem::exists(patchesPath)) { if (std::filesystem::is_directory(patchesPath)) { for (const auto& p : std::filesystem::recursive_directory_iterator(patchesPath)) { if (StringHelper::IEquals(p.path().extension().string(), ".otr")) { - spdlog::info("\nMod Found in: {}{}", p.path().generic_string(), "\n"); OTRFiles.push_back(p.path().generic_string()); } }