Skip to content

Commit

Permalink
Update the visibility for the custom templates for all platforms
Browse files Browse the repository at this point in the history
Hide the custom template options behind the `Advanced Options` toggle
  • Loading branch information
m4gr3d committed Dec 17, 2024
1 parent 2b7ea62 commit c45f049
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 5 deletions.
2 changes: 1 addition & 1 deletion platform/android/export/export_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
11 changes: 10 additions & 1 deletion platform/ios/export/export_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
4 changes: 3 additions & 1 deletion platform/linuxbsd/export/export_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
16 changes: 15 additions & 1 deletion platform/macos/export/export_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
10 changes: 10 additions & 0 deletions platform/web/export/export_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,16 @@ void EditorExportPlatformWeb::get_export_options(List<ExportOption> *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";
}
Expand Down
1 change: 1 addition & 0 deletions platform/web/export/export_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ class EditorExportPlatformWeb : public EditorExportPlatform {
virtual void get_preset_features(const Ref<EditorExportPreset> &p_preset, List<String> *r_features) const override;

virtual void get_export_options(List<ExportOption> *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;
Expand Down
8 changes: 7 additions & 1 deletion platform/windows/export/export_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c45f049

Please sign in to comment.