You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Open translation CSV in the text editor instead of printing errors.
This commit is contained in:
@@ -1528,7 +1528,12 @@ Error EditorNode::load_resource(const String &p_resource, bool p_ignore_broken_d
|
||||
Error err;
|
||||
|
||||
Ref<Resource> res;
|
||||
if (ResourceLoader::exists(p_resource, "")) {
|
||||
if (force_textfile_extensions.has(p_resource.get_extension())) {
|
||||
res = ResourceCache::get_ref(p_resource);
|
||||
if (res.is_null() || !res->is_class("TextFile")) {
|
||||
res = ScriptEditor::get_singleton()->open_file(p_resource);
|
||||
}
|
||||
} else if (ResourceLoader::exists(p_resource, "")) {
|
||||
res = ResourceLoader::load(p_resource, "", ResourceFormatLoader::CACHE_MODE_REUSE, &err);
|
||||
} else if (textfile_extensions.has(p_resource.get_extension())) {
|
||||
res = ScriptEditor::get_singleton()->open_file(p_resource);
|
||||
@@ -7825,6 +7830,8 @@ EditorNode::EditorNode() {
|
||||
other_file_extensions.insert(E);
|
||||
}
|
||||
|
||||
force_textfile_extensions.insert("csv"); // CSV translation source, has `Translation` resource type, but not loadable as resource.
|
||||
|
||||
resource_preview = memnew(EditorResourcePreview);
|
||||
add_child(resource_preview);
|
||||
progress_dialog = memnew(ProgressDialog);
|
||||
|
||||
Reference in New Issue
Block a user