From b9e18519a2800158d9f4a06e67e20588de66aeb9 Mon Sep 17 00:00:00 2001 From: Christopher Leggett Date: Mon, 8 Aug 2022 23:40:02 -0400 Subject: [PATCH] Removes Skulltula text auto-dismiss in tokensanity More precisely, removes the auto-dimissal from the Skulltula textbox when in a rando save and any token shuffle is on. Bonus Fix: parses the Skullsanity setting from the spoilerfile, which wasn't happening before. --- soh/soh/Enhancements/randomizer/randomizer.cpp | 17 +++++++++++++++-- soh/soh/OTRGlobals.cpp | 10 +++++++++- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index 62edadce9d..250f4e3f13 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -1406,14 +1406,15 @@ std::unordered_map SpoilerfileSettingNameToEn { "Open Settings:Random Ganon's Trials", RSK_RANDOM_TRIALS }, { "Open Settings:Trial Count", RSK_TRIAL_COUNT }, { "Shuffle Settings:Shuffle Cows", RSK_SHUFFLE_COWS }, + { "Shuffle Settings:Tokensanity", RSK_SHUFFLE_TOKENS }, { "Start with Deku Shield", RSK_STARTING_DEKU_SHIELD }, { "Start with Kokiri Sword", RSK_STARTING_KOKIRI_SWORD }, { "Start with Fairy Ocarina", RSK_STARTING_OCARINA }, { "Shuffle Dungeon Items:Start with Maps/Compasses", RSK_STARTING_MAPS_COMPASSES }, { "Shuffle Dungeon Items:Ganon's Boss Key", RSK_GANONS_BOSS_KEY }, { "Misc Settings:Gossip Stone Hints", RSK_GOSSIP_STONE_HINTS }, - { "Misc Settings:Hint Clarity", RSK_HINT_CLARITY}, - { "Misc Settings:Hint Distribution", RSK_HINT_DISTRIBUTION}, + { "Misc Settings:Hint Clarity", RSK_HINT_CLARITY }, + { "Misc Settings:Hint Distribution", RSK_HINT_DISTRIBUTION }, { "Skip Child Zelda", RSK_SKIP_CHILD_ZELDA }, { "Start with Consumables", RSK_STARTING_CONSUMABLES }, { "Start with Max Rupees", RSK_FULL_WALLETS }, @@ -1731,6 +1732,18 @@ void Randomizer::ParseRandomizerSettingsFile(const char* spoilerFileName) { } else if (it.value() == "Skip") { gSaveContext.randoSettings[index].value = 1; } + break; + case RSK_SHUFFLE_TOKENS: + if (it.value() == "Off") { + gSaveContext.randoSettings[index].value = 0; + } else if (it.value() == "Dungeons") { + gSaveContext.randoSettings[index].value = 1; + } else if (it.value() == "Overworld") { + gSaveContext.randoSettings[index].value = 2; + } else if (it.value() == "All Tokens") { + gSaveContext.randoSettings[index].value = 3; + } + break; } index++; } diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index ba61805f04..b85d092fb1 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -1546,7 +1546,15 @@ extern "C" int CustomMessage_RetrieveIfExists(GlobalContext* globalCtx) { } if (textId == TEXT_GS_NO_FREEZE || textId == TEXT_GS_FREEZE) { if (CVar_GetS32("gInjectSkulltulaCount", 0) != 0) { - if (CVar_GetS32("gSkulltulaFreeze", 0) != 0) { + // The freeze text cannot be manually dismissed and must be auto-dismissed. + // This is fine and even wanted when skull tokens are not shuffled, but when + // when they are shuffled we don't want to be able to manually dismiss the box. + // Otherwise if we get a token from a chest or an NPC we get stuck in the ItemGet + // animation until the text box auto-dismisses. + // RANDOTODO: Implement a way to determine if an item came from a skulltula and + // inject the auto-dismiss control code if it did. + if (CVar_GetS32("gSkulltulaFreeze", 0) != 0 && + !(gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_TOKENS) > 0)) { textId = TEXT_GS_NO_FREEZE; } else { textId = TEXT_GS_FREEZE;