MCPcopy Create free account
hub / github.com/EasyRPG/Player / UpdateScanAndProgress

Method UpdateScanAndProgress

src/scene_import.cpp:93–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93void 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
130void Scene_Import::FinishScan() {
131 for (int i = 0; i < 15; i++) {

Callers

nothing calls this directly

Calls 11

SePlayMethod · 0.80
GetImportChildPathsMethod · 0.80
SearchImportPathsMethod · 0.80
SetProgressMethod · 0.80
emptyMethod · 0.45
MakePathMethod · 0.45
ExistsMethod · 0.45
CreateMethod · 0.45
sizeMethod · 0.45
endMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected