diff options
author | Jared Adams <jaxad0127@gmail.com> | 2010-03-25 16:03:13 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2010-03-25 16:56:12 -0600 |
commit | 8745368108563d7c32820b989c3ea794ccb834f9 (patch) | |
tree | a69554b2e5659b25f50797cc6ab4cc95b2b6f84e /src/gui/inventorywindow.cpp | |
parent | ac18a72c9972faf6dbd68abf3c883b2d444396c8 (diff) | |
download | mana-8745368108563d7c32820b989c3ea794ccb834f9.tar.gz mana-8745368108563d7c32820b989c3ea794ccb834f9.tar.bz2 mana-8745368108563d7c32820b989c3ea794ccb834f9.tar.xz mana-8745368108563d7c32820b989c3ea794ccb834f9.zip |
Remove the type boolean from InventoryWindow
This moves inventory/storage type into the Inventory class, having
size default to a call to the netcode to get the sive for the given
type.
Reviewed-by: Chuck Miller
Diffstat (limited to 'src/gui/inventorywindow.cpp')
-rw-r--r-- | src/gui/inventorywindow.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp index 41d0246c..26f12285 100644 --- a/src/gui/inventorywindow.cpp +++ b/src/gui/inventorywindow.cpp @@ -55,12 +55,12 @@ InventoryWindow::WindowList InventoryWindow::instances; -InventoryWindow::InventoryWindow(Inventory *inventory, bool isMainInventory): - Window(isMainInventory ? _("Inventory") : _("Storage")), +InventoryWindow::InventoryWindow(Inventory *inventory): + Window(inventory->isMainInventory() ? _("Inventory") : _("Storage")), mInventory(inventory), mSplit(false) { - setWindowName(isMainInventory ? "Inventory" : "Storage"); + setWindowName(inventory->isMainInventory() ? "Inventory" : "Storage"); setupWindow->registerWindowForReset(this); setResizable(true); setCloseButton(true); @@ -80,7 +80,7 @@ InventoryWindow::InventoryWindow(Inventory *inventory, bool isMainInventory): mSlotsLabel = new Label(_("Slots:")); mSlotsBar = new ProgressBar(0.0f, 100, 20, Theme::PROG_INVY_SLOTS); - if (isMainInventory) + if (inventory->isMainInventory()) { std::string equip = _("Equip"); std::string use = _("Use"); @@ -137,7 +137,7 @@ InventoryWindow::InventoryWindow(Inventory *inventory, bool isMainInventory): loadWindowState(); slotsChanged(mInventory); - if (!isMainInventory) + if (!inventory->isMainInventory()) setVisible(true); } @@ -241,9 +241,9 @@ void InventoryWindow::mouseClicked(gcn::MouseEvent &event) if(!item) return; - Net::getInventoryHandler()->moveItem(Net::InventoryHandler::INVENTORY, + Net::getInventoryHandler()->moveItem(Inventory::INVENTORY, item->getInvIndex(), item->getQuantity(), - Net::InventoryHandler::STORAGE); + Inventory::STORAGE); } } } @@ -326,7 +326,7 @@ void InventoryWindow::close() if (this == inventoryWindow) return; - Net::getInventoryHandler()->closeStorage(Net::InventoryHandler::STORAGE); + Net::getInventoryHandler()->closeStorage(Inventory::STORAGE); scheduleDelete(); } |