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:
commit
0f8356d439
|
@ -671,6 +671,7 @@ public:
|
||||||
static void remove_editor_plugin(EditorPlugin *p_editor, bool p_config_changed = false);
|
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 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);
|
void set_docks_visible(bool p_show);
|
||||||
bool get_docks_visible() const;
|
bool get_docks_visible() const;
|
||||||
|
|
|
@ -334,6 +334,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
|
||||||
Node *scene = edited_scene;
|
Node *scene = edited_scene;
|
||||||
|
|
||||||
if (!scene) {
|
if (!scene) {
|
||||||
|
EditorNode::get_singleton()->close_current_scene();
|
||||||
EditorNode::get_singleton()->new_inherited_scene();
|
EditorNode::get_singleton()->new_inherited_scene();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue