Skip to content

Commit 6fa3a44

Browse files
committed
[Web & Android] Hide more export options dynamically
1 parent 6501d40 commit 6fa3a44

File tree

4 files changed

+32
-1
lines changed

4 files changed

+32
-1
lines changed

platform/android/export/export_plugin.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2175,6 +2175,12 @@ bool EditorExportPlatformAndroid::get_export_option_visibility(const EditorExpor
21752175
return true;
21762176
}
21772177

2178+
if (p_option == "gradle_build/export_format" ||
2179+
p_option == "gradle_build/min_sdk" ||
2180+
p_option == "gradle_build/target_sdk") {
2181+
return p_preset->get("gradle_build/use_gradle_build").operator bool();
2182+
}
2183+
21782184
bool advanced_options_enabled = p_preset->are_advanced_options_enabled();
21792185
if (p_option == "graphics/opengl_debug" ||
21802186
p_option == "gradle_build/custom_theme_attributes" ||
@@ -2229,9 +2235,16 @@ bool EditorExportPlatformAndroid::should_update_export_options() {
22292235
if (android_plugins_changed.is_set()) {
22302236
// don't clear unless we're reporting true, to avoid race
22312237
android_plugins_changed.clear();
2238+
_should_update_export_options = false;
22322239
return true;
22332240
}
22342241
#endif // DISABLE_DEPRECATED
2242+
2243+
if (_should_update_export_options) {
2244+
_should_update_export_options = false;
2245+
return true;
2246+
}
2247+
22352248
return false;
22362249
}
22372250

platform/android/export/export_plugin.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ class EditorExportPlatformAndroid : public EditorExportPlatform {
8383
String version;
8484
};
8585

86+
bool _should_update_export_options = false;
87+
8688
#ifndef DISABLE_DEPRECATED
8789
mutable Vector<PluginConfigAndroid> android_plugins;
8890
mutable SafeFlag android_plugins_changed;
@@ -274,6 +276,12 @@ class EditorExportPlatformAndroid : public EditorExportPlatform {
274276

275277
virtual void resolve_platform_feature_priorities(const Ref<EditorExportPreset> &p_preset, HashSet<String> &p_features) override;
276278

279+
virtual void export_option_set(const String &p_edited_property) override {
280+
if (p_edited_property == "gradle_build/use_gradle_build") {
281+
_should_update_export_options = true;
282+
}
283+
}
284+
277285
EditorExportPlatformAndroid();
278286

279287
~EditorExportPlatformAndroid();

platform/web/export/export_plugin.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,16 @@ bool EditorExportPlatformWeb::get_export_option_visibility(const EditorExportPre
396396
if (p_option == "threads/godot_pool_size" || p_option == "threads/emscripten_pool_size") {
397397
return p_preset->get("variant/thread_support").operator bool();
398398
}
399+
if (p_option == "progressive_web_app/ensure_cross_origin_isolation_headers" ||
400+
p_option == "progressive_web_app/offline_page" ||
401+
p_option == "progressive_web_app/display" ||
402+
p_option == "progressive_web_app/orientation" ||
403+
p_option == "progressive_web_app/icon_144x144" ||
404+
p_option == "progressive_web_app/icon_180x180" ||
405+
p_option == "progressive_web_app/icon_512x512" ||
406+
p_option == "progressive_web_app/background_color") {
407+
return p_preset->get("progressive_web_app/enabled").operator bool();
408+
}
399409

400410
return true;
401411
}

platform/web/export/export_plugin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ class EditorExportPlatformWeb : public EditorExportPlatform {
158158
}
159159

160160
virtual void export_option_set(const String &p_edited_property) override {
161-
_should_update_export_options = p_edited_property == "variant/thread_support";
161+
_should_update_export_options = p_edited_property == "variant/thread_support" || "progressive_web_app/enabled";
162162
}
163163

164164
String get_debug_protocol() const override { return "ws://"; }

0 commit comments

Comments
 (0)