From c45f049641d48918124a47ba84305ac690ae8a26 Mon Sep 17 00:00:00 2001 From: Fredia Huya-Kouadio Date: Mon, 24 Jun 2024 06:45:31 -0700 Subject: [PATCH] Update the visibility for the custom templates for all platforms Hide the custom template options behind the `Advanced Options` toggle --- platform/android/export/export_plugin.cpp | 2 +- platform/ios/export/export_plugin.cpp | 11 ++++++++++- platform/linuxbsd/export/export_plugin.cpp | 4 +++- platform/macos/export/export_plugin.cpp | 16 +++++++++++++++- platform/web/export/export_plugin.cpp | 10 ++++++++++ platform/web/export/export_plugin.h | 1 + platform/windows/export/export_plugin.cpp | 8 +++++++- 7 files changed, 47 insertions(+), 5 deletions(-) diff --git a/platform/android/export/export_plugin.cpp b/platform/android/export/export_plugin.cpp index cc0f75802b5f..9d2bc917044e 100644 --- a/platform/android/export/export_plugin.cpp +++ b/platform/android/export/export_plugin.cpp @@ -1979,7 +1979,7 @@ bool EditorExportPlatformAndroid::get_export_option_visibility(const EditorExpor } if (p_option == "custom_template/debug" || p_option == "custom_template/release") { // The APK templates are ignored if Gradle build is enabled. - return !bool(p_preset->get("gradle_build/use_gradle_build")); + return advanced_options_enabled && !bool(p_preset->get("gradle_build/use_gradle_build")); } // Hide .NET embedding option (always enabled). diff --git a/platform/ios/export/export_plugin.cpp b/platform/ios/export/export_plugin.cpp index 667c883e386a..4d369088718a 100644 --- a/platform/ios/export/export_plugin.cpp +++ b/platform/ios/export/export_plugin.cpp @@ -254,7 +254,16 @@ bool EditorExportPlatformIOS::get_export_option_visibility(const EditorExportPre } bool advanced_options_enabled = p_preset->are_advanced_options_enabled(); - if (p_option.begins_with("privacy") || p_option == "application/generate_simulator_library_if_missing" || (p_option.begins_with("icons/") && !p_option.begins_with("icons/icon") && !p_option.begins_with("icons/app_store"))) { + if (p_option.begins_with("privacy") || + p_option == "application/generate_simulator_library_if_missing" || + (p_option.begins_with("icons/") && !p_option.begins_with("icons/icon") && !p_option.begins_with("icons/app_store")) || + p_option == "application/generate_simulator_library_if_missing" || + p_option == "custom_template/debug" || + p_option == "custom_template/release" || + p_option == "application/additional_plist_content" || + p_option == "application/delete_old_export_files_unconditionally" || + p_option == "application/icon_interpolation" || + p_option == "application/signature") { return advanced_options_enabled; } diff --git a/platform/linuxbsd/export/export_plugin.cpp b/platform/linuxbsd/export/export_plugin.cpp index 9362aee5e4cf..2803f7849e7a 100644 --- a/platform/linuxbsd/export/export_plugin.cpp +++ b/platform/linuxbsd/export/export_plugin.cpp @@ -171,7 +171,9 @@ bool EditorExportPlatformLinuxBSD::get_export_option_visibility(const EditorExpo if (!ssh && p_option != "ssh_remote_deploy/enabled" && p_option.begins_with("ssh_remote_deploy/")) { return false; } - if (p_option == "dotnet/embed_build_outputs") { + if (p_option == "dotnet/embed_build_outputs" || + p_option == "custom_template/debug" || + p_option == "custom_template/release") { return advanced_options_enabled; } return true; diff --git a/platform/macos/export/export_plugin.cpp b/platform/macos/export/export_plugin.cpp index d795adbe33b2..7c7ddd8ab54f 100644 --- a/platform/macos/export/export_plugin.cpp +++ b/platform/macos/export/export_plugin.cpp @@ -332,7 +332,21 @@ bool EditorExportPlatformMacOS::get_export_option_visibility(const EditorExportP } bool advanced_options_enabled = p_preset->are_advanced_options_enabled(); - if (p_option.begins_with("privacy") || p_option == "codesign/entitlements/additional") { + if (p_option.begins_with("privacy") || + p_option == "codesign/entitlements/additional" || + p_option == "custom_template/debug" || + p_option == "custom_template/release" || + p_option == "application/additional_plist_content" || + p_option == "application/export_angle" || + p_option == "application/icon_interpolation" || + p_option == "application/signature" || + p_option == "display/high_res" || + p_option == "xcode/platform_build" || + p_option == "xcode/sdk_build" || + p_option == "xcode/sdk_name" || + p_option == "xcode/sdk_version" || + p_option == "xcode/xcode_build" || + p_option == "xcode/xcode_version") { return advanced_options_enabled; } } diff --git a/platform/web/export/export_plugin.cpp b/platform/web/export/export_plugin.cpp index 9d212d81ffe9..142a8deb86d7 100644 --- a/platform/web/export/export_plugin.cpp +++ b/platform/web/export/export_plugin.cpp @@ -372,6 +372,16 @@ void EditorExportPlatformWeb::get_export_options(List *r_options) r_options->push_back(ExportOption(PropertyInfo(Variant::COLOR, "progressive_web_app/background_color", PROPERTY_HINT_COLOR_NO_ALPHA), Color())); } +bool EditorExportPlatformWeb::get_export_option_visibility(const EditorExportPreset *p_preset, const String &p_option) const { + bool advanced_options_enabled = p_preset->are_advanced_options_enabled(); + if (p_option == "custom_template/debug" || + p_option == "custom_template/release") { + return advanced_options_enabled; + } + + return true; +} + String EditorExportPlatformWeb::get_name() const { return "Web"; } diff --git a/platform/web/export/export_plugin.h b/platform/web/export/export_plugin.h index 3c743e2e74a2..bd449bb16ded 100644 --- a/platform/web/export/export_plugin.h +++ b/platform/web/export/export_plugin.h @@ -112,6 +112,7 @@ class EditorExportPlatformWeb : public EditorExportPlatform { virtual void get_preset_features(const Ref &p_preset, List *r_features) const override; virtual void get_export_options(List *r_options) const override; + virtual bool get_export_option_visibility(const EditorExportPreset *p_preset, const String &p_option) const override; virtual String get_name() const override; virtual String get_os_name() const override; diff --git a/platform/windows/export/export_plugin.cpp b/platform/windows/export/export_plugin.cpp index e4dbb4be8f81..162a2a1e2817 100644 --- a/platform/windows/export/export_plugin.cpp +++ b/platform/windows/export/export_plugin.cpp @@ -398,7 +398,13 @@ bool EditorExportPlatformWindows::get_export_option_visibility(const EditorExpor return false; } - if (p_option == "dotnet/embed_build_outputs") { + if (p_option == "dotnet/embed_build_outputs" || + p_option == "custom_template/debug" || + p_option == "custom_template/release" || + p_option == "application/d3d12_agility_sdk_multiarch" || + p_option == "application/export_angle" || + p_option == "application/export_d3d12" || + p_option == "application/icon_interpolation") { return advanced_options_enabled; } return true;