struct TextDest
{
- virtual ~TextDest() {};
+ virtual ~TextDest() {}
// This is deprecated I guess? -celeron55
- virtual void gotText(std::wstring text){}
+ virtual void gotText(const std::wstring &text) {}
virtual void gotText(const StringMap &fields) = 0;
- virtual void setFormName(std::string formname)
- { m_formname = formname;};
std::string m_formname;
};
virtual ~IFormSource(){}
virtual std::string getForm() = 0;
// Fill in variables in field text
- virtual std::string resolveText(std::string str){ return str; }
+ virtual std::string resolveText(const std::string &str) { return str; }
};
class GUIFormSpecMenu : public GUIModalMenu
{
ItemSpec() :
i(-1)
- {}
+ {
+ }
ItemSpec(const InventoryLocation &a_inventoryloc,
const std::string &a_listname,
inventoryloc(a_inventoryloc),
listname(a_listname),
i(a_i)
- {}
+ {
+ }
bool isValid() const { return i != -1; }
ImageDrawSpec():
parent_button(NULL),
clip(false)
- {}
+ {
+ }
ImageDrawSpec(const std::string &a_name,
const std::string &a_item_name,
geom(a_geom),
scale(true),
clip(false)
- {}
+ {
+ }
ImageDrawSpec(const std::string &a_name,
const std::string &a_item_name,
geom(a_geom),
scale(true),
clip(false)
- {}
+ {
+ }
ImageDrawSpec(const std::string &a_name,
const v2s32 &a_pos, const v2s32 &a_geom, bool clip=false):
geom(a_geom),
scale(true),
clip(clip)
- {}
+ {
+ }
ImageDrawSpec(const std::string &a_name,
const v2s32 &a_pos):
pos(a_pos),
scale(false),
clip(false)
- {}
+ {
+ }
std::string name;
std::string item_name;
send(false),
ftype(f_Unknown),
is_exit(false)
- {}
+ {
+ }
std::string fname;
std::wstring flabel;
core::rect<s32> rect;
};
- struct BoxDrawSpec {
+ struct BoxDrawSpec
+ {
BoxDrawSpec(v2s32 a_pos, v2s32 a_geom,irr::video::SColor a_color):
pos(a_pos),
geom(a_geom),
irr::video::SColor color;
};
- struct TooltipSpec {
+ struct TooltipSpec
+ {
TooltipSpec() {}
- TooltipSpec(std::string a_tooltip, irr::video::SColor a_bgcolor,
+ TooltipSpec(const std::string &a_tooltip, irr::video::SColor a_bgcolor,
irr::video::SColor a_color):
tooltip(utf8_to_wide(a_tooltip)),
bgcolor(a_bgcolor),
color(a_color)
- {}
+ {
+ }
std::wstring tooltip;
irr::video::SColor bgcolor;
irr::video::SColor color;
};
- struct StaticTextSpec {
+ struct StaticTextSpec
+ {
StaticTextSpec():
parent_button(NULL)
{
}
+
StaticTextSpec(const std::wstring &a_text,
const core::rect<s32> &a_rect):
+ text(a_text),
rect(a_rect),
parent_button(NULL)
{
- //text = unescape_enriched(a_text);
- text = a_text;
}
+
StaticTextSpec(const std::wstring &a_text,
const core::rect<s32> &a_rect,
gui::IGUIButton *a_parent_button):
text(a_text),
rect(a_rect),
parent_button(a_parent_button)
- {}
+ {
+ }
std::wstring text;
core::rect<s32> rect;
~GUIFormSpecMenu();
void setFormSpec(const std::string &formspec_string,
- InventoryLocation current_inventory_location)
+ const InventoryLocation ¤t_inventory_location)
{
m_formspec_string = formspec_string;
m_current_inventory_location = current_inventory_location;
gui::IGUIStaticText *m_tooltip_element;
u32 m_tooltip_show_delay;
- s32 m_hovered_time;
+ s64 m_hovered_time;
s32 m_old_tooltip_id;
std::wstring m_old_tooltip;
fs_key_pendig current_keys_pending;
std::string current_field_enter_pending;
- void parseElement(parserData* data, std::string element);
+ void parseElement(parserData* data, const std::string &element);
void parseSize(parserData* data, const std::string &element);
void parseContainer(parserData* data, const std::string &element);
struct clickpos
{
v2s32 pos;
- s32 time;
+ s64 time;
};
clickpos m_doubleclickdetect[2];
public:
FormspecFormSource(const std::string &formspec):
m_formspec(formspec)
- {}
+ {
+ }
~FormspecFormSource()
- {}
+ {
+ }
void setForm(const std::string &formspec)
{