aboutsummaryrefslogtreecommitdiff
path: root/build/android
Commit message (Expand)AuthorAge
* Add minimap featureRealBadAngel2015-06-27
* Android: use loop inside makefile to spare repetitionest312015-06-20
* Add utf-8 conversion utilities and re-add intlGUIEditBoxest312015-06-13
* Reposition irrlicht timestamp in makefileest312015-06-11
* Split ObjDef/ObjDefManager out to objdef.cppkwolekr2015-05-18
* Add mod securityShadowNinja2015-05-16
* Fix libgmp for Androidest312015-05-15
* Make early protocol auth mechanism generic, and add SRPest312015-05-11
* Add LibGMPest312015-05-11
* Tests: Add schematic unittestskwolekr2015-05-08
* Tests: Add NodeResolver unittestskwolekr2015-05-05
* Tests: Add ObjDef unittestskwolekr2015-05-03
* Fix MSVC compatibilitykwolekr2015-04-29
* Tests: Modularize unit testingkwolekr2015-04-26
* Move globals from main.cpp to more sane locationsCraig Robbins2015-04-01
* Clean scaling pre-filter for formspec/HUD.Aaron Suen2015-04-01
* Fix Android build-related bugsCraig Robbins2015-03-29
* Clean up and tweak build systemShadowNinja2015-03-27
* Fix Android build on 32 bitest312015-03-23
* Remove Android makefile ugly make -j hackLoic Blot2015-03-17
* Bump android version codeLoic Blot2015-03-16
* Rename packethandler/{client,server}.cpp to {client,server}packethandler.cppLoic Blot2015-03-16
* Android Makefile update backported from stable-0.4 with minor changesLoic Blot2015-03-15
* Android: Backport changes from stable-0.4Loic Blot2015-03-14
* Android: fix package name in JAVA sourcesLoic Blot2015-03-14
* Fix package name in AndroidManifest.xmlLoic Blot2015-03-14
* AndroidManifest.xml version bumpLoic Blot2015-03-14
* Update Android MakefileMaksim Gamarnik2015-03-08
* Replace std::list to std::vector into tile.cpp (m_texture_trash) and move til...Loic Blot2015-03-05
* Fix android buildLoic Blot2015-02-21
* Bump version to 0.4.12Perttu Ahola2015-02-18
* Update missing files for Android.mkLoic Blot2015-02-18
* Android build fixLoic Blot2015-02-18
* main.cpp rework * Move ClientLauncher class to a dedicated file * ClientLaunc...Loic Blot2015-02-12
* Fix Android build since a704c04f00bfea4b77550169fa08105c2ee0dfd0Oxh. ok @zeno-Loic Blot2015-02-11
* Android, build: Update curl to 7.40.00sapier2015-01-15
* Fix Android crash on keyboard connection change.Kodexky2015-01-13
* Increase stepheight on android by 0.5 to smoothen movementsapier2015-01-11
* Fix armv7 using arm arch while arm uses armv7sapier2015-01-08
* Switch android build to external sqlite3sapier2015-01-07
* Fixes for androidsapier2015-01-06
* Fix broken android version due to new openssl not linking correct to curlsapier2015-01-05
* Switch to official openssl version and update to 1.0.1jsapier2015-01-04
* Speedup initial android startup on some devices by factor 10 or moresapier2015-01-02
* Bump version to 0.4.11kwolekr2014-12-24
* Add fontengine.cpp to Android.mkKahrl2014-12-01
* Fixes for Android build errors. Enable sensor landscape rotation.KodexKy2014-11-25
* Implement WieldMeshSceneNode which improves wield mesh renderingKahrl2014-11-08
* Split up mapgen.cppkwolekr2014-11-01
* Split settings into seperate source and header filesShadowNinja2014-09-21
s="hl opt">(tsrc) { #ifdef __ANDROID__ m_touchscreen_visible = false; #endif } GUIConfirmRegistration::~GUIConfirmRegistration() { removeChildren(); } void GUIConfirmRegistration::removeChildren() { const core::list<gui::IGUIElement *> &children = getChildren(); core::list<gui::IGUIElement *> children_copy; for (gui::IGUIElement *i : children) children_copy.push_back(i); for (gui::IGUIElement *i : children_copy) i->remove(); } void GUIConfirmRegistration::regenerateGui(v2u32 screensize) { acceptInput(); removeChildren(); /* Calculate new sizes and positions */ #ifdef __ANDROID__ const float s = m_gui_scale * porting::getDisplayDensity() / 2; #else const float s = m_gui_scale; #endif DesiredRect = core::rect<s32>( screensize.X / 2 - 600 * s / 2, screensize.Y / 2 - 360 * s / 2, screensize.X / 2 + 600 * s / 2, screensize.Y / 2 + 360 * s / 2 ); recalculateAbsolutePosition(false); v2s32 size = DesiredRect.getSize(); v2s32 topleft_client(0, 0); const wchar_t *text; /* Add stuff */ s32 ypos = 30 * s; { core::rect<s32> rect2(0, 0, 540 * s, 180 * s); rect2 += topleft_client + v2s32(30 * s, ypos); static const std::string info_text_template = strgettext( "You are about to join this server with the name \"%s\" for the " "first time.\n" "If you proceed, a new account using your credentials will be " "created on this server.\n" "Please retype your password and click 'Register and Join' to " "confirm account creation, or click 'Cancel' to abort."); char info_text_buf[1024]; porting::mt_snprintf(info_text_buf, sizeof(info_text_buf), info_text_template.c_str(), m_playername.c_str()); wchar_t *info_text_buf_wide = utf8_to_wide_c(info_text_buf); gui::IGUIEditBox *e = new gui::intlGUIEditBox(info_text_buf_wide, true, Environment, this, ID_intotext, rect2, false, true); delete[] info_text_buf_wide; e->drop(); e->setMultiLine(true); e->setWordWrap(true); e->setTextAlignment(gui::EGUIA_UPPERLEFT, gui::EGUIA_CENTER); } ypos += 200 * s; { core::rect<s32> rect2(0, 0, 540 * s, 30 * s); rect2 += topleft_client + v2s32(30 * s, ypos); gui::IGUIEditBox *e = Environment->addEditBox(m_pass_confirm.c_str(), rect2, true, this, ID_confirmPassword); e->setPasswordBox(true); Environment->setFocus(e); } ypos += 50 * s; { core::rect<s32> rect2(0, 0, 230 * s, 35 * s); rect2 = rect2 + v2s32(size.X / 2 - 220 * s, ypos); text = wgettext("Register and Join"); GUIButton::addButton(Environment, rect2, m_tsrc, this, ID_confirm, text); delete[] text; } { core::rect<s32> rect2(0, 0, 120 * s, 35 * s); rect2 = rect2 + v2s32(size.X / 2 + 70 * s, ypos); text = wgettext("Cancel"); GUIButton::addButton(Environment, rect2, m_tsrc, this, ID_cancel, text); delete[] text; } { core::rect<s32> rect2(0, 0, 500 * s, 40 * s); rect2 += topleft_client + v2s32(30 * s, ypos + 40 * s); text = wgettext("Passwords do not match!"); IGUIElement *e = Environment->addStaticText( text, rect2, false, true, this, ID_message); e->setVisible(false); delete[] text; } } void GUIConfirmRegistration::drawMenu() { gui::IGUISkin *skin = Environment->getSkin(); if (!skin) return; video::IVideoDriver *driver = Environment->getVideoDriver(); video::SColor bgcolor(140, 0, 0, 0); driver->draw2DRectangle(bgcolor, AbsoluteRect, &AbsoluteClippingRect); gui::IGUIElement::draw(); #ifdef __ANDROID__ getAndroidUIInput(); #endif } void GUIConfirmRegistration::closeMenu(bool goNext) { if (goNext) { m_client->confirmRegistration(); } else { *m_aborted = true; infostream << "Connect aborted [Escape]" << std::endl; } quitMenu(); } void GUIConfirmRegistration::acceptInput() { gui::IGUIElement *e; e = getElementFromId(ID_confirmPassword); if (e) m_pass_confirm = e->getText(); } bool GUIConfirmRegistration::processInput() { std::wstring m_password_ws = narrow_to_wide(m_password); if (m_password_ws != m_pass_confirm) { gui::IGUIElement *e = getElementFromId(ID_message); if (e) e->setVisible(true); return false; } return true; } bool GUIConfirmRegistration::OnEvent(const SEvent &event) { if (event.EventType == EET_KEY_INPUT_EVENT) { // clang-format off if ((event.KeyInput.Key == KEY_ESCAPE || event.KeyInput.Key == KEY_CANCEL) && event.KeyInput.PressedDown) { closeMenu(false); return true; } // clang-format on if (event.KeyInput.Key == KEY_RETURN && event.KeyInput.PressedDown) { acceptInput(); if (processInput()) closeMenu(true); return true; } } if (event.EventType != EET_GUI_EVENT) return Parent ? Parent->OnEvent(event) : false; if (event.GUIEvent.EventType == gui::EGET_ELEMENT_FOCUS_LOST && isVisible()) { if (!canTakeFocus(event.GUIEvent.Element)) { infostream << "GUIConfirmRegistration: Not allowing focus change." << std::endl; // Returning true disables focus change return true; } } else if (event.GUIEvent.EventType == gui::EGET_BUTTON_CLICKED) { switch (event.GUIEvent.Caller->getID()) { case ID_confirm: acceptInput(); if (processInput()) closeMenu(true); return true; case ID_cancel: closeMenu(false); return true; } } else if (event.GUIEvent.EventType == gui::EGET_EDITBOX_ENTER) { switch (event.GUIEvent.Caller->getID()) { case ID_confirmPassword: acceptInput(); if (processInput()) closeMenu(true); return true; } } return false; } #ifdef __ANDROID__ bool GUIConfirmRegistration::getAndroidUIInput() { if (!hasAndroidUIInput() || m_jni_field_name != "password") return false; // still waiting if (porting::getInputDialogState() == -1) return true; m_jni_field_name.clear(); gui::IGUIElement *e = getElementFromId(ID_confirmPassword); if (!e || e->getType() != irr::gui::EGUIET_EDIT_BOX) return false; std::string text = porting::getInputDialogValue(); e->setText(utf8_to_wide(text).c_str()); return false; } #endif