const ListDrawSpec &spb = m_inventorylists[siz - 1];
m_inventory_rings.push_back(ListRingSpec(spa.inventoryloc, spa.listname));
m_inventory_rings.push_back(ListRingSpec(spb.inventoryloc, spb.listname));
+ return;
}
errorstream<< "Invalid list ring element(" << parts.size() << ", "
<< m_inventorylists.size() << "): '" << element << "'" << std::endl;
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
{
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
{
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;
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;
break;
ItemStack stack_from = list_from->getItem(s.i);
assert(shift_move_amount <= stack_from.count);
-
- // find a place (or more than one) to add the new item
- u32 ilt_size = list_to->getSize();
- ItemStack leftover;
- for (u32 slot_to = 0; slot_to < ilt_size
- && shift_move_amount > 0; slot_to++) {
- list_to->itemFits(slot_to, stack_from, &leftover);
- if (leftover.count < stack_from.count) {
- infostream << "Handing IACTION_MOVE to manager" << std::endl;
- IMoveAction *a = new IMoveAction();
- a->count = MYMIN(shift_move_amount,
- (u32) (stack_from.count - leftover.count));
- shift_move_amount -= a->count;
- a->from_inv = s.inventoryloc;
- a->from_list = s.listname;
- a->from_i = s.i;
- a->to_inv = to_inv_sp.inventoryloc;
- a->to_list = to_inv_sp.listname;
- a->to_i = slot_to;
- m_invmgr->inventoryAction(a);
- stack_from = leftover;
+ if (m_client->getProtoVersion() >= 25) {
+ infostream << "Handing IACTION_MOVE to manager" << std::endl;
+ IMoveAction *a = new IMoveAction();
+ a->count = shift_move_amount;
+ a->from_inv = s.inventoryloc;
+ a->from_list = s.listname;
+ a->from_i = s.i;
+ a->to_inv = to_inv_sp.inventoryloc;
+ a->to_list = to_inv_sp.listname;
+ a->move_somewhere = true;
+ m_invmgr->inventoryAction(a);
+ } else {
+ // find a place (or more than one) to add the new item
+ u32 ilt_size = list_to->getSize();
+ ItemStack leftover;
+ for (u32 slot_to = 0; slot_to < ilt_size
+ && shift_move_amount > 0; slot_to++) {
+ list_to->itemFits(slot_to, stack_from, &leftover);
+ if (leftover.count < stack_from.count) {
+ infostream << "Handing IACTION_MOVE to manager" << std::endl;
+ IMoveAction *a = new IMoveAction();
+ a->count = MYMIN(shift_move_amount,
+ (u32) (stack_from.count - leftover.count));
+ shift_move_amount -= a->count;
+ a->from_inv = s.inventoryloc;
+ a->from_list = s.listname;
+ a->from_i = s.i;
+ a->to_inv = to_inv_sp.inventoryloc;
+ a->to_list = to_inv_sp.listname;
+ a->to_i = slot_to;
+ m_invmgr->inventoryAction(a);
+ stack_from = leftover;
+ }
}
}
} while (0);
-
} else if (drop_amount > 0) {
m_selected_content_guess = ItemStack(); // Clear
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;
}