|
|
|
@ -99,22 +99,20 @@ RECOMP_EXPORT void recomp_do_autosave(PlayState* play) {
|
|
|
|
|
gSaveContext.save.isOwlSave = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool loading_deletes_owl_save = true;
|
|
|
|
|
bool owl_saves_delete = true;
|
|
|
|
|
|
|
|
|
|
// @recomp_export void recomp_set_loading_deletes_owl_save(bool new_val): Set whether loading an owl save should also delete it.
|
|
|
|
|
RECOMP_EXPORT void recomp_set_loading_deletes_owl_save(bool new_val)
|
|
|
|
|
RECOMP_EXPORT void recomp_set_owl_saves_delete(bool new_val)
|
|
|
|
|
{
|
|
|
|
|
loading_deletes_owl_save = new_val;
|
|
|
|
|
owl_saves_delete = new_val;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// @recomp Do not clear the save if the save was an autosave, or if mods have disabled save deletion.
|
|
|
|
|
// @recomp Do not clear the save if the save was an autosave.
|
|
|
|
|
RECOMP_PATCH void func_80147314(SramContext* sramCtx, s32 fileNum) {
|
|
|
|
|
s32 save_type = gSaveContext.save.isOwlSave;
|
|
|
|
|
gSaveContext.save.isOwlSave = false;
|
|
|
|
|
|
|
|
|
|
// @recomp Prevent owl save/autosave deletion if autosaving is enabled, and...
|
|
|
|
|
// @recomp_use_export_var loading_deletes_owl_save: Prevent owl save deletion if mods disable it.
|
|
|
|
|
if (!recomp_autosave_enabled() && loading_deletes_owl_save) {
|
|
|
|
|
// @recomp Prevent owl save/autosave deletion if autosaving is enabled.
|
|
|
|
|
if (!recomp_autosave_enabled() && owl_saves_delete) {
|
|
|
|
|
gSaveContext.save.saveInfo.playerData.newf[0] = '\0';
|
|
|
|
|
gSaveContext.save.saveInfo.playerData.newf[1] = '\0';
|
|
|
|
|
gSaveContext.save.saveInfo.playerData.newf[2] = '\0';
|
|
|
|
@ -542,7 +540,6 @@ RECOMP_PATCH void Sram_OpenSave(FileSelectState* fileSelect, SramContext* sramCt
|
|
|
|
|
s32 pad1;
|
|
|
|
|
s32 fileNum;
|
|
|
|
|
|
|
|
|
|
// @recomp_event recomp_on_load_save(FileSelectState* fileSelect, SramContext* sramCtx): A save-file was just chosen.
|
|
|
|
|
recomp_on_load_save(fileSelect, sramCtx);
|
|
|
|
|
|
|
|
|
|
if (gSaveContext.flashSaveAvailable) {
|
|
|
|
@ -669,13 +666,11 @@ RECOMP_PATCH void Sram_OpenSave(FileSelectState* fileSelect, SramContext* sramCt
|
|
|
|
|
// @recomp Initialize the autosave state tracking.
|
|
|
|
|
autosave_init();
|
|
|
|
|
|
|
|
|
|
// @recomp_event recomp_after_load_save(FileSelectState* fileSelect, SramContext* sramCtx): The save has finished loading.
|
|
|
|
|
recomp_after_load_save(fileSelect, sramCtx);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool moon_crash_resets_save = true;
|
|
|
|
|
|
|
|
|
|
// @recomp_export void recomp_set_moon_crash_resets_save(bool new_val): Set whether a moon crash should revert the player's save data.
|
|
|
|
|
RECOMP_EXPORT void recomp_set_moon_crash_resets_save(bool new_val)
|
|
|
|
|
{
|
|
|
|
|
moon_crash_resets_save = new_val;
|
|
|
|
@ -691,7 +686,6 @@ RECOMP_PATCH void Sram_ResetSaveFromMoonCrash(SramContext* sramCtx) {
|
|
|
|
|
s32 i;
|
|
|
|
|
s32 cutsceneIndex = gSaveContext.save.cutsceneIndex;
|
|
|
|
|
|
|
|
|
|
// @recomp_event recomp_on_moon_crash(SramContext* sramCtx): A moon crash has just been triggered.
|
|
|
|
|
recomp_on_moon_crash(sramCtx);
|
|
|
|
|
|
|
|
|
|
if (moon_crash_resets_save)
|
|
|
|
@ -742,29 +736,26 @@ RECOMP_PATCH void Sram_ResetSaveFromMoonCrash(SramContext* sramCtx) {
|
|
|
|
|
// @recomp Use the slow autosave timer to give the player extra time to respond to the moon crashing to decide if they want to reload their autosave.
|
|
|
|
|
recomp_reset_autosave_timer_slow();
|
|
|
|
|
|
|
|
|
|
// @recomp_event recomp_after_moon_crash(SramContext* sramCtx): The effects of moon crash have been written.
|
|
|
|
|
recomp_after_moon_crash(sramCtx);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool owls_save_and_quit = true;
|
|
|
|
|
bool loading_deletes_owl_save = true;
|
|
|
|
|
|
|
|
|
|
// @recomp_export void recomp_set_owls_save_and_quit(bool new_val): Set if owls should use their code to save and quit. If false is passed, owl saves now do nothing.
|
|
|
|
|
RECOMP_EXPORT void recomp_set_owls_save_and_quit(bool new_val)
|
|
|
|
|
RECOMP_EXPORT void recomp_set_loading_deletes_owl_save(bool new_val)
|
|
|
|
|
{
|
|
|
|
|
owls_save_and_quit = new_val;
|
|
|
|
|
loading_deletes_owl_save = new_val;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
RECOMP_DECLARE_EVENT(recomp_on_owl_update(ObjWarpstone* this, PlayState* play));
|
|
|
|
|
RECOMP_DECLARE_EVENT(recomp_on_owl_save(ObjWarpstone* this, PlayState* play));
|
|
|
|
|
RECOMP_DECLARE_EVENT(recomp_after_owl_save(ObjWarpstone* this, PlayState* play));
|
|
|
|
|
|
|
|
|
|
// @recomp If autosave is enabled or owl save deletion is disabled, skip the part of the owl statue dialog that talks about the file being deleted on load, since it's not true.
|
|
|
|
|
// @recomp If autosave is enabled, skip the part of the owl statue dialog that talks about the file being deleted on load, since it's not true.
|
|
|
|
|
RECOMP_PATCH void ObjWarpstone_Update(Actor* thisx, PlayState* play) {
|
|
|
|
|
ObjWarpstone* this = (ObjWarpstone*)thisx;
|
|
|
|
|
s32 pad;
|
|
|
|
|
|
|
|
|
|
// @recomp_event recomp_on_owl_update(ObjWarpstone* this, PlayState* play): Allow mods to handle owl update frames.
|
|
|
|
|
recomp_on_owl_update(this, play);
|
|
|
|
|
|
|
|
|
|
if (this->isTalking) {
|
|
|
|
@ -772,23 +763,17 @@ RECOMP_PATCH void ObjWarpstone_Update(Actor* thisx, PlayState* play) {
|
|
|
|
|
this->isTalking = false;
|
|
|
|
|
} else if ((Message_GetState(&play->msgCtx) == TEXT_STATE_CHOICE) && Message_ShouldAdvance(play)) {
|
|
|
|
|
if (play->msgCtx.choiceIndex != 0) {
|
|
|
|
|
// @recomp_event recomp_on_owl_save(ObjWarpstone* this, PlayState* play): The player chose to save from an owl statue.
|
|
|
|
|
recomp_on_owl_save(this, play);
|
|
|
|
|
|
|
|
|
|
Audio_PlaySfx_MessageDecide();
|
|
|
|
|
|
|
|
|
|
// @recomp_use_export_var owls_save_and_quit: Only use normal owl save if quit flag is set.
|
|
|
|
|
if (owls_save_and_quit) {
|
|
|
|
|
// @recomp Only use normal owl save if flag is set.
|
|
|
|
|
if (loading_deletes_owl_save) {
|
|
|
|
|
play->msgCtx.msgMode = MSGMODE_OWL_SAVE_0;
|
|
|
|
|
} else {
|
|
|
|
|
Message_CloseTextbox(play);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
play->msgCtx.unk120D6 = 0;
|
|
|
|
|
play->msgCtx.unk120D4 = 0;
|
|
|
|
|
gSaveContext.save.owlWarpId = OBJ_WARPSTONE_GET_OWL_WARP_ID(&this->dyna.actor);
|
|
|
|
|
|
|
|
|
|
// @recomp_event recomp_after_owl_save(ObjWarpstone* this, PlayState* play): Owl save is finished.
|
|
|
|
|
recomp_after_owl_save(this, play);
|
|
|
|
|
} else {
|
|
|
|
|
Message_CloseTextbox(play);
|
|
|
|
@ -800,7 +785,7 @@ RECOMP_PATCH void ObjWarpstone_Update(Actor* thisx, PlayState* play) {
|
|
|
|
|
Actor_OfferTalkNearColChkInfoCylinder(&this->dyna.actor, play);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// @recomp_use_export_var loading_deletes_owl_save: Skip the text talking about the save being deleted on load, if autosave is enabled or if owl save deletion is disabled.
|
|
|
|
|
// @recomp Skip the text talking about the save being deleted on load, if autosave is enabled.
|
|
|
|
|
if (recomp_autosave_enabled() || !loading_deletes_owl_save) {
|
|
|
|
|
if (this->isTalking && play->msgCtx.currentTextId == 0xC01 && play->msgCtx.msgBufPos == 269) {
|
|
|
|
|
play->msgCtx.msgBufPos = 530;
|
|
|
|
|