EditorNode: Add function to load file as scene or resource

This commit is contained in:
Lars Pettersson 2024-12-28 17:40:50 +01:00
parent c2ba0a8646
commit d2d02d0ea8
No known key found for this signature in database
GPG key ID: CC050E7B46DF7540
16 changed files with 57 additions and 142 deletions

View file

@ -349,11 +349,7 @@ void EditorAutoloadSettings::_autoload_activated() {
}
void EditorAutoloadSettings::_autoload_open(const String &fpath) {
if (ResourceLoader::get_resource_type(fpath) == "PackedScene") {
EditorNode::get_singleton()->open_request(fpath);
} else {
EditorNode::get_singleton()->load_resource(fpath);
}
EditorNode::get_singleton()->load_scene_or_resource(fpath);
ProjectSettingsEditor::get_singleton()->hide();
}