1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Use utf-8 in formspecs

This commit is contained in:
Ilya Zhuravlev 2015-06-10 01:54:33 +02:00 committed by est31
parent 572990dcd3
commit b6387b4e0f
4 changed files with 101 additions and 85 deletions

View file

@ -152,7 +152,7 @@ class GUIFormSpecMenu : public GUIModalMenu
FieldSpec()
{
}
FieldSpec(const std::wstring &name, const std::wstring &label,
FieldSpec(const std::string &name, const std::wstring &label,
const std::wstring &fdeflt, int id) :
fname(name),
flabel(label),
@ -163,7 +163,7 @@ class GUIFormSpecMenu : public GUIModalMenu
ftype = f_Unknown;
is_exit = false;
}
std::wstring fname;
std::string fname;
std::wstring flabel;
std::wstring fdefault;
int fid;
@ -255,7 +255,7 @@ public:
void removeChildren();
void setInitialFocus();
void setFocus(std::wstring elementname)
void setFocus(std::string &elementname)
{
m_focused_element = elementname;
}
@ -278,7 +278,7 @@ public:
bool doPause;
bool pausesGame() { return doPause; }
GUITable* getTable(std::wstring tablename);
GUITable* getTable(const std::string &tablename);
#ifdef __ANDROID__
bool getAndroidUIInput();
@ -313,7 +313,7 @@ protected:
std::vector<FieldSpec> m_fields;
std::vector<std::pair<FieldSpec,GUITable*> > m_tables;
std::vector<std::pair<FieldSpec,gui::IGUICheckBox*> > m_checkboxes;
std::map<std::wstring, TooltipSpec> m_tooltips;
std::map<std::string, TooltipSpec> m_tooltips;
std::vector<std::pair<FieldSpec,gui::IGUIScrollBar*> > m_scrollbars;
ItemSpec *m_selected_item;
@ -355,7 +355,7 @@ private:
IFormSource *m_form_src;
TextDest *m_text_dst;
unsigned int m_formspec_version;
std::wstring m_focused_element;
std::string m_focused_element;
typedef struct {
bool explicit_size;
@ -364,11 +364,11 @@ private:
core::rect<s32> rect;
v2s32 basepos;
v2u32 screensize;
std::wstring focused_fieldname;
std::string focused_fieldname;
GUITable::TableOptions table_options;
GUITable::TableColumns table_columns;
// used to restore table selection/scroll/treeview state
std::map<std::wstring,GUITable::DynamicData> table_dyndata;
std::map<std::string, GUITable::DynamicData> table_dyndata;
} parserData;
typedef struct {
@ -430,10 +430,10 @@ private:
gui::IGUIFont *m_font;
std::wstring getLabelByID(s32 id);
std::wstring getNameByID(s32 id);
std::string getNameByID(s32 id);
#ifdef __ANDROID__
v2s32 m_down_pos;
std::wstring m_JavaDialogFieldName;
std::string m_JavaDialogFieldName;
#endif
/* If true, remap a double-click (or double-tap) action to ESC. This is so