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

Method try_autosave

editor/editor_node.cpp:2246–2260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2244}
2245
2246void EditorNode::try_autosave() {
2247 if (!bool(EDITOR_GET("run/auto_save/save_before_running"))) {
2248 return;
2249 }
2250
2251 if (unsaved_cache) {
2252 Node *scene = editor_data.get_edited_scene_root();
2253
2254 if (scene && !scene->get_scene_file_path().is_empty()) { // Only autosave if there is a scene and if it has a path.
2255 _save_scene_with_preview(scene->get_scene_file_path());
2256 }
2257 }
2258 _menu_option(SCENE_SAVE_ALL_SCENES);
2259 editor_data.save_editor_external_data();
2260}
2261
2262void EditorNode::restart_editor(bool p_goto_project_manager) {
2263 _menu_option_confirm(p_goto_project_manager ? PROJECT_QUIT_TO_PROJECT_MANAGER : PROJECT_RELOAD_CURRENT_PROJECT, false);

Callers 2

_run_sceneMethod · 0.80
_run_nativeMethod · 0.80

Calls 4

get_scene_file_pathMethod · 0.80
get_edited_scene_rootMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected