mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Add EditorInterface::close_scene()
Co-authored-by: Tomasz Chabora <kobewi4e@gmail.com>
This commit is contained in:
parent
2cde9292c3
commit
8cdb1768a4
5 changed files with 27 additions and 0 deletions
|
|
@ -4974,6 +4974,19 @@ bool EditorNode::_find_scene_in_use(Node *p_node, const String &p_path) const {
|
|||
return false;
|
||||
}
|
||||
|
||||
bool EditorNode::close_scene() {
|
||||
int tab_index = editor_data.get_edited_scene();
|
||||
if (tab_index == 0 && get_edited_scene() == nullptr && editor_data.get_scene_path(tab_index).is_empty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
tab_closing_idx = tab_index;
|
||||
current_menu_option = SCENE_CLOSE;
|
||||
_discard_changes();
|
||||
changing_scene = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool EditorNode::is_scene_in_use(const String &p_path) {
|
||||
Node *es = get_edited_scene();
|
||||
if (es) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue