X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2FguiFormSpecMenu.cpp;h=1754422d08637eeee0f2e1126030a1b2d6742e98;hb=e1ff5b13619666e5b987ecf4faaf294400ffd979;hp=e1ccee91a7a6bae5918fe34cfe92a04085b71b26;hpb=46d431e7c3cb1345c34613647a6eb61aabeb087a;p=dragonfireclient.git diff --git a/src/guiFormSpecMenu.cpp b/src/guiFormSpecMenu.cpp index e1ccee91a..1754422d0 100644 --- a/src/guiFormSpecMenu.cpp +++ b/src/guiFormSpecMenu.cpp @@ -1,6 +1,6 @@ /* -Minetest-c55 -Copyright (C) 2010 celeron55, Perttu Ahola +Minetest +Copyright (C) 2013 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -207,18 +207,18 @@ void GUIFormSpecMenu::regenerateGui(v2u32 screensize) Strfnd f(m_formspec_string); while(f.atend() == false) { - std::string type = trim(f.next("[")); + std::string type = trim(f.next_esc("[")); if(type == "invsize" || type == "size") { v2f invsize; - invsize.X = stof(f.next(",")); + invsize.X = stof(f.next_esc(",")); if(type == "size") { - invsize.Y = stof(f.next("]")); + invsize.Y = stof(f.next_esc("]")); } else{ - invsize.Y = stof(f.next(";")); - f.next("]"); + invsize.Y = stof(f.next_esc(";")); + f.next_esc("]"); } infostream<<"Form size ("<(pos.X, pos.Y+((imgsize.Y/2)-15), pos.X+300, pos.Y+((imgsize.Y/2)+15)); - std::string flabel = f.next("]"); + std::string flabel = f.next_esc("]"); if(bp_set != 2) errorstream<<"WARNING: invalid use of label without a size[] element"<(pos.X, pos.Y-15, pos.X+geom.X, pos.Y+15); - std::string fname = f.next(";"); - std::string flabel = f.next("]"); + std::string fname = f.next_esc(";"); + std::string flabel = f.next_esc("]"); if(bp_set != 2) errorstream<<"WARNING: invalid use of button without a size[] element"<(pos.X, pos.Y, pos.X+geom.X, pos.Y+geom.Y); - std::string fimage = f.next(";"); - std::string fname = f.next(";"); - std::string flabel = f.next("]"); + std::string fimage = f.next_esc(";"); + std::string fname = f.next_esc(";"); + std::string flabel = f.next_esc("]"); if(bp_set != 2) errorstream<<"WARNING: invalid use of image_button without a size[] element"<(pos.X, pos.Y, pos.X+geom.X, pos.Y+geom.Y); - std::string fimage = f.next(";"); - std::string fname = f.next(";"); - std::string flabel = f.next("]"); + std::string fimage = f.next_esc(";"); + std::string fname = f.next_esc(";"); + std::string flabel = f.next_esc("]"); if(bp_set != 2) errorstream<<"WARNING: invalid use of item_image_button without a size[] element"<idef(); @@ -535,6 +544,7 @@ void GUIFormSpecMenu::regenerateGui(v2u32 screensize) item.deSerialize(fimage, idef); video::ITexture *texture = idef->getInventoryTexture(item.getDefinition(idef).name, m_gamedef); std::string tooltip = item.getDefinition(idef).description; + flabel = unescape_string(flabel); FieldSpec spec = FieldSpec( narrow_to_wide(fname.c_str()), narrow_to_wide(flabel.c_str()), @@ -556,7 +566,7 @@ void GUIFormSpecMenu::regenerateGui(v2u32 screensize) else { // Ignore others - std::string ts = f.next("]"); + std::string ts = f.next_esc("]"); infostream<<"Unknown DrawSpec: type="<