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

Method load_all_resource_strings

utility/gdre_settings.cpp:2611–2688  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2609}
2610
2611void GDRESettings::load_all_resource_strings() {
2612 if (!is_pack_loaded()) {
2613 return;
2614 }
2615 if (translation_key_hints.size() > 0) {
2616 print_line("Loading " + String::num_int64(translation_key_hints.size()) + " translation key hints");
2617 gdre::hashset_insert_iterable(current_project->resource_strings, translation_key_hints);
2618 }
2619 if (GDREConfig::get_singleton()->get_setting("Exporter/Translation/skip_loading_resource_strings")) {
2620 print_line("Skipping loading resource strings from all resources");
2621 return;
2622 }
2623 List<String> extensions;
2624 ResourceCompatLoader::get_base_extensions(&extensions, get_ver_major());
2625 Vector<String> wildcards;
2626 for (auto &ext : extensions) {
2627 wildcards.push_back("*." + ext);
2628 }
2629 wildcards.push_back("*.tres");
2630 wildcards.push_back("*.tscn");
2631 wildcards.push_back("*.po");
2632 wildcards.push_back("*.mo");
2633 wildcards.push_back("*.gd");
2634 wildcards.push_back("*.gdc");
2635 if (!error_encryption) {
2636 wildcards.push_back("*.gde");
2637 }
2638 wildcards.push_back("*.dat");
2639 wildcards.push_back("*.csv");
2640 wildcards.push_back("*.ini");
2641 wildcards.push_back("*.csvdb");
2642 wildcards.push_back("*.json");
2643 wildcards.push_back("*.txt");
2644 wildcards.push_back("*.yml");
2645 wildcards.push_back("*.yaml");
2646 wildcards.push_back("*.xml");
2647 wildcards.push_back("*.cfg");
2648 wildcards.push_back("*.esc");
2649
2650 Vector<String> r_files = get_file_list(wildcards);
2651 if (has_loaded_dotnet_assembly()) {
2652 // Exporting all the strings from the .NET assembly can take a while, so we push it to the front of the list
2653 r_files.insert(0, get_dotnet_assembly_path());
2654 }
2655 if (r_files.is_empty()) {
2656 WARN_PRINT("No files to load resource strings from!");
2657 return;
2658 }
2659 Vector<StringLoadToken> tokens;
2660 tokens.resize(r_files.size());
2661 String engine_ver = get_version_string();
2662 for (int i = 0; i < r_files.size(); i++) {
2663 tokens.write[i].path = r_files[i];
2664 tokens.write[i].engine_version = engine_ver;
2665 }
2666 print_line("Loading resource strings, this may take a while!!");
2667 Error err = TaskManager::get_singleton()->run_multithreaded_group_task(
2668 this,

Callers 1

runMethod · 0.80

Calls 8

hashset_insert_iterableFunction · 0.85
get_ver_majorFunction · 0.85
push_backMethod · 0.80
sizeMethod · 0.45
get_settingMethod · 0.45
insertMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected