Merge pull request #28715 from YeldhamDev/inherent_scene_close_empty

Make editor close empty scene when creating an inherited one
This commit is contained in:
Rémi Verschelde 2019-05-06 11:08:01 +02:00 committed by GitHub
commit 0f8356d439
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -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;

View File

@ -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;
}