summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--editor/editor_run_native.cpp18
-rw-r--r--platform/web/export/export_plugin.cpp7
-rw-r--r--platform/web/export/export_plugin.h1
3 files changed, 19 insertions, 7 deletions
diff --git a/editor/editor_run_native.cpp b/editor/editor_run_native.cpp
index 4eb3f07c47..5c50231623 100644
--- a/editor/editor_run_native.cpp
+++ b/editor/editor_run_native.cpp
@@ -35,7 +35,6 @@
#include "editor/export/editor_export.h"
#include "editor/export/editor_export_platform.h"
#include "editor/themes/editor_scale.h"
-#include "scene/resources/image_texture.h"
void EditorRunNative::_notification(int p_what) {
switch (p_what) {
@@ -49,17 +48,26 @@ void EditorRunNative::_notification(int p_what) {
if (changed) {
PopupMenu *popup = remote_debug->get_popup();
popup->clear();
- for (int i = 0; i < EditorExport::get_singleton()->get_export_platform_count(); i++) {
- Ref<EditorExportPlatform> eep = EditorExport::get_singleton()->get_export_platform(i);
+ for (int i = 0; i < EditorExport::get_singleton()->get_export_preset_count(); i++) {
+ Ref<EditorExportPreset> preset = EditorExport::get_singleton()->get_export_preset(i);
+ Ref<EditorExportPlatform> eep = preset->get_platform();
if (eep.is_null()) {
continue;
}
+ int platform_idx = -1;
+ for (int j = 0; j < EditorExport::get_singleton()->get_export_platform_count(); j++) {
+ if (eep->get_name() == EditorExport::get_singleton()->get_export_platform(j)->get_name()) {
+ platform_idx = j;
+ }
+ }
int dc = MIN(eep->get_options_count(), 9000);
- if (dc > 0) {
+ bool needs_templates;
+ String error;
+ if (dc > 0 && preset->is_runnable() && eep->can_export(preset, error, needs_templates)) {
popup->add_icon_item(eep->get_run_icon(), eep->get_name(), -1);
popup->set_item_disabled(-1, true);
for (int j = 0; j < dc; j++) {
- popup->add_icon_item(eep->get_option_icon(j), eep->get_option_label(j), 10000 * i + j);
+ popup->add_icon_item(eep->get_option_icon(j), eep->get_option_label(j), 10000 * platform_idx + j);
popup->set_item_tooltip(-1, eep->get_option_tooltip(j));
popup->set_item_indent(-1, 2);
}
diff --git a/platform/web/export/export_plugin.cpp b/platform/web/export/export_plugin.cpp
index 0bf3927e14..06dfe7d646 100644
--- a/platform/web/export/export_plugin.cpp
+++ b/platform/web/export/export_plugin.cpp
@@ -585,17 +585,20 @@ bool EditorExportPlatformWeb::poll_export() {
}
}
+ int prev = menu_options;
+ menu_options = preset.is_valid();
HTTPServerState prev_server_state = server_state;
server_state = HTTP_SERVER_STATE_OFF;
if (server->is_listening()) {
- if (preset.is_null()) {
+ if (preset.is_null() || menu_options == 0) {
server->stop();
} else {
server_state = HTTP_SERVER_STATE_ON;
+ menu_options += 1;
}
}
- return server_state != prev_server_state;
+ return server_state != prev_server_state || menu_options != prev;
}
Ref<ImageTexture> EditorExportPlatformWeb::get_option_icon(int p_index) const {
diff --git a/platform/web/export/export_plugin.h b/platform/web/export/export_plugin.h
index 9d3a1a7861..d3d2083a23 100644
--- a/platform/web/export/export_plugin.h
+++ b/platform/web/export/export_plugin.h
@@ -58,6 +58,7 @@ class EditorExportPlatformWeb : public EditorExportPlatform {
HTTPServerState server_state = HTTP_SERVER_STATE_OFF;
Ref<EditorHTTPServer> server;
+ int menu_options = 0;
String _get_template_name(bool p_extension, bool p_thread_support, bool p_debug) const {
String name = "web";