aboutsummaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorMaksim <MoNTE48@mail.ua>2020-04-16 19:19:47 +0200
committerGitHub <noreply@github.com>2020-04-16 19:19:47 +0200
commit57038b3cb4b48d242af8e7dc9d598edf2e1018c4 (patch)
tree4e5e669f803eb88a747504ae0aca8f19fca8771f /src/gui
parent45999b74e610b13e8cda20c0c420e152b9837ea6 (diff)
downloadminetest-57038b3cb4b48d242af8e7dc9d598edf2e1018c4.tar.gz
minetest-57038b3cb4b48d242af8e7dc9d598edf2e1018c4.tar.bz2
minetest-57038b3cb4b48d242af8e7dc9d598edf2e1018c4.zip
Android: fix formspec input for AArch64 devices (#9685)
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/guiFormSpecMenu.cpp22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/gui/guiFormSpecMenu.cpp b/src/gui/guiFormSpecMenu.cpp
index aac039ad6..b0255cf1b 100644
--- a/src/gui/guiFormSpecMenu.cpp
+++ b/src/gui/guiFormSpecMenu.cpp
@@ -3346,28 +3346,24 @@ bool GUIFormSpecMenu::getAndroidUIInput()
if (!hasAndroidUIInput())
return false;
+ // still waiting
+ if (porting::getInputDialogState() == -1)
+ return true;
+
std::string fieldname = m_jni_field_name;
m_jni_field_name.clear();
- for (std::vector<FieldSpec>::iterator iter = m_fields.begin();
- iter != m_fields.end(); ++iter) {
-
- if (iter->fname != fieldname) {
+ for (const FieldSpec &field : m_fields) {
+ if (field.fname != fieldname)
continue;
- }
- IGUIElement *tochange = getElementFromId(iter->fid, true);
- if (tochange == 0) {
- return false;
- }
+ IGUIElement *element = getElementFromId(field.fid, true);
- if (tochange->getType() != irr::gui::EGUIET_EDIT_BOX) {
+ if (!element || element->getType() != irr::gui::EGUIET_EDIT_BOX)
return false;
- }
std::string text = porting::getInputDialogValue();
-
- ((gui::IGUIEditBox *)tochange)->setText(utf8_to_wide(text).c_str());
+ ((gui::IGUIEditBox *)element)->setText(utf8_to_wide(text).c_str());
}
return false;
}