From 71d8882a025f8bc9e94173ba9a09849a8e5f7d31 Mon Sep 17 00:00:00 2001 From: Michael Alexsander Date: Sat, 3 Jun 2023 19:28:50 -0300 Subject: [PATCH] Enhance icon fallback and their docs for exporters --- doc/classes/ProjectSettings.xml | 2 +- .../EditorExportPlatformAndroid.xml | 5 +- platform/android/export/export_plugin.cpp | 1 - .../doc_classes/EditorExportPlatformIOS.xml | 50 +++++++++---------- .../doc_classes/EditorExportPlatformMacOS.xml | 2 +- platform/macos/export/export_plugin.cpp | 2 + .../EditorExportPlatformWindows.xml | 4 +- platform/windows/export/export_plugin.cpp | 11 +++- 8 files changed, 45 insertions(+), 32 deletions(-) diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 360e35bfcfa..8aebf5f637e 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -268,7 +268,7 @@ The project's description, displayed as a tooltip in the Project Manager when hovering the project. - Icon used for the project, set when project loads. Exporters will also use this icon when possible. + Icon used for the project, set when project loads. Exporters will also use this icon as a fallback if necessary. Icon set in [code].icns[/code] format used on macOS to set the game's icon. This is done automatically on start by calling [method DisplayServer.set_native_icon]. diff --git a/platform/android/doc_classes/EditorExportPlatformAndroid.xml b/platform/android/doc_classes/EditorExportPlatformAndroid.xml index 0652ba5c0e2..9d68cb78f6f 100644 --- a/platform/android/doc_classes/EditorExportPlatformAndroid.xml +++ b/platform/android/doc_classes/EditorExportPlatformAndroid.xml @@ -59,14 +59,17 @@ Path of the debug keystore file. Can be overridden with the environment variable [code]GODOT_ANDROID_KEYSTORE_DEBUG_PATH[/code]. + Fallbacks to [code]EditorSettings.export/android/debug_keystore[/code] if empty. Password for the debug keystore file. Can be overridden with the environment variable [code]GODOT_ANDROID_KEYSTORE_DEBUG_PASSWORD[/code]. + Fallbacks to [code]EditorSettings.export/android/debug_keystore_pass[/code] if both it and [member keystore/debug] are empty. User name for the debug keystore file. Can be overridden with the environment variable [code]GODOT_ANDROID_KEYSTORE_DEBUG_USER[/code]. + Fallbacks to [code]EditorSettings.export/android/debug_keystore_user[/code] if both it and [member keystore/debug] are empty. Path of the release keystore file. @@ -87,7 +90,7 @@ Foreground layer of the application adaptive icon file. - Application icon file. If left empty, project icon is used instead. + Application icon file. If left empty, it will fallback to [member ProjectSettings.application/config/icon]. Application category for the Play Store. diff --git a/platform/android/export/export_plugin.cpp b/platform/android/export/export_plugin.cpp index d8dd453faff..71b8a2b09b5 100644 --- a/platform/android/export/export_plugin.cpp +++ b/platform/android/export/export_plugin.cpp @@ -2542,7 +2542,6 @@ Error EditorExportPlatformAndroid::sign_apk(const Ref &p_pre if (ep.step(vformat(TTR("Signing debug %s..."), export_label), 104)) { return ERR_SKIP; } - } else { keystore = release_keystore; password = release_password; diff --git a/platform/ios/doc_classes/EditorExportPlatformIOS.xml b/platform/ios/doc_classes/EditorExportPlatformIOS.xml index 381884067b7..b37868e543d 100644 --- a/platform/ios/doc_classes/EditorExportPlatformIOS.xml +++ b/platform/ios/doc_classes/EditorExportPlatformIOS.xml @@ -69,73 +69,73 @@ Path to the custom export template. If left empty, default template is used. - App Store application icon file. If left empty, project icon is used instead. See [url=https://developer.apple.com/design/human-interface-guidelines/foundations/app-icons]App icons[/url]. + App Store application icon file. If left empty, it will fallback to [member ProjectSettings.application/config/icon]. See [url=https://developer.apple.com/design/human-interface-guidelines/foundations/app-icons]App icons[/url]. - Home screen application icon file on iPad (1x DPI). If left empty, project icon is used instead. See [url=https://developer.apple.com/design/human-interface-guidelines/foundations/app-icons]App icons[/url]. + Home screen application icon file on iPad (1x DPI). If left empty, it will fallback to [member ProjectSettings.application/config/icon]. See [url=https://developer.apple.com/design/human-interface-guidelines/foundations/app-icons]App icons[/url]. - Home screen application icon file on iPad (2x DPI). If left empty, project icon is used instead. See [url=https://developer.apple.com/design/human-interface-guidelines/foundations/app-icons]App icons[/url]. + Home screen application icon file on iPad (2x DPI). If left empty, it will fallback to [member ProjectSettings.application/config/icon]. See [url=https://developer.apple.com/design/human-interface-guidelines/foundations/app-icons]App icons[/url]. - Home screen application icon file on iPad (3x DPI). If left empty, project icon is used instead. See [url=https://developer.apple.com/design/human-interface-guidelines/foundations/app-icons]App icons[/url]. + Home screen application icon file on iPad (3x DPI). If left empty, it will fallback to [member ProjectSettings.application/config/icon]. See [url=https://developer.apple.com/design/human-interface-guidelines/foundations/app-icons]App icons[/url]. - Home screen application icon file on iPhone (2x DPI). If left empty, project icon is used instead. See [url=https://developer.apple.com/design/human-interface-guidelines/foundations/app-icons]App icons[/url]. + Home screen application icon file on iPhone (2x DPI). If left empty, it will fallback to [member ProjectSettings.application/config/icon]. See [url=https://developer.apple.com/design/human-interface-guidelines/foundations/app-icons]App icons[/url]. - Home screen application icon file on iPhone (3x DPI). If left empty, project icon is used instead. See [url=https://developer.apple.com/design/human-interface-guidelines/foundations/app-icons]App icons[/url]. + Home screen application icon file on iPhone (3x DPI). If left empty, it will fallback to [member ProjectSettings.application/config/icon]. See [url=https://developer.apple.com/design/human-interface-guidelines/foundations/app-icons]App icons[/url]. - Notification icon file on iPad and iPhone (2x DPI). If left empty, project icon is used instead. See [url=https://developer.apple.com/design/human-interface-guidelines/foundations/app-icons]App icons[/url]. + Notification icon file on iPad and iPhone (2x DPI). If left empty, it will fallback to [member ProjectSettings.application/config/icon]. See [url=https://developer.apple.com/design/human-interface-guidelines/foundations/app-icons]App icons[/url]. - Notification icon file on iPhone (3x DPI). If left empty, project icon is used instead. See [url=https://developer.apple.com/design/human-interface-guidelines/foundations/app-icons]App icons[/url]. + Notification icon file on iPhone (3x DPI). If left empty, it will fallback to [member ProjectSettings.application/config/icon]. See [url=https://developer.apple.com/design/human-interface-guidelines/foundations/app-icons]App icons[/url]. - Application settings icon file on iPad and iPhone (2x DPI). If left empty, project icon is used instead. See [url=https://developer.apple.com/design/human-interface-guidelines/foundations/app-icons]App icons[/url]. + Application settings icon file on iPad and iPhone (2x DPI). If left empty, it will fallback to [member ProjectSettings.application/config/icon]. See [url=https://developer.apple.com/design/human-interface-guidelines/foundations/app-icons]App icons[/url]. - Application settings icon file on iPhone (3x DPI). If left empty, project icon is used instead. See [url=https://developer.apple.com/design/human-interface-guidelines/foundations/app-icons]App icons[/url]. + Application settings icon file on iPhone (3x DPI). If left empty, it will fallback to [member ProjectSettings.application/config/icon]. See [url=https://developer.apple.com/design/human-interface-guidelines/foundations/app-icons]App icons[/url]. - Spotlight icon file on iPad (1x DPI). If left empty, project icon is used instead. See [url=https://developer.apple.com/design/human-interface-guidelines/foundations/app-icons]App icons[/url]. + Spotlight icon file on iPad (1x DPI). If left empty, it will fallback to [member ProjectSettings.application/config/icon]. See [url=https://developer.apple.com/design/human-interface-guidelines/foundations/app-icons]App icons[/url]. - Spotlight icon file on iPad and iPhone (2x DPI). If left empty, project icon is used instead. See [url=https://developer.apple.com/design/human-interface-guidelines/foundations/app-icons]App icons[/url]. + Spotlight icon file on iPad and iPhone (2x DPI). If left empty, it will fallback to [member ProjectSettings.application/config/icon]. See [url=https://developer.apple.com/design/human-interface-guidelines/foundations/app-icons]App icons[/url]. - Application launch screen image file, if left empty project splash screen is used instead. + Application launch screen image file. If left empty, it will fallback to [member ProjectSettings.application/boot_splash/image]. - Application launch screen image file, if left empty project splash screen is used instead. + Application launch screen image file. If left empty, it will fallback to [member ProjectSettings.application/boot_splash/image]. - Application launch screen image file, if left empty project splash screen is used instead. + Application launch screen image file. If left empty, it will fallback to [member ProjectSettings.application/boot_splash/image]. - Application launch screen image file, if left empty project splash screen is used instead. + Application launch screen image file. If left empty, it will fallback to [member ProjectSettings.application/boot_splash/image]. - Application launch screen image file, if left empty project splash screen is used instead. + Application launch screen image file. If left empty, it will fallback to [member ProjectSettings.application/boot_splash/image]. - Application launch screen image file, if left empty project splash screen is used instead. + Application launch screen image file. If left empty, it will fallback to [member ProjectSettings.application/boot_splash/image]. - Application launch screen image file, if left empty project splash screen is used instead. + Application launch screen image file. If left empty, it will fallback to [member ProjectSettings.application/boot_splash/image]. - Application launch screen image file, if left empty project splash screen is used instead. + Application launch screen image file. If left empty, it will fallback to [member ProjectSettings.application/boot_splash/image]. - Application launch screen image file, if left empty project splash screen is used instead. + Application launch screen image file. If left empty, it will fallback to [member ProjectSettings.application/boot_splash/image]. - Application launch screen image file, if left empty project splash screen is used instead. + Application launch screen image file. If left empty, it will fallback to [member ProjectSettings.application/boot_splash/image]. - Application launch screen image file, if left empty project splash screen is used instead. + Application launch screen image file. If left empty, it will fallback to [member ProjectSettings.application/boot_splash/image]. A message displayed when requesting access to the device's camera (in English). @@ -159,10 +159,10 @@ A custom background color of the storyboard launch screen. - Application launch screen image file (2x DPI), if left empty project splash screen is used instead. + Application launch screen image file (2x DPI). If left empty, it will fallback to [member ProjectSettings.application/boot_splash/image]. - Application launch screen image file (3x DPI), if left empty project splash screen is used instead. + Application launch screen image file (3x DPI). If left empty, it will fallback to [member ProjectSettings.application/boot_splash/image]. Launch screen image scaling mode. diff --git a/platform/macos/doc_classes/EditorExportPlatformMacOS.xml b/platform/macos/doc_classes/EditorExportPlatformMacOS.xml index 64e1efde269..d030995ee74 100644 --- a/platform/macos/doc_classes/EditorExportPlatformMacOS.xml +++ b/platform/macos/doc_classes/EditorExportPlatformMacOS.xml @@ -23,7 +23,7 @@ Copyright notice for the bundle visible to the user (localized). - Application icon file. If left empty, project icon is used instead. + Application icon file. If left empty, it will fallback to [member ProjectSettings.application/config/macos_native_icon], and then to [member ProjectSettings.application/config/icon]. Interpolation method used to resize application icon. diff --git a/platform/macos/export/export_plugin.cpp b/platform/macos/export/export_plugin.cpp index bef204cd49c..f0fa5f2d366 100644 --- a/platform/macos/export/export_plugin.cpp +++ b/platform/macos/export/export_plugin.cpp @@ -1677,6 +1677,8 @@ Error EditorExportPlatformMacOS::export_project(const Ref &p String icon_path; if (p_preset->get("application/icon") != "") { icon_path = p_preset->get("application/icon"); + } else if (GLOBAL_GET("application/config/macos_native_icon") != "") { + icon_path = GLOBAL_GET("application/config/macos_native_icon"); } else { icon_path = GLOBAL_GET("application/config/icon"); } diff --git a/platform/windows/doc_classes/EditorExportPlatformWindows.xml b/platform/windows/doc_classes/EditorExportPlatformWindows.xml index ec2b105f580..4bdeed19ad6 100644 --- a/platform/windows/doc_classes/EditorExportPlatformWindows.xml +++ b/platform/windows/doc_classes/EditorExportPlatformWindows.xml @@ -13,7 +13,7 @@ Company that produced the application. Required. See [url=https://learn.microsoft.com/en-us/windows/win32/menurc/stringfileinfo-block]StringFileInfo[/url]. - Console wrapper icon file. If left empty, application icon is used instead. + Console wrapper icon file. If left empty, it will fallback to [member application/icon], then to [member ProjectSettings.application/config/windows_native_icon], and lastly, [member ProjectSettings.application/config/icon]. Copyright notice for the bundle visible to the user. Optional. See [url=https://learn.microsoft.com/en-us/windows/win32/menurc/stringfileinfo-block]StringFileInfo[/url]. @@ -25,7 +25,7 @@ Version number of the file. Required. See [url=https://learn.microsoft.com/en-us/windows/win32/menurc/stringfileinfo-block]StringFileInfo[/url]. - Application icon file. If left empty, project icon is used instead. + Application icon file. If left empty, it will fallback to [member ProjectSettings.application/config/windows_native_icon], and then to [member ProjectSettings.application/config/icon]. Interpolation method used to resize application icon. diff --git a/platform/windows/export/export_plugin.cpp b/platform/windows/export/export_plugin.cpp index ca390236fb7..2ac41af3a2d 100644 --- a/platform/windows/export/export_plugin.cpp +++ b/platform/windows/export/export_plugin.cpp @@ -399,7 +399,16 @@ Error EditorExportPlatformWindows::_rcedit_add_data(const Refglobalize_path(p_preset->get("application/icon")); + String icon_path; + if (p_preset->get("application/icon") != "") { + icon_path = p_preset->get("application/icon"); + } else if (GLOBAL_GET("application/config/windows_native_icon") != "") { + icon_path = GLOBAL_GET("application/config/windows_native_icon"); + } else { + icon_path = GLOBAL_GET("application/config/icon"); + } + icon_path = ProjectSettings::get_singleton()->globalize_path(icon_path); + if (p_console_icon) { String console_icon_path = ProjectSettings::get_singleton()->globalize_path(p_preset->get("application/console_wrapper_icon")); if (!console_icon_path.is_empty() && FileAccess::exists(console_icon_path)) {