diff options
Diffstat (limited to 'tools/editor/editor_node.cpp')
| -rw-r--r-- | tools/editor/editor_node.cpp | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 2d9b0d21a..dd5ae0007 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -1111,10 +1111,20 @@ void EditorNode::_dialog_action(String p_file) { } int ret = unzGoToFirstFile(pkg); + int fc=0; //coun them - EditorProgress p("ltask","Loading Export Templates",1); + while(ret==UNZ_OK) { + fc++; + ret = unzGoToNextFile(pkg); + + } + + ret = unzGoToFirstFile(pkg); + + EditorProgress p("ltask","Loading Export Templates",fc); print_line("BEGIN IMPORT"); + fc=0; while(ret==UNZ_OK) { @@ -1123,19 +1133,25 @@ void EditorNode::_dialog_action(String p_file) { char fname[16384]; ret = unzGetCurrentFileInfo(pkg,&info,fname,16384,NULL,0,NULL,0); + String file=fname; Vector<uint8_t> data; data.resize(info.uncompressed_size); //read - unzOpenCurrentFile(pkg); - unzReadCurrentFile(pkg,data.ptr(),data.size()); + ret = unzOpenCurrentFile(pkg); + ret = unzReadCurrentFile(pkg,data.ptr(),data.size()); unzCloseCurrentFile(pkg); + print_line(fname); + //for(int i=0;i<512;i++) { + // print_line(itos(data[i])); + //} + file=file.get_file(); - p.step("Importing: "+file,0); + p.step("Importing: "+file,fc); print_line("IMPORT "+file); FileAccess *f = FileAccess::open(EditorSettings::get_singleton()->get_settings_path()+"/templates/"+file,FileAccess::WRITE); @@ -1146,6 +1162,7 @@ void EditorNode::_dialog_action(String p_file) { memdelete(f); ret = unzGoToNextFile(pkg); + fc++; } unzClose(pkg); |
