From 00766329163eb28dc45fed0671dbe64f160792b6 Mon Sep 17 00:00:00 2001 From: "LT_Schmiddy (Alex Schmid)" Date: Sat, 23 Nov 2024 23:28:17 -0500 Subject: [PATCH] Reset functionality implemented --- patches/play_patches.c | 10 +++++++--- src/ui/ui_config.cpp | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/patches/play_patches.c b/patches/play_patches.c index b4dc28f..4827e21 100644 --- a/patches/play_patches.c +++ b/patches/play_patches.c @@ -40,9 +40,13 @@ void controls_play_update(PlayState* play) { gSaveContext.options.zTargetSetting = recomp_get_targeting_mode(); } -void do_reset_game(PlayState* this) { - STOP_GAMESTATE(&this->state); - SET_NEXT_GAMESTATE(&this->state, ConsoleLogo_Init, sizeof(ConsoleLogoState)); +void do_reset_game(PlayState* play) { + gSaveContext.gameMode = GAMEMODE_OWL_SAVE; + play->transitionTrigger = TRANS_TRIGGER_START; + play->transitionType = TRANS_TYPE_FADE_BLACK; + play->nextEntrance = ENTRANCE(CUTSCENE, 0); + gSaveContext.save.cutsceneIndex = 0; + gSaveContext.sceneLayer = 0; } // @recomp Patched to add hooks for various added functionality. diff --git a/src/ui/ui_config.cpp b/src/ui/ui_config.cpp index c3b5542..4f712c7 100644 --- a/src/ui/ui_config.cpp +++ b/src/ui/ui_config.cpp @@ -165,7 +165,6 @@ namespace zelda64 { bool should_game_reset; } - static recomp::InputDevice cur_device = recomp::InputDevice::Controller; int recomp::get_scanned_input_index() { @@ -292,12 +291,13 @@ void zelda64::open_reset_game_prompt() { "Cancel", []() { should_game_reset = true; + close_config_menu(); }, []() {}, recompui::ButtonVariant::Error, recompui::ButtonVariant::Tertiary, true, - "config__quit-game-button" + "config__reset_game-button" ); }