diff options
author | SmallJoker <mk939@ymail.com> | 2017-10-13 23:05:52 +0200 |
---|---|---|
committer | SmallJoker <mk939@ymail.com> | 2017-10-13 23:14:39 +0200 |
commit | 6b23cabe512e5a8facd9ea9d27417e3ff81f38e2 (patch) | |
tree | 314294759aea962a8e9f9fb02c01463fb6901c33 /src | |
parent | 9a41a3d0f1b5f2bcd16b61122f6a34434fea7a7d (diff) | |
download | minetest-6b23cabe512e5a8facd9ea9d27417e3ff81f38e2.tar.gz minetest-6b23cabe512e5a8facd9ea9d27417e3ff81f38e2.tar.bz2 minetest-6b23cabe512e5a8facd9ea9d27417e3ff81f38e2.zip |
Formspec: Fallback to 'label' in readonly textarea[]
Guarantees backwards compatibility for this formspec element change
Diffstat (limited to 'src')
-rw-r--r-- | src/guiFormSpecMenu.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/guiFormSpecMenu.cpp b/src/guiFormSpecMenu.cpp index 2abb72578..0482f59a4 100644 --- a/src/guiFormSpecMenu.cpp +++ b/src/guiFormSpecMenu.cpp @@ -1119,18 +1119,21 @@ void GUIFormSpecMenu::parseTextArea(parserData* data, std::vector<std::string>& if (is_editable) spec.send = true; - - gui::IGUIEditBox *e; + + gui::IGUIEditBox *e = nullptr; + const wchar_t *text = spec.fdefault.empty() ? + wlabel.c_str() : spec.fdefault.c_str(); + #if USE_FREETYPE && IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR < 9 if (g_settings->getBool("freetype")) { - e = (gui::IGUIEditBox *) new gui::intlGUIEditBox(spec.fdefault.c_str(), + e = (gui::IGUIEditBox *) new gui::intlGUIEditBox(text, true, Environment, this, spec.fid, rect, is_editable, true); e->drop(); } else { #else { #endif - e = new GUIEditBoxWithScrollBar(spec.fdefault.c_str(), true, + e = new GUIEditBoxWithScrollBar(text, true, Environment, this, spec.fid, rect, is_editable, true); } |