Remember save location (#980)

* Remember save location

* Clarified grotto caveat

* Update ImGuiImpl.cpp
This commit is contained in:
InfoManiac742 2022-08-02 20:47:57 -07:00 committed by GitHub
parent 7267b60a26
commit 27e0f19dac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 61 additions and 55 deletions

View File

@ -1013,6 +1013,9 @@ namespace SohImGui {
Tooltip("Allow Link to put items away without having to wait around"); Tooltip("Allow Link to put items away without having to wait around");
EnhancementCheckbox("Mask Select in Inventory", "gMaskSelect"); EnhancementCheckbox("Mask Select in Inventory", "gMaskSelect");
Tooltip("After completing the mask trading sub-quest, press A and any direction on the mask slot to change masks"); Tooltip("After completing the mask trading sub-quest, press A and any direction on the mask slot to change masks");
EnhancementCheckbox("Remember Save Location", "gRememberSaveLocation");
Tooltip("When loading a save, places Link at the last entrance he went through.\n"
"This doesn't work if the save was made in a grotto.");
ImGui::EndMenu(); ImGui::EndMenu();
} }

View File

@ -442,62 +442,65 @@ void Sram_OpenSave() {
Save_LoadFile(); Save_LoadFile();
switch (gSaveContext.savedSceneNum) { if (!CVar_GetS32("gRememberSaveLocation", 0) || gSaveContext.savedSceneNum == SCENE_YOUSEI_IZUMI_TATE ||
case SCENE_YDAN: gSaveContext.savedSceneNum == SCENE_KAKUSIANA) {
case SCENE_DDAN: switch (gSaveContext.savedSceneNum) {
case SCENE_BDAN: case SCENE_YDAN:
case SCENE_BMORI1: case SCENE_DDAN:
case SCENE_HIDAN: case SCENE_BDAN:
case SCENE_MIZUSIN: case SCENE_BMORI1:
case SCENE_JYASINZOU: case SCENE_HIDAN:
case SCENE_HAKADAN: case SCENE_MIZUSIN:
case SCENE_HAKADANCH: case SCENE_JYASINZOU:
case SCENE_ICE_DOUKUTO: case SCENE_HAKADAN:
case SCENE_GANON: case SCENE_HAKADANCH:
case SCENE_MEN: case SCENE_ICE_DOUKUTO:
case SCENE_GERUDOWAY: case SCENE_GANON:
case SCENE_GANONTIKA: case SCENE_MEN:
gSaveContext.entranceIndex = dungeonEntrances[gSaveContext.savedSceneNum]; case SCENE_GERUDOWAY:
break; case SCENE_GANONTIKA:
case SCENE_YDAN_BOSS: gSaveContext.entranceIndex = dungeonEntrances[gSaveContext.savedSceneNum];
gSaveContext.entranceIndex = 0; break;
break; case SCENE_YDAN_BOSS:
case SCENE_DDAN_BOSS: gSaveContext.entranceIndex = 0;
gSaveContext.entranceIndex = 4; break;
break; case SCENE_DDAN_BOSS:
case SCENE_BDAN_BOSS: gSaveContext.entranceIndex = 4;
gSaveContext.entranceIndex = 0x28; break;
break; case SCENE_BDAN_BOSS:
case SCENE_MORIBOSSROOM: gSaveContext.entranceIndex = 0x28;
gSaveContext.entranceIndex = 0x169; break;
break; case SCENE_MORIBOSSROOM:
case SCENE_FIRE_BS: gSaveContext.entranceIndex = 0x169;
gSaveContext.entranceIndex = 0x165; break;
break; case SCENE_FIRE_BS:
case SCENE_MIZUSIN_BS: gSaveContext.entranceIndex = 0x165;
gSaveContext.entranceIndex = 0x10; break;
break; case SCENE_MIZUSIN_BS:
case SCENE_JYASINBOSS: gSaveContext.entranceIndex = 0x10;
gSaveContext.entranceIndex = 0x82; break;
break; case SCENE_JYASINBOSS:
case SCENE_HAKADAN_BS: gSaveContext.entranceIndex = 0x82;
gSaveContext.entranceIndex = 0x37; break;
break; case SCENE_HAKADAN_BS:
case SCENE_GANON_SONOGO: gSaveContext.entranceIndex = 0x37;
case SCENE_GANONTIKA_SONOGO: break;
case SCENE_GANON_BOSS: case SCENE_GANON_SONOGO:
case SCENE_GANON_FINAL: case SCENE_GANONTIKA_SONOGO:
case SCENE_GANON_DEMO: case SCENE_GANON_BOSS:
gSaveContext.entranceIndex = 0x41B; case SCENE_GANON_FINAL:
break; case SCENE_GANON_DEMO:
gSaveContext.entranceIndex = 0x41B;
break;
default: default:
if (gSaveContext.savedSceneNum != SCENE_LINK_HOME) { if (gSaveContext.savedSceneNum != SCENE_LINK_HOME) {
gSaveContext.entranceIndex = (LINK_AGE_IN_YEARS == YEARS_CHILD) ? 0xBB : 0x5F4; gSaveContext.entranceIndex = (LINK_AGE_IN_YEARS == YEARS_CHILD) ? 0xBB : 0x5F4;
} else { } else {
gSaveContext.entranceIndex = 0xBB; gSaveContext.entranceIndex = 0xBB;
} }
break; break;
}
} }
osSyncPrintf("scene_no = %d\n", gSaveContext.entranceIndex); osSyncPrintf("scene_no = %d\n", gSaveContext.entranceIndex);