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

Method write_scene_groups_cache

utility/import_exporter.cpp:770–793  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

768}
769
770void ImportExporter::write_scene_groups_cache(const String &p_output_dir, const Vector<std::shared_ptr<FileInfo>> &file_infos) {
771 if (get_settings()->get_ver_major() < 4) {
772 return;
773 }
774 constexpr const char *scene_groups_cache_path = ".godot/scene_groups_cache.cfg";
775 String output_path = p_output_dir.path_join(scene_groups_cache_path);
776 Ref<ConfigFile> scene_groups_cache = memnew(ConfigFile);
777 if (FileAccess::exists(output_path)) {
778 Error err = scene_groups_cache->load(output_path);
779 if (err != OK) {
780 WARN_PRINT("Failed to load scene groups cache: " + output_path);
781 }
782 }
783 for (auto &file_info : file_infos) {
784 if (file_info->import_scene_groups.size() > 0) {
785 scene_groups_cache->set_value(file_info->file, "groups", gdre::hashset_to_array(file_info->import_scene_groups));
786 }
787 }
788 gdre::ensure_dir(output_path.get_base_dir());
789 Error err = scene_groups_cache->save(output_path);
790 if (err != OK) {
791 WARN_PRINT("Failed to save scene groups cache: " + output_path);
792 }
793}
794
795// TODO: rethink this, it's not really recovering any keys beyond the first time
796Error ImportExporter::_reexport_translations(Vector<ImportExporter::ExportToken> &non_multithreaded_tokens, size_t token_size, Ref<EditorProgressGDDC> pr) {

Callers

nothing calls this directly

Calls 7

get_settingsFunction · 0.85
hashset_to_arrayFunction · 0.85
get_ver_majorMethod · 0.45
loadMethod · 0.45
sizeMethod · 0.45
set_valueMethod · 0.45
saveMethod · 0.45

Tested by

no test coverage detected