mirror of
https://github.com/godotengine/godot.git
synced 2024-11-27 09:16:35 +08:00
Merge pull request #47298 from reduz/remove-keep-files-error
Remove FileSystem dock errors on unimported files
This commit is contained in:
commit
538daf6731
@ -944,6 +944,21 @@ void FileSystemDock::_select_file(const String &p_path, bool p_select_in_favorit
|
||||
fpath = fpath.substr(0, fpath.length() - 1);
|
||||
}
|
||||
} else if (fpath != "Favorites") {
|
||||
if (FileAccess::exists(fpath + ".import")) {
|
||||
Ref<ConfigFile> config;
|
||||
config.instance();
|
||||
Error err = config->load(fpath + ".import");
|
||||
if (err == OK) {
|
||||
if (config->has_section_key("remap", "importer")) {
|
||||
String importer = config->get_value("remap", "importer");
|
||||
if (importer == "keep") {
|
||||
EditorNode::get_singleton()->show_warning(TTR("Importing has been disabled for this file, so it can't be opened for editing."));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ResourceLoader::get_resource_type(fpath) == "PackedScene") {
|
||||
bool is_imported = false;
|
||||
|
||||
@ -2644,7 +2659,10 @@ void FileSystemDock::_update_import_dock() {
|
||||
break;
|
||||
}
|
||||
|
||||
String type = cf->get_value("remap", "type");
|
||||
String type;
|
||||
if (cf->has_section_key("remap", "type")) {
|
||||
type = cf->get_value("remap", "type");
|
||||
}
|
||||
if (import_type == "") {
|
||||
import_type = type;
|
||||
} else if (import_type != type) {
|
||||
|
Loading…
Reference in New Issue
Block a user