From 279c40cb7d9655fb2dc7a889a8f25a8917b99c48 Mon Sep 17 00:00:00 2001 From: Bytenex Date: Thu, 15 Jun 2023 05:29:07 +0200 Subject: [PATCH] added option to choose between OoT and any ocarina (#2944) --- soh/soh/Enhancements/mods.cpp | 2 +- soh/soh/SohMenuBar.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/soh/soh/Enhancements/mods.cpp b/soh/soh/Enhancements/mods.cpp index 0ee5eec04..fd19dd35d 100644 --- a/soh/soh/Enhancements/mods.cpp +++ b/soh/soh/Enhancements/mods.cpp @@ -208,7 +208,7 @@ void RegisterOcarinaTimeTravel() { uint8_t hasOcarinaOfTime = (INV_CONTENT(ITEM_OCARINA_TIME) == ITEM_OCARINA_TIME); // If TimeTravel + Player have the Ocarina of Time + Have Master Sword + is in proper range // TODO: Once Swordless Adult is fixed: Remove the Master Sword check - if (CVarGetInteger("gTimeTravel", 0) && hasOcarinaOfTime && hasMasterSword && + if (((CVarGetInteger("gTimeTravel", 0) == 1 && hasOcarinaOfTime) || CVarGetInteger("gTimeTravel", 0) == 2) && hasMasterSword && gPlayState->msgCtx.lastPlayedSong == OCARINA_SONG_TIME && !nearbyTimeBlockEmpty && !nearbyTimeBlock && !nearbyOcarinaSpot && !nearbyFrogs) { diff --git a/soh/soh/SohMenuBar.cpp b/soh/soh/SohMenuBar.cpp index 695b2f629..83b3bbbc4 100644 --- a/soh/soh/SohMenuBar.cpp +++ b/soh/soh/SohMenuBar.cpp @@ -89,6 +89,7 @@ std::string GetWindowButtonText(const char* text, bool menuOpen) { "8 Hearts", "OHKO" }; + static const char* timeTravelOptions[3] = { "Disabled", "Ocarina of Time", "Any Ocarina" }; extern "C" SaveContext gSaveContext; @@ -545,11 +546,12 @@ void DrawEnhancementsMenu() { UIWidgets::Tooltip("Nighttime Skulltulas will spawn during both day and night."); UIWidgets::PaddedEnhancementCheckbox("Dampe Appears All Night", "gDampeAllNight", true, false); UIWidgets::Tooltip("Makes Dampe appear anytime during the night, not just his usual working hours."); - UIWidgets::PaddedEnhancementCheckbox("Time Travel with the Song of Time", "gTimeTravel", true, false); + UIWidgets::PaddedText("Time Travel with the Song of Time", true, false); + UIWidgets::EnhancementCombobox("gTimeTravel", timeTravelOptions, 0); UIWidgets::Tooltip("Allows Link to freely change age by playing the Song of Time.\n" "Time Blocks can still be used properly.\n\n" "Requirements:\n" - "- Obtained the Ocarina of Time\n" + "- Obtained the Ocarina of Time (depends on selection)\n" "- Obtained the Song of Time\n" "- Obtained the Master Sword\n" "- Not within range of Time Block\n"