1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

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
16 changed files with 57 additions and 142 deletions

View File

@@ -548,7 +548,7 @@ void VersionControlEditorPlugin::_cell_button_pressed(Object *p_item, int p_colu
file_path = "res://" + file_path;
if (ResourceLoader::get_resource_type(file_path) == "PackedScene") {
EditorNode::get_singleton()->open_request(file_path);
EditorNode::get_singleton()->load_scene(file_path);
} else if (file_path.ends_with(".gd")) {
EditorNode::get_singleton()->load_resource(file_path);
ScriptEditor::get_singleton()->reload_scripts();