diff options
Diffstat (limited to 'platform/android')
| -rw-r--r-- | platform/android/display_server_android.cpp | 13 | ||||
| -rw-r--r-- | platform/android/display_server_android.h | 1 | ||||
| -rw-r--r-- | platform/android/export/export_plugin.cpp | 15 |
3 files changed, 27 insertions, 2 deletions
diff --git a/platform/android/display_server_android.cpp b/platform/android/display_server_android.cpp index 01ecbc7164..90759810b1 100644 --- a/platform/android/display_server_android.cpp +++ b/platform/android/display_server_android.cpp @@ -58,9 +58,13 @@ DisplayServerAndroid *DisplayServerAndroid::get_singleton() { bool DisplayServerAndroid::has_feature(Feature p_feature) const { switch (p_feature) { +#ifndef DISABLE_DEPRECATED + case FEATURE_GLOBAL_MENU: { + return (native_menu && native_menu->has_feature(NativeMenu::FEATURE_GLOBAL_MENU)); + } break; +#endif case FEATURE_CURSOR_SHAPE: //case FEATURE_CUSTOM_CURSOR_SHAPE: - //case FEATURE_GLOBAL_MENU: //case FEATURE_HIDPI: //case FEATURE_ICON: //case FEATURE_IME: @@ -578,6 +582,8 @@ DisplayServerAndroid::DisplayServerAndroid(const String &p_rendering_driver, Dis keep_screen_on = GLOBAL_GET("display/window/energy_saving/keep_screen_on"); + native_menu = memnew(NativeMenu); + #if defined(GLES3_ENABLED) if (rendering_driver == "opengl3") { RasterizerGLES3::make_current(false); @@ -641,6 +647,11 @@ DisplayServerAndroid::DisplayServerAndroid(const String &p_rendering_driver, Dis } DisplayServerAndroid::~DisplayServerAndroid() { + if (native_menu) { + memdelete(native_menu); + native_menu = nullptr; + } + #if defined(RD_ENABLED) if (rendering_device) { memdelete(rendering_device); diff --git a/platform/android/display_server_android.h b/platform/android/display_server_android.h index c95eaddf93..e1914f4d18 100644 --- a/platform/android/display_server_android.h +++ b/platform/android/display_server_android.h @@ -76,6 +76,7 @@ class DisplayServerAndroid : public DisplayServer { RenderingContextDriver *rendering_context = nullptr; RenderingDevice *rendering_device = nullptr; #endif + NativeMenu *native_menu = nullptr; ObjectID window_attached_instance_id; diff --git a/platform/android/export/export_plugin.cpp b/platform/android/export/export_plugin.cpp index db0352db01..74d22bc44f 100644 --- a/platform/android/export/export_plugin.cpp +++ b/platform/android/export/export_plugin.cpp @@ -2408,9 +2408,22 @@ bool EditorExportPlatformAndroid::has_valid_export_configuration(const Ref<Edito err += template_err; } } else { + // Validate the custom gradle android source template. + bool android_source_template_valid = false; + const String android_source_template = p_preset->get("gradle_build/android_source_template"); + if (!android_source_template.is_empty()) { + android_source_template_valid = FileAccess::exists(android_source_template); + if (!android_source_template_valid) { + err += TTR("Custom Android source template not found.") + "\n"; + } + } + + // Validate the installed build template. bool installed_android_build_template = FileAccess::exists(ExportTemplateManager::get_android_build_directory(p_preset).path_join("build.gradle")); if (!installed_android_build_template) { - r_missing_templates = !exists_export_template("android_source.zip", &err); + if (!android_source_template_valid) { + r_missing_templates = !exists_export_template("android_source.zip", &err); + } err += TTR("Android build template not installed in the project. Install it from the Project menu.") + "\n"; } else { r_missing_templates = false; |
