Fix referring to ResourceImporterScene static importers via instances
This commit is contained in:
parent
15a03ed98e
commit
52f1b86ebc
6 changed files with 37 additions and 52 deletions
|
|
@ -47,7 +47,7 @@
|
|||
#include "editor/editor_string_names.h"
|
||||
#include "editor/gui/editor_dir_dialog.h"
|
||||
#include "editor/gui/editor_scene_tabs.h"
|
||||
#include "editor/import/resource_importer_scene.h"
|
||||
#include "editor/import/scene_import_settings.h"
|
||||
#include "editor/import_dock.h"
|
||||
#include "editor/plugins/editor_resource_tooltip_plugins.h"
|
||||
#include "editor/scene_create_dialog.h"
|
||||
|
|
@ -1192,12 +1192,12 @@ void FileSystemDock::_select_file(const String &p_path, bool p_select_in_favorit
|
|||
|
||||
String resource_type = ResourceLoader::get_resource_type(fpath);
|
||||
|
||||
if (resource_type == "PackedScene") {
|
||||
if (resource_type == "PackedScene" || resource_type == "AnimationLibrary") {
|
||||
bool is_imported = false;
|
||||
|
||||
{
|
||||
List<String> importer_exts;
|
||||
ResourceImporterScene::get_scene_singleton()->get_recognized_extensions(&importer_exts);
|
||||
ResourceImporterScene::get_scene_importer_extensions(&importer_exts);
|
||||
String extension = fpath.get_extension();
|
||||
for (const String &E : importer_exts) {
|
||||
if (extension.nocasecmp_to(E) == 0) {
|
||||
|
|
@ -1208,27 +1208,7 @@ void FileSystemDock::_select_file(const String &p_path, bool p_select_in_favorit
|
|||
}
|
||||
|
||||
if (is_imported) {
|
||||
ResourceImporterScene::get_scene_singleton()->show_advanced_options(fpath);
|
||||
} else {
|
||||
EditorNode::get_singleton()->open_request(fpath);
|
||||
}
|
||||
} else if (resource_type == "AnimationLibrary") {
|
||||
bool is_imported = false;
|
||||
|
||||
{
|
||||
List<String> importer_exts;
|
||||
ResourceImporterScene::get_animation_singleton()->get_recognized_extensions(&importer_exts);
|
||||
String extension = fpath.get_extension();
|
||||
for (const String &E : importer_exts) {
|
||||
if (extension.nocasecmp_to(E) == 0) {
|
||||
is_imported = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (is_imported) {
|
||||
ResourceImporterScene::get_animation_singleton()->show_advanced_options(fpath);
|
||||
SceneImportSettingsDialog::get_singleton()->open_settings(p_path, resource_type == "AnimationLibrary");
|
||||
} else {
|
||||
EditorNode::get_singleton()->open_request(fpath);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue