Merge pull request #102489 from KoBeWi/uid_file_factory_regulations
Improve UID file creation condition
This commit is contained in:
@@ -1196,6 +1196,20 @@ bool ResourceLoader::has_custom_uid_support(const String &p_path) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ResourceLoader::should_create_uid_file(const String &p_path) {
|
||||
const String local_path = _validate_local_path(p_path);
|
||||
if (FileAccess::exists(local_path + ".uid")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (int i = 0; i < loader_count; i++) {
|
||||
if (loader[i]->recognize_path(local_path)) {
|
||||
return !loader[i]->has_custom_uid_support();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
String ResourceLoader::_path_remap(const String &p_path, bool *r_translation_remapped) {
|
||||
String new_path = p_path;
|
||||
|
||||
|
||||
@@ -246,6 +246,7 @@ public:
|
||||
static String get_resource_script_class(const String &p_path);
|
||||
static ResourceUID::ID get_resource_uid(const String &p_path);
|
||||
static bool has_custom_uid_support(const String &p_path);
|
||||
static bool should_create_uid_file(const String &p_path);
|
||||
static void get_dependencies(const String &p_path, List<String> *p_dependencies, bool p_add_types = false);
|
||||
static Error rename_dependencies(const String &p_path, const HashMap<String, String> &p_map);
|
||||
static bool is_import_valid(const String &p_path);
|
||||
|
||||
Reference in New Issue
Block a user