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

Method _reload_modified_scenes

editor/editor_node.cpp:1456–1483  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1454}
1455
1456void EditorNode::_reload_modified_scenes() {
1457 int current_idx = editor_data.get_edited_scene();
1458
1459 for (int i = 0; i < editor_data.get_edited_scene_count(); i++) {
1460 if (editor_data.get_scene_path(i) == "") {
1461 continue;
1462 }
1463
1464 uint64_t last_date = editor_data.get_scene_modified_time(i);
1465 uint64_t date = FileAccess::get_modified_time(editor_data.get_scene_path(i));
1466
1467 if (date > last_date) {
1468 String filename = editor_data.get_scene_path(i);
1469 editor_data.set_edited_scene(i);
1470 _remove_edited_scene(false);
1471
1472 Error err = load_scene(filename, false, false, false, true);
1473 if (err != OK) {
1474 ERR_PRINT(vformat("Failed to load scene: %s", filename));
1475 }
1476 editor_data.move_edited_scene_to_index(i);
1477 }
1478 }
1479
1480 _set_current_scene(current_idx);
1481 scene_tabs->update_scene_tabs();
1482 disk_changed->hide();
1483}
1484
1485void EditorNode::_reload_project_settings() {
1486 ProjectSettings::get_singleton()->setup(ProjectSettings::get_singleton()->get_resource_path(), String(), true, true);

Callers

nothing calls this directly

Calls 9

vformatFunction · 0.85
update_scene_tabsMethod · 0.80
get_edited_sceneMethod · 0.45
get_scene_pathMethod · 0.45
set_edited_sceneMethod · 0.45
hideMethod · 0.45

Tested by

no test coverage detected