MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / _next_unsaved_scene

Method _next_unsaved_scene

editor/editor_node.cpp:3719–3742  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3717}
3718
3719int EditorNode::_next_unsaved_scene(bool p_valid_filename, int p_start) {
3720 for (int i = p_start; i < editor_data.get_edited_scene_count(); i++) {
3721 if (!editor_data.get_edited_scene_root(i)) {
3722 continue;
3723 }
3724
3725 String scene_filename = editor_data.get_edited_scene_root(i)->get_scene_file_path();
3726 if (p_valid_filename && scene_filename.is_empty()) {
3727 continue;
3728 }
3729
3730 bool unsaved = EditorUndoRedoManager::get_singleton()->is_history_unsaved(editor_data.get_scene_history_id(i));
3731 if (unsaved) {
3732 return i;
3733 } else {
3734 for (int j = 0; j < editor_data.get_editor_plugin_count(); j++) {
3735 if (!editor_data.get_editor_plugin(j)->get_unsaved_status(scene_filename).is_empty()) {
3736 return i;
3737 }
3738 }
3739 }
3740 }
3741 return -1;
3742}
3743
3744void EditorNode::_exit_editor(int p_exit_code) {
3745 exiting = true;

Callers

nothing calls this directly

Calls 9

get_scene_file_pathMethod · 0.80
is_history_unsavedMethod · 0.80
get_scene_history_idMethod · 0.80
get_editor_pluginMethod · 0.80
get_edited_scene_rootMethod · 0.45
is_emptyMethod · 0.45
get_unsaved_statusMethod · 0.45

Tested by

no test coverage detected