Przeglądaj źródła

update game ending

switch views right before the game starts to ensure we escape the FlipWorldViewWidgetResult view
jblanked 1 rok temu
rodzic
commit
f337c95e47
1 zmienionych plików z 4 dodań i 14 usunięć
  1. 4 14
      callback/callback.c

+ 4 - 14
callback/callback.c

@@ -682,6 +682,8 @@ static bool start_game_thread(void *context)
     furi_thread_start(thread);
     furi_thread_start(thread);
     thread_id = furi_thread_get_id(thread);
     thread_id = furi_thread_get_id(thread);
     game_thread_running = true;
     game_thread_running = true;
+    view_dispatcher_switch_to_view(app->view_dispatcher, FlipWorldViewSubmenu);
+    view_dispatcher_send_custom_event(app->view_dispatcher, FlipWorldCustomEventPlay);
     return true;
     return true;
 }
 }
 static bool flip_world_fetch_world_list(DataLoaderModel *model)
 static bool flip_world_fetch_world_list(DataLoaderModel *model)
@@ -700,13 +702,7 @@ static char *flip_world_parse_world_list(DataLoaderModel *model)
         furi_thread_free(thread_id);
         furi_thread_free(thread_id);
     }
     }
     FlipWorldApp *app = (FlipWorldApp *)model->parser_context;
     FlipWorldApp *app = (FlipWorldApp *)model->parser_context;
-    if (!app)
-    {
-        FURI_LOG_E(TAG, "app is NULL");
-        easy_flipper_dialog("Error", "app is NULL. Press BACK to return.");
-        view_dispatcher_switch_to_view(app->view_dispatcher, FlipWorldViewSubmenu); // just go back to the main menu for now
-        return "app is NULL";
-    }
+
     if (!start_game_thread(app))
     if (!start_game_thread(app))
     {
     {
         FURI_LOG_E(TAG, "Failed to start game thread");
         FURI_LOG_E(TAG, "Failed to start game thread");
@@ -863,13 +859,7 @@ static bool flip_world_fetch_game(DataLoaderModel *model)
 static char *flip_world_parse_game(DataLoaderModel *model)
 static char *flip_world_parse_game(DataLoaderModel *model)
 {
 {
     FlipWorldApp *app = (FlipWorldApp *)model->parser_context;
     FlipWorldApp *app = (FlipWorldApp *)model->parser_context;
-    if (!app)
-    {
-        FURI_LOG_E(TAG, "app is NULL");
-        easy_flipper_dialog("Error", "app is NULL. Press BACK to return.");
-        view_dispatcher_switch_to_view(app->view_dispatcher, FlipWorldViewSubmenu); // just go back to the main menu for now
-        return "app is NULL";
-    }
+
     if (model->request_index == 0)
     if (model->request_index == 0)
     {
     {
         if (!fhttp.last_response)
         if (!fhttp.last_response)