Skip to content

Commit 5600be9

Browse files
authored
Merge pull request #63085 from m4gr3d/update_android_editor_menus_3x
[3.x] Disable menus and functionality that are not relevant on the Android Editor port
2 parents fd1af84 + 1f23bac commit 5600be9

File tree

7 files changed

+38
-6
lines changed

7 files changed

+38
-6
lines changed

editor/editor_export.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1693,21 +1693,24 @@ bool EditorExportPlatformPC::has_valid_project_configuration(const Ref<EditorExp
16931693
}
16941694

16951695
bool EditorExportPlatform::can_export(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const {
1696+
bool valid = true;
1697+
#ifndef ANDROID_ENABLED
16961698
String templates_error;
1697-
bool valid_export_configuration = has_valid_export_configuration(p_preset, templates_error, r_missing_templates);
1698-
1699-
String project_configuration_error;
1700-
bool valid_project_configuration = has_valid_project_configuration(p_preset, project_configuration_error);
1699+
valid = valid && has_valid_export_configuration(p_preset, templates_error, r_missing_templates);
17011700

17021701
if (!templates_error.empty()) {
17031702
r_error += templates_error;
17041703
}
1704+
#endif
1705+
1706+
String project_configuration_error;
1707+
valid = valid && has_valid_project_configuration(p_preset, project_configuration_error);
17051708

17061709
if (!project_configuration_error.empty()) {
17071710
r_error += project_configuration_error;
17081711
}
17091712

1710-
return valid_export_configuration && valid_project_configuration;
1713+
return valid;
17111714
}
17121715

17131716
List<String> EditorExportPlatformPC::get_binary_extensions(const Ref<EditorExportPreset> &p_preset) const {

editor/editor_node.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6429,8 +6429,10 @@ EditorNode::EditorNode() {
64296429

64306430
p->add_separator();
64316431
p->add_shortcut(ED_SHORTCUT("editor/export", TTR("Export...")), FILE_EXPORT_PROJECT);
6432+
#ifndef ANDROID_ENABLED
64326433
p->add_item(TTR("Install Android Build Template..."), FILE_INSTALL_ANDROID_SOURCE);
64336434
p->add_item(TTR("Open User Data Folder"), RUN_USER_DATA_FOLDER);
6435+
#endif
64346436

64356437
plugin_config_dialog = memnew(PluginConfigDialog);
64366438
plugin_config_dialog->connect("plugin_ready", this, "_on_plugin_ready");
@@ -6542,13 +6544,16 @@ EditorNode::EditorNode() {
65426544
p->add_shortcut(ED_SHORTCUT("editor/take_screenshot", TTR("Take Screenshot"), KEY_MASK_CTRL | KEY_F12), EDITOR_SCREENSHOT);
65436545
#endif
65446546
p->set_item_tooltip(p->get_item_count() - 1, TTR("Screenshots are stored in the Editor Data/Settings Folder."));
6547+
#ifndef ANDROID_ENABLED
65456548
#ifdef OSX_ENABLED
65466549
p->add_shortcut(ED_SHORTCUT("editor/fullscreen_mode", TTR("Toggle Fullscreen"), KEY_MASK_CMD | KEY_MASK_CTRL | KEY_F), SETTINGS_TOGGLE_FULLSCREEN);
65476550
#else
65486551
p->add_shortcut(ED_SHORTCUT("editor/fullscreen_mode", TTR("Toggle Fullscreen"), KEY_MASK_SHIFT | KEY_F11), SETTINGS_TOGGLE_FULLSCREEN);
6552+
#endif
65496553
#endif
65506554
p->add_separator();
65516555

6556+
#ifndef ANDROID_ENABLED
65526557
if (OS::get_singleton()->get_data_path() == OS::get_singleton()->get_config_path()) {
65536558
// Configuration and data folders are located in the same place (Windows/macOS)
65546559
p->add_item(TTR("Open Editor Data/Settings Folder"), SETTINGS_EDITOR_DATA_FOLDER);
@@ -6558,9 +6563,12 @@ EditorNode::EditorNode() {
65586563
p->add_item(TTR("Open Editor Settings Folder"), SETTINGS_EDITOR_CONFIG_FOLDER);
65596564
}
65606565
p->add_separator();
6566+
#endif
65616567

65626568
p->add_item(TTR("Manage Editor Features..."), SETTINGS_MANAGE_FEATURE_PROFILES);
6569+
#ifndef ANDROID_ENABLED
65636570
p->add_item(TTR("Manage Export Templates..."), SETTINGS_MANAGE_EXPORT_TEMPLATES);
6571+
#endif
65646572

65656573
// Help Menu
65666574
help_menu = memnew(MenuButton);

editor/project_export.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -893,8 +893,10 @@ void ProjectExportDialog::_export_project_to_path(const String &p_path) {
893893
}
894894

895895
void ProjectExportDialog::_export_all_dialog() {
896+
#ifndef ANDROID_ENABLED
896897
export_all_dialog->show();
897898
export_all_dialog->popup_centered_minsize(Size2(300, 80));
899+
#endif
898900
}
899901

900902
void ProjectExportDialog::_export_all_dialog_action(const String &p_str) {
@@ -1152,11 +1154,16 @@ ProjectExportDialog::ProjectExportDialog() {
11521154

11531155
get_cancel()->set_text(TTR("Close"));
11541156
get_ok()->set_text(TTR("Export PCK/Zip..."));
1157+
get_ok()->set_disabled(true);
1158+
#ifdef ANDROID_ENABLED
1159+
export_button = memnew(Button);
1160+
export_button->hide();
1161+
#else
11551162
export_button = add_button(TTR("Export Project..."), !OS::get_singleton()->get_swap_ok_cancel(), "export");
1163+
#endif
11561164
export_button->connect("pressed", this, "_export_project");
11571165
// Disable initially before we select a valid preset
11581166
export_button->set_disabled(true);
1159-
get_ok()->set_disabled(true);
11601167

11611168
export_all_dialog = memnew(ConfirmationDialog);
11621169
add_child(export_all_dialog);
@@ -1166,8 +1173,14 @@ ProjectExportDialog::ProjectExportDialog() {
11661173
export_all_dialog->add_button(TTR("Debug"), true, "debug");
11671174
export_all_dialog->add_button(TTR("Release"), true, "release");
11681175
export_all_dialog->connect("custom_action", this, "_export_all_dialog_action");
1176+
#ifdef ANDROID_ENABLED
1177+
export_all_dialog->hide();
11691178

1179+
export_all_button = memnew(Button);
1180+
export_all_button->hide();
1181+
#else
11701182
export_all_button = add_button(TTR("Export All..."), !OS::get_singleton()->get_swap_ok_cancel(), "export");
1183+
#endif
11711184
export_all_button->connect("pressed", this, "_export_all_dialog");
11721185
export_all_button->set_disabled(true);
11731186

platform/android/export/export.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include "export_plugin.h"
3434

3535
void register_android_exporter() {
36+
#ifndef ANDROID_ENABLED
3637
EDITOR_DEF("export/android/android_sdk_path", "");
3738
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "export/android/android_sdk_path", PROPERTY_HINT_GLOBAL_DIR));
3839
EDITOR_DEF("export/android/debug_keystore", "");
@@ -42,6 +43,7 @@ void register_android_exporter() {
4243
EDITOR_DEF("export/android/force_system_user", false);
4344

4445
EDITOR_DEF("export/android/shutdown_adb_on_exit", true);
46+
#endif
4547

4648
Ref<EditorExportPlatformAndroid> exporter = Ref<EditorExportPlatformAndroid>(memnew(EditorExportPlatformAndroid));
4749
EditorExport::get_singleton()->add_export_platform(exporter);

platform/javascript/export/export.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,6 +1020,7 @@ EditorExportPlatformJavaScript::~EditorExportPlatformJavaScript() {
10201020
}
10211021

10221022
void register_javascript_exporter() {
1023+
#ifndef ANDROID_ENABLED
10231024
EDITOR_DEF("export/web/http_host", "localhost");
10241025
EDITOR_DEF("export/web/http_port", 8060);
10251026
EDITOR_DEF("export/web/use_ssl", false);
@@ -1028,6 +1029,7 @@ void register_javascript_exporter() {
10281029
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::INT, "export/web/http_port", PROPERTY_HINT_RANGE, "1,65535,1"));
10291030
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "export/web/ssl_key", PROPERTY_HINT_GLOBAL_FILE, "*.key"));
10301031
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "export/web/ssl_certificate", PROPERTY_HINT_GLOBAL_FILE, "*.crt,*.pem"));
1032+
#endif
10311033

10321034
Ref<EditorExportPlatformJavaScript> platform;
10331035
platform.instance();

platform/osx/export/export.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1582,8 +1582,10 @@ EditorExportPlatformOSX::~EditorExportPlatformOSX() {
15821582
}
15831583

15841584
void register_osx_exporter() {
1585+
#ifndef ANDROID_ENABLED
15851586
EDITOR_DEF("export/macos/force_builtin_codesign", false);
15861587
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::BOOL, "export/macos/force_builtin_codesign", PROPERTY_HINT_NONE));
1588+
#endif
15871589

15881590
Ref<EditorExportPlatformOSX> platform;
15891591
platform.instance();

platform/windows/export/export.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,7 @@ Error EditorExportPlatformWindows::fixup_embedded_pck(const String &p_path, int6
524524
}
525525

526526
void register_windows_exporter() {
527+
#ifndef ANDROID_ENABLED
527528
EDITOR_DEF("export/windows/rcedit", "");
528529
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "export/windows/rcedit", PROPERTY_HINT_GLOBAL_FILE, "*.exe"));
529530
#ifdef WINDOWS_ENABLED
@@ -535,6 +536,7 @@ void register_windows_exporter() {
535536
// On non-Windows we need WINE to run rcedit
536537
EDITOR_DEF("export/windows/wine", "");
537538
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "export/windows/wine", PROPERTY_HINT_GLOBAL_FILE));
539+
#endif
538540
#endif
539541

540542
Ref<EditorExportPlatformWindows> platform;

0 commit comments

Comments
 (0)