Skip to content

Commit

Permalink
moved MineSweeperGameScreen reset function call to on_exit of StartSc…
Browse files Browse the repository at this point in the history
…reen

The reset function for th game screen should be called when we want to reset the state of the game board
  • Loading branch information
squee72564 committed Jan 1, 2024
1 parent f7274bc commit e702294
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scenes/game_screen_scene.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
2 changes: 2 additions & 0 deletions scenes/start_screen_scene.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "../minesweeper.h"
#include "../views/start_screen.h"
#include "../views/minesweeper_game_screen.h"
#include "minesweeper_icons.h"

typedef enum {
Expand Down Expand Up @@ -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);
}

0 comments on commit e702294

Please sign in to comment.