mfc_editor_scene_file_select.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #include "../mfc_editor_app_i.h"
  2. void mfc_editor_scene_file_select_on_enter(void* context) {
  3. MfcEditorApp* instance = context;
  4. // File select scene should repeat itself if the file load failed
  5. // or if the user quit the shadow file prompt, not the file selector
  6. MfcEditorPromptResponse prompt_response = MfcEditorPromptResponseFailure;
  7. while(prompt_response == MfcEditorPromptResponseFailure ||
  8. prompt_response == MfcEditorPromptResponseExitedShadow) {
  9. prompt_response = mfc_editor_prompt_load_file(instance);
  10. }
  11. if(prompt_response == MfcEditorPromptResponseSuccess) {
  12. if(nfc_device_get_protocol(instance->nfc_device) == NfcProtocolMfClassic) {
  13. scene_manager_set_scene_state(instance->scene_manager, MfcEditorSceneSectorSelect, 0);
  14. scene_manager_next_scene(instance->scene_manager, MfcEditorSceneSectorSelect);
  15. } else {
  16. scene_manager_next_scene(instance->scene_manager, MfcEditorSceneInvalidFile);
  17. }
  18. } else {
  19. scene_manager_search_and_switch_to_previous_scene(
  20. instance->scene_manager, MfcEditorSceneStart);
  21. }
  22. }
  23. bool mfc_editor_scene_file_select_on_event(void* context, SceneManagerEvent event) {
  24. UNUSED(context);
  25. UNUSED(event);
  26. return false;
  27. }
  28. void mfc_editor_scene_file_select_on_exit(void* context) {
  29. UNUSED(context);
  30. }