~ubuntu-branches/ubuntu/trusty/manaplus/trusty-proposed

« back to all changes in this revision

Viewing changes to src/gui/inventorywindow.cpp

  • Committer: Package Import Robot
  • Author(s): Patrick Matthäi
  • Date: 2013-07-11 10:09:41 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20130711100941-f0rwuvcwgl8ulqo8
Tags: 1.3.7.7.1-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
169
169
    mSortDropDown->setSelected(0);
170
170
 
171
171
    StringVect tags = ItemDB::getTags();
172
 
    for (unsigned f = 0; f < tags.size(); f ++)
 
172
    const size_t sz = tags.size();
 
173
    for (size_t f = 0; f < sz; f ++)
173
174
        mFilter->addButton(tags[f]);
174
175
 
175
176
    if (isMainInventory())
274
275
    if (!invInstances.empty())
275
276
        invInstances.front()->updateDropButton();
276
277
 
277
 
    mSortDropDown->hideDrop();
 
278
    mSortDropDown->hideDrop(false);
278
279
    delete mSortModel;
279
280
    mSortModel = nullptr;
280
 
    delete mTextPopup;
281
281
    mTextPopup = nullptr;
282
282
}
283
283
 
360
360
        }
361
361
        else
362
362
        {
 
363
            if (PlayerInfo::isItemProtected(item->getId()))
 
364
                return;
363
365
            Net::getInventoryHandler()->useItem(item);
364
366
        }
365
367
    }
374
376
        }
375
377
        else
376
378
        {
 
379
            if (PlayerInfo::isItemProtected(item->getId()))
 
380
                return;
377
381
            Net::getInventoryHandler()->useItem(item);
378
382
        }
379
383
    }
380
384
    else if (eventId == "drop")
381
385
    {
 
386
        if (PlayerInfo::isItemProtected(item->getId()))
 
387
            return;
 
388
 
382
389
        if (isStorageActive())
383
390
        {
384
391
            Net::getInventoryHandler()->moveItem2(Inventory::INVENTORY,
503
510
        }
504
511
        else if (mod2 && mInventory->isMainInventory())
505
512
        {
 
513
            if (PlayerInfo::isItemProtected(item->getId()))
 
514
                return;
506
515
            if (event.getButton() == gcn::MouseEvent::RIGHT)
507
516
            {
508
517
                ItemAmountWindow::showWindow(ItemAmountWindow::TradeAdd,
525
534
                }
526
535
                else if (tradeWindow && tradeWindow->isWindowVisible())
527
536
                {
 
537
                    if (PlayerInfo::isItemProtected(item->getId()))
 
538
                        return;
528
539
                    ItemAmountWindow::showWindow(ItemAmountWindow::TradeAdd,
529
540
                        tradeWindow, item);
530
541
                }
539
550
                    }
540
551
                    else
541
552
                    {
 
553
                        if (PlayerInfo::isItemProtected(item->getId()))
 
554
                            return;
542
555
                        Net::getInventoryHandler()->useItem(item);
543
556
                    }
544
557
                }