|
@@ -2329,6 +2329,9 @@ void EditorNode::_run_native(const Ref<EditorExportPreset> &p_preset) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+void EditorNode::_android_build_source_selected(const String &p_file) {
|
|
|
|
+ export_template_manager->install_android_template_from_file(p_file);
|
|
|
|
+}
|
|
void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
|
|
void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
|
|
if (!p_confirmed) { //this may be a hack..
|
|
if (!p_confirmed) { //this may be a hack..
|
|
current_option = (MenuOptions)p_option;
|
|
current_option = (MenuOptions)p_option;
|
|
@@ -2753,6 +2756,10 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
|
|
export_template_manager->popup_manager();
|
|
export_template_manager->popup_manager();
|
|
|
|
|
|
} break;
|
|
} break;
|
|
|
|
+ case SETTINGS_INSTALL_ANDROID_BUILD_TEMPLATE: {
|
|
|
|
+ custom_build_manage_templates->hide();
|
|
|
|
+ file_android_build_source->popup_centered_ratio();
|
|
|
|
+ } break;
|
|
case SETTINGS_MANAGE_FEATURE_PROFILES: {
|
|
case SETTINGS_MANAGE_FEATURE_PROFILES: {
|
|
feature_profile_manager->popup_centered_clamped(Size2(900, 800) * EDSCALE, 0.8);
|
|
feature_profile_manager->popup_centered_clamped(Size2(900, 800) * EDSCALE, 0.8);
|
|
} break;
|
|
} break;
|
|
@@ -6678,9 +6685,18 @@ EditorNode::EditorNode() {
|
|
custom_build_manage_templates = memnew(ConfirmationDialog);
|
|
custom_build_manage_templates = memnew(ConfirmationDialog);
|
|
custom_build_manage_templates->set_text(TTR("Android build template is missing, please install relevant templates."));
|
|
custom_build_manage_templates->set_text(TTR("Android build template is missing, please install relevant templates."));
|
|
custom_build_manage_templates->get_ok_button()->set_text(TTR("Manage Templates"));
|
|
custom_build_manage_templates->get_ok_button()->set_text(TTR("Manage Templates"));
|
|
|
|
+ custom_build_manage_templates->add_button(TTR("Install from file"))->connect("pressed", callable_mp(this, &EditorNode::_menu_option), varray(SETTINGS_INSTALL_ANDROID_BUILD_TEMPLATE));
|
|
custom_build_manage_templates->connect("confirmed", callable_mp(this, &EditorNode::_menu_option), varray(SETTINGS_MANAGE_EXPORT_TEMPLATES));
|
|
custom_build_manage_templates->connect("confirmed", callable_mp(this, &EditorNode::_menu_option), varray(SETTINGS_MANAGE_EXPORT_TEMPLATES));
|
|
gui_base->add_child(custom_build_manage_templates);
|
|
gui_base->add_child(custom_build_manage_templates);
|
|
|
|
|
|
|
|
+ file_android_build_source = memnew(EditorFileDialog);
|
|
|
|
+ file_android_build_source->set_title(TTR("Select android sources file"));
|
|
|
|
+ file_android_build_source->set_access(EditorFileDialog::ACCESS_FILESYSTEM);
|
|
|
|
+ file_android_build_source->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE);
|
|
|
|
+ file_android_build_source->add_filter("*.zip");
|
|
|
|
+ file_android_build_source->connect("file_selected", callable_mp(this, &EditorNode::_android_build_source_selected));
|
|
|
|
+ gui_base->add_child(file_android_build_source);
|
|
|
|
+
|
|
install_android_build_template = memnew(ConfirmationDialog);
|
|
install_android_build_template = memnew(ConfirmationDialog);
|
|
install_android_build_template->set_text(TTR("This will set up your project for custom Android builds by installing the source template to \"res://android/build\".\nYou can then apply modifications and build your own custom APK on export (adding modules, changing the AndroidManifest.xml, etc.).\nNote that in order to make custom builds instead of using pre-built APKs, the \"Use Custom Build\" option should be enabled in the Android export preset."));
|
|
install_android_build_template->set_text(TTR("This will set up your project for custom Android builds by installing the source template to \"res://android/build\".\nYou can then apply modifications and build your own custom APK on export (adding modules, changing the AndroidManifest.xml, etc.).\nNote that in order to make custom builds instead of using pre-built APKs, the \"Use Custom Build\" option should be enabled in the Android export preset."));
|
|
install_android_build_template->get_ok_button()->set_text(TTR("Install"));
|
|
install_android_build_template->get_ok_button()->set_text(TTR("Install"));
|