From 3dd4cf3fed549820bdfcf04647fd21636de1b33b Mon Sep 17 00:00:00 2001 From: volzhs Date: Fri, 24 Jun 2016 21:20:43 +0900 Subject: [PATCH] Fix autosave when run on remote device Fix #5367 --- tools/editor/editor_node.cpp | 15 ++++++++++----- tools/editor/editor_run_native.cpp | 4 +--- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 0f8ddafb20..a8118c2bae 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -2639,11 +2639,16 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { } break; case RUN_PLAY_NATIVE: { - _menu_option_confirm(RUN_STOP,true); - emit_signal("play_pressed"); - editor_run.run_native_notify(); - - + + bool autosave = EDITOR_DEF("run/auto_save_before_running",true); + if (autosave) { + _menu_option_confirm(FILE_SAVE_SCENE, false); + } + if (run_native->is_deploy_debug_remote_enabled()){ + _menu_option_confirm(RUN_STOP,true); + emit_signal("play_pressed"); + editor_run.run_native_notify(); + } } break; case RUN_SCENE_SETTINGS: { diff --git a/tools/editor/editor_run_native.cpp b/tools/editor/editor_run_native.cpp index 234dd03087..edbcc71284 100644 --- a/tools/editor/editor_run_native.cpp +++ b/tools/editor/editor_run_native.cpp @@ -101,10 +101,8 @@ void EditorRunNative::_run_native(int p_idx,const String& p_platform) { Ref eep = EditorImportExport::get_singleton()->get_export_platform(p_platform); ERR_FAIL_COND(eep.is_null()); - if (deploy_debug_remote) { - emit_signal("native_run"); + emit_signal("native_run"); - } int flags=0; if (deploy_debug_remote) flags|=EditorExportPlatform::EXPORT_REMOTE_DEBUG;