Skip to content

Commit

Permalink
Make editor close empty scene when creating an inherited one
Browse files Browse the repository at this point in the history
  • Loading branch information
YeldhamDev committed May 6, 2019
1 parent 255ea11 commit 648cc7c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions editor/editor_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,7 @@ class EditorNode : public Node {
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;
Expand Down
1 change: 1 addition & 0 deletions editor/scene_tree_dock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 648cc7c

Please sign in to comment.