MCPcopy Create free account
hub / github.com/GDRETools/gdsdecomp / _pck_select_request

Method _pck_select_request

editor/gdre_editor.cpp:728–798  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

726/*************************************************************************/
727
728void GodotREEditor::_pck_select_request(const Vector<String> &p_paths) {
729 pck_dialog->clear();
730 pck_files.clear();
731 pck_file = p_paths[0];
732 if (key_dialog->get_key().size() > 0) {
733 GDRESettings::get_singleton()->set_encryption_key(key_dialog->get_key());
734 }
735
736 Error err = GDRESettings::get_singleton()->load_project(p_paths);
737 if (err) {
738 if (err == ERR_PRINTER_ON_FIRE) {
739 show_warning(RTR("Error opening encrypted PCK file: ") + pck_file + "\nSet correct encryption key and try again.", RTR("Read PCK"));
740 } else {
741 show_warning(RTR("Error opening PCK file: ") + pck_file, RTR("Read PCK"));
742 }
743 return;
744 }
745 pck_file_selection->set_visible(false);
746
747 Ref<PckDumper> pckdump;
748 pckdump.instantiate();
749 Vector<String> broken_files;
750 int files_checked = 0;
751 int files_broken = 0;
752
753 err = pckdump->_check_md5_all_files(broken_files, files_checked);
754 // memdelete(pr);
755 // canceled
756 bool p_check_md5 = true;
757 pck_dialog->set_version(GDRESettings::get_singleton()->get_version_string());
758 pck_dialog->set_info(String(" ") + RTR("Total files: ") +
759 itos(GDRESettings::get_singleton()->get_file_count()) + "; " + RTR("Checked: ") +
760 itos(files_checked) + "; " + RTR("Broken: ") + itos(broken_files.size()));
761 print_line(RTR("Total files: ") + itos(GDRESettings::get_singleton()->get_file_count()) +
762 "; " + RTR("Checked: ") + itos(files_checked) + "; " + RTR("Broken: ") + itos(files_broken),
763 RTR("Read PCK"));
764 if (err == ERR_PRINTER_ON_FIRE || err == ERR_SKIP) {
765 //do things
766 p_check_md5 = false;
767 }
768 auto files = GDRESettings::get_singleton()->get_file_info_list();
769 pck_dialog->start_initial_load();
770 float scale = get_parent_scale();
771 for (int i = 0; i < files.size(); i++) {
772 const auto &file = files[i];
773 Ref<Texture2D> icon;
774 String error_string = "";
775 bool md5_error = !file->is_checksum_validated();
776 bool is_malformed = file->is_malformed();
777 if (p_check_md5 && md5_error) {
778 icon = GDREGuiIcons::get_icon("REFileBroken", scale);
779 error_string += "MD5 mismatch";
780 } else if (is_malformed) {
781 icon = GDREGuiIcons::get_icon("REFileBroken", scale);
782 error_string += String(error_string.length() > 0 ? ", " : "") + "Malformed_path";
783 } else if (!p_check_md5) {
784 icon = GDREGuiIcons::get_icon("REFile", scale);
785 } else {

Callers

nothing calls this directly

Calls 15

set_encryption_keyMethod · 0.80
load_projectMethod · 0.80
_check_md5_all_filesMethod · 0.80
set_versionMethod · 0.80
get_version_stringMethod · 0.80
set_infoMethod · 0.80
start_initial_loadMethod · 0.80
is_checksum_validatedMethod · 0.80
is_malformedMethod · 0.80
lengthMethod · 0.80
add_fileMethod · 0.80
get_sizeMethod · 0.80

Tested by

no test coverage detected