summaryrefslogtreecommitdiffstats
path: root/editor/editor_run_native.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2019-05-31 16:55:46 +0200
committerGitHub <noreply@github.com>2019-05-31 16:55:46 +0200
commita69436aa4ea39d9bea5ad5df7d91ee87c1ed8380 (patch)
treed146e7187f5375033f8c683d405f7eab6174153e /editor/editor_run_native.cpp
parent95f2567a8b3b22ec44a097d1f4cde4f8d3d1dde8 (diff)
parent9e18e94dc1cf70d3e4982828cf87317382abc326 (diff)
downloadredot-engine-a69436aa4ea39d9bea5ad5df7d91ee87c1ed8380.tar.gz
Merge pull request #27309 from KoBeWi/main_scene_on_android
Ensure main scene is set when running on device
Diffstat (limited to 'editor/editor_run_native.cpp')
-rw-r--r--editor/editor_run_native.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/editor/editor_run_native.cpp b/editor/editor_run_native.cpp
index b73cda6008..585ea0ec69 100644
--- a/editor/editor_run_native.cpp
+++ b/editor/editor_run_native.cpp
@@ -101,6 +101,12 @@ void EditorRunNative::_notification(int p_what) {
void EditorRunNative::_run_native(int p_idx, int p_platform) {
+ if (!EditorNode::get_singleton()->ensure_main_scene(true)) {
+ resume_idx = p_idx;
+ resume_platform = p_platform;
+ return;
+ }
+
Ref<EditorExportPlatform> eep = EditorExport::get_singleton()->get_export_platform(p_platform);
ERR_FAIL_COND(eep.is_null());
@@ -144,6 +150,10 @@ void EditorRunNative::_run_native(int p_idx, int p_platform) {
eep->run(preset, p_idx, flags);
}
+void EditorRunNative::resume_run_native() {
+ _run_native(resume_idx, resume_platform);
+}
+
void EditorRunNative::_bind_methods() {
ClassDB::bind_method("_run_native", &EditorRunNative::_run_native);
@@ -198,4 +208,6 @@ EditorRunNative::EditorRunNative() {
deploy_debug_remote = false;
debug_collisions = false;
debug_navigation = false;
+ resume_idx = 0;
+ resume_platform = 0;
}