mfc_editor_scene_file_select.c 1.3 KB

123456789101112131415161718192021222324252627282930313233
  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. scene_manager_set_scene_state(instance->scene_manager, MfcEditorSceneSectorSelect, 0);
  13. scene_manager_next_scene(instance->scene_manager, MfcEditorSceneSectorSelect);
  14. } else if(prompt_response == MfcEditorPromptResponseNotMfClassic) {
  15. scene_manager_next_scene(instance->scene_manager, MfcEditorSceneInvalidFile);
  16. } else {
  17. // Exiting from file list stops the application
  18. view_dispatcher_stop(instance->view_dispatcher);
  19. }
  20. }
  21. bool mfc_editor_scene_file_select_on_event(void* context, SceneManagerEvent event) {
  22. UNUSED(context);
  23. UNUSED(event);
  24. return false;
  25. }
  26. void mfc_editor_scene_file_select_on_exit(void* context) {
  27. UNUSED(context);
  28. }