weebo_scene_keys_missing.c 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. view_dispatcher_switch_to_view(weebo->view_dispatcher, WeeboViewPopup);
  14. }
  15. bool weebo_scene_keys_missing_on_event(void* context, SceneManagerEvent event) {
  16. Weebo* weebo = context;
  17. bool consumed = false;
  18. if(event.type == SceneManagerEventTypeCustom) {
  19. scene_manager_set_scene_state(weebo->scene_manager, WeeboSceneKeysMissing, event.event);
  20. if(event.event == WeeboCustomEventViewExit) {
  21. while(scene_manager_previous_scene(weebo->scene_manager))
  22. ;
  23. consumed = true;
  24. }
  25. }
  26. return consumed;
  27. }
  28. void weebo_scene_keys_missing_on_exit(void* context) {
  29. Weebo* weebo = context;
  30. popup_reset(weebo->popup);
  31. }