| 91 | } |
| 92 | |
| 93 | void Scene_Import::UpdateScanAndProgress() { |
| 94 | // Every tick, we still check for user input specifically for canceling... |
| 95 | if (Input::IsTriggered(Input::CANCEL)) { |
| 96 | Main_Data::game_system->SePlay(Main_Data::game_system->GetSystemSE(Main_Data::game_system->SFX_Cancel)); |
| 97 | Scene::Pop(); |
| 98 | return; |
| 99 | } |
| 100 | |
| 101 | // Leads to better fading. |
| 102 | if (!first_frame_skipped) { |
| 103 | first_frame_skipped = true; |
| 104 | return; |
| 105 | } |
| 106 | |
| 107 | // Gather the list of children, if it does not exist. |
| 108 | if (children.empty()) { |
| 109 | std::string parentPath = FileFinder::Save().MakePath("../"); |
| 110 | if (FileFinder::Save().Exists("../")) { |
| 111 | parent_fs = FileFinder::Root().Create(parentPath); |
| 112 | if (parent_fs) { |
| 113 | children = Player::meta->GetImportChildPaths(parent_fs); |
| 114 | } |
| 115 | } |
| 116 | if (children.empty()) { |
| 117 | FinishScan(); |
| 118 | } |
| 119 | } else if (curr_child_id < children.size()) { |
| 120 | auto candidates = Player::meta->SearchImportPaths(parent_fs, children[curr_child_id]); |
| 121 | files.insert(files.end(), candidates.begin(), candidates.end()); |
| 122 | |
| 123 | progress_window->SetProgress((curr_child_id*100)/children.size(), children[curr_child_id]); |
| 124 | curr_child_id += 1; |
| 125 | } else { |
| 126 | FinishScan(); |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | void Scene_Import::FinishScan() { |
| 131 | for (int i = 0; i < 15; i++) { |
nothing calls this directly
no test coverage detected