summaryrefslogtreecommitdiffstats
path: root/platform/web
diff options
context:
space:
mode:
Diffstat (limited to 'platform/web')
-rw-r--r--platform/web/export/export_plugin.cpp13
-rw-r--r--platform/web/export/export_plugin.h1
-rw-r--r--platform/web/os_web.cpp4
3 files changed, 11 insertions, 7 deletions
diff --git a/platform/web/export/export_plugin.cpp b/platform/web/export/export_plugin.cpp
index d42303ad25..06dfe7d646 100644
--- a/platform/web/export/export_plugin.cpp
+++ b/platform/web/export/export_plugin.cpp
@@ -154,11 +154,11 @@ void EditorExportPlatformWeb::_fix_html(Vector<uint8_t> &p_html, const Ref<Edito
String head_include;
if (p_preset->get("html/export_icon")) {
- head_include += "<link id='-gd-engine-icon' rel='icon' type='image/png' href='" + p_name + ".icon.png' />\n";
- head_include += "<link rel='apple-touch-icon' href='" + p_name + ".apple-touch-icon.png'/>\n";
+ head_include += "<link id=\"-gd-engine-icon\" rel=\"icon\" type=\"image/png\" href=\"" + p_name + ".icon.png\" />\n";
+ head_include += "<link rel=\"apple-touch-icon\" href=\"" + p_name + ".apple-touch-icon.png\"/>\n";
}
if (p_preset->get("progressive_web_app/enabled")) {
- head_include += "<link rel='manifest' href='" + p_name + ".manifest.json'>\n";
+ head_include += "<link rel=\"manifest\" href=\"" + p_name + ".manifest.json\">\n";
config["serviceWorker"] = p_name + ".service.worker.js";
}
@@ -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";
diff --git a/platform/web/os_web.cpp b/platform/web/os_web.cpp
index 6b6c9ddd63..ef8f90421b 100644
--- a/platform/web/os_web.cpp
+++ b/platform/web/os_web.cpp
@@ -276,8 +276,8 @@ OS_Web::OS_Web() {
if (AudioDriverWeb::is_available()) {
audio_drivers.push_back(memnew(AudioDriverWorklet));
}
- for (int i = 0; i < audio_drivers.size(); i++) {
- AudioDriverManager::add_driver(audio_drivers[i]);
+ for (AudioDriverWeb *audio_driver : audio_drivers) {
+ AudioDriverManager::add_driver(audio_driver);
}
idb_available = godot_js_os_fs_is_persistent();