diff --git a/mm/2s2h/BenGui/BenMenuBar.cpp b/mm/2s2h/BenGui/BenMenuBar.cpp index 37089aa7f..465ae3b8a 100644 --- a/mm/2s2h/BenGui/BenMenuBar.cpp +++ b/mm/2s2h/BenGui/BenMenuBar.cpp @@ -465,6 +465,10 @@ void DrawEnhancementsMenu() { { .tooltip = "Playing the Song Of Time will not reset the Sword back to Kokiri Sword." }); UIWidgets::CVarCheckbox("Do not reset Rupees", "gEnhancements.Cycle.DoNotResetRupees", { .tooltip = "Playing the Song Of Time will not reset the your rupees." }); + UIWidgets::CVarCheckbox( + "Do not reset Time Speed", "gEnhancements.Cycle.DoNotResetTimeSpeed", + { .tooltip = + "Playing the Song Of Time will not reset the current time speed set by Inverted Song of Time." }); ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(255, 255, 0, 255)); ImGui::SeparatorText("Unstable"); diff --git a/mm/2s2h/Enhancements/Cycle/EndOfCycle.cpp b/mm/2s2h/Enhancements/Cycle/EndOfCycle.cpp index d1afedaac..9624d337b 100644 --- a/mm/2s2h/Enhancements/Cycle/EndOfCycle.cpp +++ b/mm/2s2h/Enhancements/Cycle/EndOfCycle.cpp @@ -7,10 +7,13 @@ extern "C" { } SaveInfo saveInfoCopy; +s32 timeSpeedOffsetCopy = 0; void RegisterEndOfCycleSaveHooks() { - GameInteractor::Instance->RegisterGameHook( - []() { memcpy(&saveInfoCopy, &gSaveContext.save.saveInfo, sizeof(SaveInfo)); }); + GameInteractor::Instance->RegisterGameHook([]() { + memcpy(&saveInfoCopy, &gSaveContext.save.saveInfo, sizeof(SaveInfo)); + timeSpeedOffsetCopy = gSaveContext.save.timeSpeedOffset; + }); GameInteractor::Instance->RegisterGameHook([]() { if (CVarGetInteger("gEnhancements.Cycle.DoNotResetRupees", 0)) { @@ -77,5 +80,9 @@ void RegisterEndOfCycleSaveHooks() { SET_EQUIP_VALUE(EQUIP_TYPE_SWORD, EQUIP_VALUE_SWORD_RAZOR); CUR_FORM_EQUIP(EQUIP_SLOT_B) = ITEM_SWORD_RAZOR; } + + if (CVarGetInteger("gEnhancements.Cycle.DoNotResetTimeSpeed", 0)) { + gSaveContext.save.timeSpeedOffset = timeSpeedOffsetCopy; + } }); }