diff options
author | Michael Alexsander Silva Dias <michaelalexsander@protonmail.com> | 2019-05-05 23:53:05 -0300 |
---|---|---|
committer | Michael Alexsander Silva Dias <michaelalexsander@protonmail.com> | 2019-05-06 02:01:01 -0300 |
commit | 648cc7c0f54ac8b81e4409e7405fa5cd8bf7834e (patch) | |
tree | 67c1f62f25cb73d157e39b60c24c4665d54dee79 | |
parent | 255ea11502dd91a91d98e6d1bd054ceaf3aee619 (diff) |
Make editor close empty scene when creating an inherited one
Fixes #28654.
-rw-r--r-- | editor/editor_node.h | 1 | ||||
-rw-r--r-- | editor/scene_tree_dock.cpp | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/editor/editor_node.h b/editor/editor_node.h index 0084d421f9..c054dd7103 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -671,6 +671,7 @@ public: static void remove_editor_plugin(EditorPlugin *p_editor, bool p_config_changed = false); void new_inherited_scene() { _menu_option_confirm(FILE_NEW_INHERITED_SCENE, false); } + void close_current_scene() { _menu_option_confirm(FILE_CLOSE, false); } void set_docks_visible(bool p_show); bool get_docks_visible() const; diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index a41f10607b..ad4b99562c 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -334,6 +334,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { Node *scene = edited_scene; if (!scene) { + EditorNode::get_singleton()->close_current_scene(); EditorNode::get_singleton()->new_inherited_scene(); break; } |