| 1125 | } |
| 1126 | |
| 1127 | void GodotREEditor::_export_resource_process(const String &p_output_path) { |
| 1128 | Ref<EditorProgressGDDC> pr = memnew(EditorProgressGDDC(ne_parent, "re_export_res", RTR("Exporting resources..."), res_files.size(), true)); |
| 1129 | |
| 1130 | String failed_files; |
| 1131 | for (int i = 0; i < res_files.size(); i++) { |
| 1132 | GDRESettings::get_singleton()->get_errors(); |
| 1133 | // print_warning("exporting " + res_files[i], RTR("Export resources")); |
| 1134 | bool cancel = pr->step(res_files[i], i, true); |
| 1135 | if (cancel) { |
| 1136 | break; |
| 1137 | } |
| 1138 | |
| 1139 | Error err = Exporter::export_file(p_output_path, res_files[i]); |
| 1140 | if (err != OK) { |
| 1141 | failed_files += res_files[i] + " failed:\n" + GDRESettings::get_singleton()->get_recent_error_string() + "\n"; |
| 1142 | } |
| 1143 | } |
| 1144 | |
| 1145 | pr.unref(); |
| 1146 | res_files = Vector<String>(); |
| 1147 | |
| 1148 | if (failed_files.length() > 0) { |
| 1149 | show_warning(failed_files, RTR("Export resources"), RTR("At least one error was detected!")); |
| 1150 | } else { |
| 1151 | show_warning(RTR("No errors detected."), RTR("Export resources"), RTR("The operation completed successfully!")); |
| 1152 | } |
| 1153 | } |
| 1154 | |
| 1155 | Error GodotREEditor::convert_file_to_text(const String &p_src_path, const String &p_dst_path) { |
| 1156 | return ResourceCompatLoader::to_text(p_src_path, p_dst_path); |
nothing calls this directly
no test coverage detected