weebo_keys_missing.c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #include "../weebo_i.h"
  2. void weebo_scene_keys_missing_popup_callback(void* context) {
  3. Weebo* weebo = context;
  4. view_dispatcher_send_custom_event(weebo->view_dispatcher, WeeboCustomEventViewExit);
  5. }
  6. void weebo_scene_keys_missing_on_enter(void* context) {
  7. Weebo* weebo = context;
  8. Popup* popup = weebo->popup;
  9. popup_set_header(popup, "key_retail.bin missing", 58, 28, AlignCenter, AlignCenter);
  10. // popup_set_text(popup, "words", 64, 36, AlignCenter, AlignTop);
  11. popup_set_context(weebo->popup, weebo);
  12. popup_set_callback(popup, weebo_scene_keys_missing_popup_callback);
  13. popup_set_timeout(popup, 5 * 60 * 1000);
  14. popup_enable_timeout(weebo->popup);
  15. view_dispatcher_switch_to_view(weebo->view_dispatcher, WeeboViewPopup);
  16. }
  17. bool weebo_scene_keys_missing_on_event(void* context, SceneManagerEvent event) {
  18. Weebo* weebo = context;
  19. bool consumed = false;
  20. if(event.type == SceneManagerEventTypeCustom) {
  21. scene_manager_set_scene_state(weebo->scene_manager, WeeboSceneKeysMissing, event.event);
  22. if(event.event == WeeboCustomEventViewExit) {
  23. while(scene_manager_previous_scene(weebo->scene_manager))
  24. ;
  25. consumed = true;
  26. }
  27. }
  28. return consumed;
  29. }
  30. void weebo_scene_keys_missing_on_exit(void* context) {
  31. Weebo* weebo = context;
  32. popup_reset(weebo->popup);
  33. }