Add Script Cmd for Forcing Save Game (#6090)

Co-authored-by: ghoulslash <pokevoyager0@gmail.com>
This commit is contained in:
ghoulslash 2025-01-24 14:42:16 -05:00 committed by GitHub
parent cd84e07341
commit 774e61e74a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 0 deletions

View File

@ -2471,6 +2471,11 @@
callnative Script_SetDifficulty, requests_effects=1
.byte \difficulty
.endm
.macro forcesave
callnative Script_ForceSaveGame
waitstate
.endm
@ Makes the trainer unable to see the player if executed.
@ This is a no-op if the player interacts with the trainer.

View File

@ -1497,3 +1497,11 @@ static bool8 StartMenuDexNavCallback(void)
CreateTask(Task_OpenDexNavFromStartMenu, 0);
return TRUE;
}
void Script_ForceSaveGame(struct ScriptContext *ctx)
{
SaveGame();
ShowSaveInfoWindow();
gMenuCallback = SaveCallback;
sSaveDialogCallback = SaveSavingMessageCallback;
}