]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/guiFormSpecMenu.cpp
Use player:set_hotbar_image() instead of hardcoded hotbar.png
[dragonfireclient.git] / src / guiFormSpecMenu.cpp
index 1da923cd17686df84fa061cb1f293b60e132eede..b162e8e992b2841e937e7e210604fd21260dbe3c 100644 (file)
@@ -1069,7 +1069,7 @@ void GUIFormSpecMenu::parseVertLabel(parserData* data,std::string element) {
 
        if (parts.size() == 2) {
                std::vector<std::string> v_pos = split(parts[0],',');
-               std::string text = parts[1];
+               std::wstring text = narrow_to_wide(unescape_string(parts[1]));
 
                MY_CHECKPOS("vertlabel",1);
 
@@ -1082,17 +1082,16 @@ void GUIFormSpecMenu::parseVertLabel(parserData* data,std::string element) {
                if(data->bp_set != 2)
                        errorstream<<"WARNING: invalid use of label without a size[] element"<<std::endl;
 
-               text = unescape_string(text);
-               std::string label = "";
+               std::wstring label = L"";
 
                for (unsigned int i=0; i < text.length(); i++) {
-                       label += text.c_str()[i];
-                       label += "\n";
+                       label += text[i];
+                       label += L"\n";
                }
 
                FieldSpec spec = FieldSpec(
                        L"",
-                       narrow_to_wide(label.c_str()),
+                       label,
                        L"",
                        258+m_fields.size()
                );
@@ -1253,7 +1252,8 @@ void GUIFormSpecMenu::parseTabHeader(parserData* data,std::string element) {
                for (unsigned int i=0; i< buttons.size(); i++) {
                        wchar_t* wbutton = 0;
 
-                       wbutton = (wchar_t*) narrow_to_wide(buttons[i].c_str()).c_str();
+                       std::wstring wlabel = narrow_to_wide(buttons[i]); //Needed for displaying text on windows
+                       wbutton = (wchar_t*) wlabel.c_str();
 
                        e->addTab(wbutton,-1);
                }