@@ -422,7 +422,7 @@ void GUIFormSpecMenu::parseCheckbox(parserData* data,std::string element)
422
422
if (selected == " true" )
423
423
fselected = true ;
424
424
425
- std::wstring wlabel = utf8_to_wide (label);
425
+ std::wstring wlabel = utf8_to_wide (unescape_string ( label) );
426
426
427
427
core::rect<s32> rect = core::rect<s32>(
428
428
pos.X , pos.Y + ((imgsize.Y /2 ) - m_btn_height),
@@ -618,7 +618,7 @@ void GUIFormSpecMenu::parseButton(parserData* data,std::string element,
618
618
if (!data->explicit_size )
619
619
warningstream<<" invalid use of button without a size[] element" <<std::endl;
620
620
621
- std::wstring wlabel = utf8_to_wide (label);
621
+ std::wstring wlabel = utf8_to_wide (unescape_string ( label) );
622
622
623
623
FieldSpec spec (
624
624
name,
@@ -752,7 +752,7 @@ void GUIFormSpecMenu::parseTable(parserData* data,std::string element)
752
752
spec.ftype = f_Table;
753
753
754
754
for (unsigned int i = 0 ; i < items.size (); ++i) {
755
- items[i] = unescape_string ( unescape_enriched (items[i]));
755
+ items[i] = unescape_enriched ( unescape_string (items[i]));
756
756
}
757
757
758
758
// now really show table
@@ -824,7 +824,7 @@ void GUIFormSpecMenu::parseTextList(parserData* data,std::string element)
824
824
spec.ftype = f_Table;
825
825
826
826
for (unsigned int i = 0 ; i < items.size (); ++i) {
827
- items[i] = unescape_string ( unescape_enriched (items[i]));
827
+ items[i] = unescape_enriched ( unescape_string (items[i]));
828
828
}
829
829
830
830
// now really show list
@@ -895,7 +895,7 @@ void GUIFormSpecMenu::parseDropDown(parserData* data,std::string element)
895
895
}
896
896
897
897
for (unsigned int i=0 ; i < items.size (); i++) {
898
- e->addItem (unescape_string ( unescape_enriched (
898
+ e->addItem (unescape_enriched ( unescape_string (
899
899
utf8_to_wide (items[i]))).c_str ());
900
900
}
901
901
@@ -945,7 +945,7 @@ void GUIFormSpecMenu::parsePwdField(parserData* data,std::string element)
945
945
946
946
core::rect<s32> rect = core::rect<s32>(pos.X , pos.Y , pos.X +geom.X , pos.Y +geom.Y );
947
947
948
- std::wstring wlabel = utf8_to_wide (label);
948
+ std::wstring wlabel = utf8_to_wide (unescape_string ( label) );
949
949
950
950
FieldSpec spec (
951
951
name,
@@ -1009,12 +1009,12 @@ void GUIFormSpecMenu::parseSimpleField(parserData* data,
1009
1009
default_val = m_form_src->resolveText (default_val);
1010
1010
1011
1011
1012
- std::wstring wlabel = utf8_to_wide (label);
1012
+ std::wstring wlabel = utf8_to_wide (unescape_string ( label) );
1013
1013
1014
1014
FieldSpec spec (
1015
1015
name,
1016
1016
wlabel,
1017
- utf8_to_wide (default_val),
1017
+ utf8_to_wide (unescape_string ( default_val) ),
1018
1018
258 +m_fields.size ()
1019
1019
);
1020
1020
@@ -1105,12 +1105,12 @@ void GUIFormSpecMenu::parseTextArea(parserData* data,
1105
1105
default_val = m_form_src->resolveText (default_val);
1106
1106
1107
1107
1108
- std::wstring wlabel = utf8_to_wide (label);
1108
+ std::wstring wlabel = utf8_to_wide (unescape_string ( label) );
1109
1109
1110
1110
FieldSpec spec (
1111
1111
name,
1112
1112
wlabel,
1113
- utf8_to_wide (default_val),
1113
+ utf8_to_wide (unescape_string ( default_val) ),
1114
1114
258 +m_fields.size ()
1115
1115
);
1116
1116
@@ -1218,7 +1218,7 @@ void GUIFormSpecMenu::parseLabel(parserData* data,std::string element)
1218
1218
// in the integer cases: 0.4 is not exactly
1219
1219
// representable in binary floating point.
1220
1220
s32 posy = pos.Y + ((float )i) * spacing.Y * 2.0 / 5.0 ;
1221
- std::wstring wlabel = utf8_to_wide (lines[i]);
1221
+ std::wstring wlabel = utf8_to_wide (unescape_string ( lines[i]) );
1222
1222
core::rect<s32> rect = core::rect<s32>(
1223
1223
pos.X , posy - m_btn_height,
1224
1224
pos.X + m_font->getDimension (wlabel.c_str ()).Width ,
@@ -1250,8 +1250,8 @@ void GUIFormSpecMenu::parseVertLabel(parserData* data,std::string element)
1250
1250
((parts.size () > 2 ) && (m_formspec_version > FORMSPEC_API_VERSION)))
1251
1251
{
1252
1252
std::vector<std::string> v_pos = split (parts[0 ],' ,' );
1253
- std::wstring text = unescape_string (
1254
- unescape_enriched (utf8_to_wide (parts[1 ])));
1253
+ std::wstring text = unescape_enriched (
1254
+ unescape_string (utf8_to_wide (parts[1 ])));
1255
1255
1256
1256
MY_CHECKPOS (" vertlabel" ,1 );
1257
1257
@@ -1339,7 +1339,7 @@ void GUIFormSpecMenu::parseImageButton(parserData* data,std::string element,
1339
1339
image_name = unescape_string (image_name);
1340
1340
pressed_image_name = unescape_string (pressed_image_name);
1341
1341
1342
- std::wstring wlabel = utf8_to_wide (label);
1342
+ std::wstring wlabel = utf8_to_wide (unescape_string ( label) );
1343
1343
1344
1344
FieldSpec spec (
1345
1345
name,
@@ -1437,7 +1437,7 @@ void GUIFormSpecMenu::parseTabHeader(parserData* data,std::string element)
1437
1437
e->setNotClipped (true );
1438
1438
1439
1439
for (unsigned int i = 0 ; i < buttons.size (); i++) {
1440
- e->addTab (unescape_string ( unescape_enriched (
1440
+ e->addTab (unescape_enriched ( unescape_string (
1441
1441
utf8_to_wide (buttons[i]))).c_str (), -1 );
1442
1442
}
1443
1443
@@ -1473,6 +1473,9 @@ void GUIFormSpecMenu::parseItemImageButton(parserData* data,std::string element)
1473
1473
std::string name = parts[3 ];
1474
1474
std::string label = parts[4 ];
1475
1475
1476
+ label = unescape_string (label);
1477
+ item_name = unescape_string (item_name);
1478
+
1476
1479
MY_CHECKPOS (" itemimagebutton" ,0 );
1477
1480
MY_CHECKGEOM (" itemimagebutton" ,1 );
1478
1481
@@ -1611,14 +1614,14 @@ void GUIFormSpecMenu::parseTooltip(parserData* data, std::string element)
1611
1614
std::vector<std::string> parts = split (element,' ;' );
1612
1615
if (parts.size () == 2 ) {
1613
1616
std::string name = parts[0 ];
1614
- m_tooltips[name] = TooltipSpec (parts[1 ],
1617
+ m_tooltips[name] = TooltipSpec (unescape_string ( parts[1 ]) ,
1615
1618
m_default_tooltip_bgcolor, m_default_tooltip_color);
1616
1619
return ;
1617
1620
} else if (parts.size () == 4 ) {
1618
1621
std::string name = parts[0 ];
1619
1622
video::SColor tmp_color1, tmp_color2;
1620
1623
if ( parseColorString (parts[2 ], tmp_color1, false ) && parseColorString (parts[3 ], tmp_color2, false ) ) {
1621
- m_tooltips[name] = TooltipSpec (parts[1 ],
1624
+ m_tooltips[name] = TooltipSpec (unescape_string ( parts[1 ]) ,
1622
1625
tmp_color1, tmp_color2);
1623
1626
return ;
1624
1627
}
0 commit comments