game_screen_scene.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #include "../minesweeper.h"
  2. #include "../views/minesweeper_game_screen.h"
  3. #include <input/input.h>
  4. void minesweeper_scene_game_screen_on_enter(void* context) {
  5. furi_assert(context);
  6. MineSweeperApp* app = context;
  7. furi_assert(app->game_screen);
  8. mine_sweeper_game_screen_set_context(app->game_screen, app);
  9. view_dispatcher_switch_to_view(app->view_dispatcher, MineSweeperGameScreenView);
  10. }
  11. bool minesweeper_scene_game_screen_on_event(void* context, SceneManagerEvent event) {
  12. furi_assert(context);
  13. MineSweeperApp* app = context;
  14. bool consumed = false;
  15. // No custom scene events from mine sweeper view
  16. // Just check for back button to route to next screen
  17. if(event.type == SceneManagerEventTypeBack) {
  18. scene_manager_next_scene(app->scene_manager, MineSweeperSceneMenuScreen);
  19. consumed = true;
  20. }
  21. return consumed;
  22. }
  23. void minesweeper_scene_game_screen_on_exit(void* context) {
  24. furi_assert(context);
  25. MineSweeperApp* app = context;
  26. // Do not call reset function for mine sweeper module
  27. //unless you want to reset the state of the board
  28. UNUSED(app);
  29. }