summaryrefslogtreecommitdiffstats
path: root/platform/web/export
diff options
context:
space:
mode:
authorHakim <hakim.rouatbi@gmail.com>2024-05-16 22:16:30 +0200
committerHakim <hakim.rouatbi@gmail.com>2024-05-17 00:15:13 +0200
commit04aaa860391a8d874cbe17abf983f362be06f019 (patch)
tree28be956ef13b0c1ea805f4069ab40de7f2a76d3c /platform/web/export
parentf4b047a084a5ecff153d0d32453aeb2e9919c83c (diff)
downloadredot-engine-04aaa860391a8d874cbe17abf983f362be06f019.tar.gz
Disable remote debug button when there are no runnable presets
Diffstat (limited to 'platform/web/export')
-rw-r--r--platform/web/export/export_plugin.cpp7
-rw-r--r--platform/web/export/export_plugin.h1
2 files changed, 6 insertions, 2 deletions
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";