diff options
author | David Athay <ko2fan@gmail.com> | 2009-05-21 10:20:32 +0100 |
---|---|---|
committer | David Athay <ko2fan@gmail.com> | 2009-05-21 10:20:32 +0100 |
commit | 2dad08e4e8e199c84da6a6f2f5289c8c0e40fc81 (patch) | |
tree | 293d4922893dfffcc065604743116e653c3b8d37 /src/gui/inventorywindow.cpp | |
parent | dc1eb0895382451b1c79c60ecb7ca7dbbec89681 (diff) | |
parent | 244b0d9b46128ab3498da078020c8bbf8c65f69f (diff) | |
download | mana-2dad08e4e8e199c84da6a6f2f5289c8c0e40fc81.tar.gz mana-2dad08e4e8e199c84da6a6f2f5289c8c0e40fc81.tar.bz2 mana-2dad08e4e8e199c84da6a6f2f5289c8c0e40fc81.tar.xz mana-2dad08e4e8e199c84da6a6f2f5289c8c0e40fc81.zip |
Merge branch 'master' of git@gitorious.org:tmw/mainline
Diffstat (limited to 'src/gui/inventorywindow.cpp')
-rw-r--r-- | src/gui/inventorywindow.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp index d6cd3a84..c44ae9e7 100644 --- a/src/gui/inventorywindow.cpp +++ b/src/gui/inventorywindow.cpp @@ -79,6 +79,7 @@ InventoryWindow::InventoryWindow(int invSize): mUseButton = new Button(longestUseString, "use", this); mDropButton = new Button(_("Drop"), "drop", this); mSplitButton = new Button(_("Split"), "split", this); + mOutfitButton = new Button(_("Outfits"), "outfit", this); mItems = new ItemContainer(player_node->getInventory()); mItems->addSelectionListener(this); @@ -103,6 +104,7 @@ InventoryWindow::InventoryWindow(int invSize): place(0, 2, mUseButton); place(1, 2, mDropButton); place(2, 2, mSplitButton); + place(6, 2, mOutfitButton); Layout &layout = getLayout(); layout.setRowHeight(1, Layout::AUTO_SET); @@ -156,6 +158,16 @@ void InventoryWindow::logic() void InventoryWindow::action(const gcn::ActionEvent &event) { + if (event.getId() == "outfit") + { + extern Window *outfitWindow; + outfitWindow->setVisible(!outfitWindow->isVisible()); + if (outfitWindow->isVisible()) + { + outfitWindow->requestMoveToTop(); + } + } + Item *item = mItems->getSelectedItem(); if (!item) @@ -163,7 +175,7 @@ void InventoryWindow::action(const gcn::ActionEvent &event) if (event.getId() == "use") { - if (item->isEquipment()) + if (item->isEquipment()) { if (item->isEquipped()) Net::getInventoryHandler()->unequipItem(item); @@ -258,10 +270,10 @@ void InventoryWindow::updateButtons() mDropButton->setEnabled(false); return; } - + mUseButton->setEnabled(true); mDropButton->setEnabled(true); - + if (selectedItem->isEquipment()) { if (selectedItem->isEquipped()) |