From e7022942a0c10e5f57bef3bdcacd3236aa21a85a Mon Sep 17 00:00:00 2001 From: squee72564 Date: Mon, 1 Jan 2024 14:16:16 -0800 Subject: [PATCH] moved MineSweeperGameScreen reset function call to on_exit of StartScreen The reset function for th game screen should be called when we want to reset the state of the game board --- scenes/game_screen_scene.c | 4 ++-- scenes/start_screen_scene.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/scenes/game_screen_scene.c b/scenes/game_screen_scene.c index faa798d..ec3dc6a 100644 --- a/scenes/game_screen_scene.c +++ b/scenes/game_screen_scene.c @@ -49,7 +49,7 @@ bool minesweeper_scene_game_screen_on_event(void* context, SceneManagerEvent eve void minesweeper_scene_game_screen_on_exit(void* context) { furi_assert(context); - MineSweeperApp* app = context; - mine_sweeper_game_screen_reset(app->game_screen); + + UNUSED(app); } diff --git a/scenes/start_screen_scene.c b/scenes/start_screen_scene.c index 21a36d8..f91ac66 100644 --- a/scenes/start_screen_scene.c +++ b/scenes/start_screen_scene.c @@ -1,5 +1,6 @@ #include "../minesweeper.h" #include "../views/start_screen.h" +#include "../views/minesweeper_game_screen.h" #include "minesweeper_icons.h" typedef enum { @@ -85,4 +86,5 @@ void minesweeper_scene_start_screen_on_exit(void* context) { MineSweeperApp* app = context; start_screen_reset(app->start_screen); + mine_sweeper_game_screen_reset(app->game_screen); }