| 4104 | } |
| 4105 | |
| 4106 | void EditorNode::_remove_edited_scene(bool p_change_tab) { |
| 4107 | hide_unused_editors(SceneTreeDock::get_singleton()); |
| 4108 | SceneTreeDock::get_singleton()->clear_previous_node_selection(); |
| 4109 | |
| 4110 | int new_index = editor_data.get_edited_scene(); |
| 4111 | int old_index = new_index; |
| 4112 | |
| 4113 | if (new_index > 0) { |
| 4114 | new_index = new_index - 1; |
| 4115 | } else if (editor_data.get_edited_scene_count() > 1) { |
| 4116 | new_index = 1; |
| 4117 | } else { |
| 4118 | editor_data.add_edited_scene(-1); |
| 4119 | new_index = 1; |
| 4120 | } |
| 4121 | |
| 4122 | if (p_change_tab) { |
| 4123 | _set_current_scene(new_index); |
| 4124 | } |
| 4125 | editor_data.remove_scene(old_index); |
| 4126 | _update_title(); |
| 4127 | scene_tabs->update_scene_tabs(); |
| 4128 | } |
| 4129 | |
| 4130 | void EditorNode::_remove_scene(int index, bool p_change_tab) { |
| 4131 | /// Clear icon cache in case some scripts are no longer needed or class icons are outdated. |
nothing calls this directly
no test coverage detected