diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-05-06 16:34:06 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-05-06 16:36:11 -0600 |
commit | 574ef501d32c7735d2aed022f2a3761d053bbe7c (patch) | |
tree | ca5dd0709d6a0d1989af3fab6b1f85c6726a2fb0 /src/gui/inventorywindow.cpp | |
parent | 3603521356ad1646d456a1681ff9f8a7c88ab458 (diff) | |
download | mana-574ef501d32c7735d2aed022f2a3761d053bbe7c.tar.gz mana-574ef501d32c7735d2aed022f2a3761d053bbe7c.tar.bz2 mana-574ef501d32c7735d2aed022f2a3761d053bbe7c.tar.xz mana-574ef501d32c7735d2aed022f2a3761d053bbe7c.zip |
Clean up the bypass code for the ItemAmountWindow
Diffstat (limited to 'src/gui/inventorywindow.cpp')
-rw-r--r-- | src/gui/inventorywindow.cpp | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp index 372e94d3..027c6aa8 100644 --- a/src/gui/inventorywindow.cpp +++ b/src/gui/inventorywindow.cpp @@ -174,20 +174,12 @@ void InventoryWindow::action(const gcn::ActionEvent &event) } else if (event.getId() == "drop") { - if (item->getQuantity() > 1) { - // Choose amount of items to drop - new ItemAmountWindow(ItemAmountWindow::ItemDrop, this, item); - } - else { - player_node->dropItem(item, 1); - } + ItemAmountWindow::showWindow(ItemAmountWindow::ItemDrop, this, item); } else if (event.getId() == "split") { - if (item && !item->isEquipment() && item->getQuantity() > 1) { - new ItemAmountWindow(ItemAmountWindow::ItemSplit, this, item, + ItemAmountWindow::showWindow(ItemAmountWindow::ItemSplit, this, item, (item->getQuantity() - 1)); - } } } @@ -244,12 +236,8 @@ void InventoryWindow::valueChanged(const gcn::SelectionEvent &event) { Item *item = mItems->getSelectedItem(); - if (item && !item->isEquipment() && item->getQuantity() > 1) - { - mSplit = false; - new ItemAmountWindow(ItemAmountWindow::ItemSplit, this, item, + ItemAmountWindow::showWindow(ItemAmountWindow::ItemSplit, this, item, (item->getQuantity() - 1)); - } } } |