You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-17 14:11:06 +00:00
Add EditorInterface::close_scene()
Co-authored-by: Tomasz Chabora <kobewi4e@gmail.com>
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user