| 2244 | } |
| 2245 | |
| 2246 | void 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 | |
| 2262 | void 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); |
no test coverage detected