void GUIFormSpecMenu::parseList(parserData* data,std::string element)
{
if (m_gamedef == 0) {
- errorstream<<"WARNING: invalid use of 'list' with m_gamedef==0"<<std::endl;
+ warningstream<<"invalid use of 'list' with m_gamedef==0"<<std::endl;
return;
}
}
if(!data->explicit_size)
- errorstream<<"WARNING: invalid use of list without a size[] element"<<std::endl;
+ warningstream<<"invalid use of list without a size[] element"<<std::endl;
m_inventorylists.push_back(ListDrawSpec(loc, listname, pos, geom, start_i));
return;
}
geom.Y = stof(v_geom[1]) * (float)imgsize.Y;
if(!data->explicit_size)
- errorstream<<"WARNING: invalid use of image without a size[] element"<<std::endl;
+ warningstream<<"invalid use of image without a size[] element"<<std::endl;
m_images.push_back(ImageDrawSpec(name, pos, geom));
return;
}
pos.Y += stof(v_pos[1]) * (float) spacing.Y;
if(!data->explicit_size)
- errorstream<<"WARNING: invalid use of image without a size[] element"<<std::endl;
+ warningstream<<"invalid use of image without a size[] element"<<std::endl;
m_images.push_back(ImageDrawSpec(name, pos));
return;
}
geom.Y = stof(v_geom[1]) * (float)imgsize.Y;
if(!data->explicit_size)
- errorstream<<"WARNING: invalid use of item_image without a size[] element"<<std::endl;
+ warningstream<<"invalid use of item_image without a size[] element"<<std::endl;
m_itemimages.push_back(ImageDrawSpec(name, pos, geom));
return;
}
pos.X + geom.X, pos.Y + m_btn_height);
if(!data->explicit_size)
- errorstream<<"WARNING: invalid use of button without a size[] element"<<std::endl;
+ warningstream<<"invalid use of button without a size[] element"<<std::endl;
label = unescape_string(label);
}
if(!data->explicit_size)
- errorstream<<"WARNING: invalid use of background without a size[] element"<<std::endl;
+ warningstream<<"invalid use of background without a size[] element"<<std::endl;
m_backgrounds.push_back(ImageDrawSpec(name, pos, geom));
return;
}
core::rect<s32> rect;
if(data->explicit_size)
- errorstream<<"WARNING: invalid use of unpositioned \"field\" in inventory"<<std::endl;
+ warningstream<<"invalid use of unpositioned \"field\" in inventory"<<std::endl;
v2s32 pos = padding + AbsoluteRect.UpperLeftCorner;
pos.Y = ((m_fields.size()+2)*60);
if (g_settings->getBool("freetype")) {
e = (gui::IGUIElement *) new gui::intlGUIEditBox(spec.fdefault.c_str(),
true, Environment, this, spec.fid, rect);
+ e->drop();
} else {
#else
{
core::rect<s32> rect = core::rect<s32>(pos.X, pos.Y, pos.X+geom.X, pos.Y+geom.Y);
if(!data->explicit_size)
- errorstream<<"WARNING: invalid use of positioned "<<type<<" without a size[] element"<<std::endl;
+ warningstream<<"invalid use of positioned "<<type<<" without a size[] element"<<std::endl;
if(m_form_src)
default_val = m_form_src->resolveText(default_val);
if (g_settings->getBool("freetype")) {
e = (gui::IGUIEditBox *) new gui::intlGUIEditBox(spec.fdefault.c_str(),
true, Environment, this, spec.fid, rect);
+ e->drop();
} else {
#else
{
pos.Y += (stof(v_pos[1]) + 7.0/30.0) * (float)spacing.Y;
if(!data->explicit_size)
- errorstream<<"WARNING: invalid use of label without a size[] element"<<std::endl;
+ warningstream<<"invalid use of label without a size[] element"<<std::endl;
text = unescape_string(text);
std::vector<std::string> lines = split(text, '\n');
//actually text.length() would be correct but adding +1 avoids to break all mods
if(!data->explicit_size)
- errorstream<<"WARNING: invalid use of label without a size[] element"<<std::endl;
+ warningstream<<"invalid use of label without a size[] element"<<std::endl;
std::wstring label = L"";
core::rect<s32> rect = core::rect<s32>(pos.X, pos.Y, pos.X+geom.X, pos.Y+geom.Y);
if(!data->explicit_size)
- errorstream<<"WARNING: invalid use of image_button without a size[] element"<<std::endl;
+ warningstream<<"invalid use of image_button without a size[] element"<<std::endl;
image_name = unescape_string(image_name);
pressed_image_name = unescape_string(pressed_image_name);
{
if (m_gamedef == 0) {
- errorstream <<
- "WARNING: invalid use of item_image_button with m_gamedef==0"
- << std::endl;
+ warningstream << "invalid use of item_image_button with m_gamedef==0"
+ << std::endl;
return;
}
core::rect<s32> rect = core::rect<s32>(pos.X, pos.Y, pos.X+geom.X, pos.Y+geom.Y);
if(!data->explicit_size)
- errorstream<<"WARNING: invalid use of item_image_button without a size[] element"<<std::endl;
+ warningstream<<"invalid use of item_image_button without a size[] element"<<std::endl;
IItemDefManager *idef = m_gamedef->idef();
ItemStack item;
m_fields.clear();
m_boxes.clear();
m_tooltips.clear();
+ m_inventory_rings.clear();
// Set default values (fits old formspec values)
m_bgcolor = video::SColor(140,0,0,0);
}
for(std::vector<FieldSpec>::iterator iter = m_fields.begin();
- iter != m_fields.end(); iter++) {
+ iter != m_fields.end(); ++iter) {
if (iter->fname != fieldname) {
continue;
Inventory *inv = m_invmgr->getInventory(s.inventoryloc);
if(!inv){
- infostream<<"GUIFormSpecMenu::drawList(): WARNING: "
+ warningstream<<"GUIFormSpecMenu::drawList(): "
<<"The inventory location "
<<"\""<<s.inventoryloc.dump()<<"\" doesn't exist"
<<std::endl;
}
InventoryList *ilist = inv->getList(s.listname);
if(!ilist){
- infostream<<"GUIFormSpecMenu::drawList(): WARNING: "
+ warningstream<<"GUIFormSpecMenu::drawList(): "
<<"The inventory list \""<<s.listname<<"\" @ \""
<<s.inventoryloc.dump()<<"\" doesn't exist"
<<std::endl;
if (id != -1 && delta >= m_tooltip_show_delay) {
for(std::vector<FieldSpec>::iterator iter = m_fields.begin();
- iter != m_fields.end(); iter++) {
+ iter != m_fields.end(); ++iter) {
if ( (iter->fid == id) && (m_tooltips[iter->fname].tooltip != "") ){
if (m_old_tooltip != m_tooltips[iter->fname].tooltip) {
m_old_tooltip = m_tooltips[iter->fname].tooltip;
std::string GUIFormSpecMenu::getNameByID(s32 id)
{
for(std::vector<FieldSpec>::iterator iter = m_fields.begin();
- iter != m_fields.end(); iter++) {
+ iter != m_fields.end(); ++iter) {
if (iter->fid == id) {
return iter->fname;
}
std::wstring GUIFormSpecMenu::getLabelByID(s32 id)
{
for(std::vector<FieldSpec>::iterator iter = m_fields.begin();
- iter != m_fields.end(); iter++) {
+ iter != m_fields.end(); ++iter) {
if (iter->fid == id) {
return iter->flabel;
}