diff options
author | Dennis Friis <peavey@inspircd.org> | 2009-05-14 21:49:19 +0200 |
---|---|---|
committer | Dennis Friis <peavey@inspircd.org> | 2009-05-14 21:49:19 +0200 |
commit | d4247f3edb63733e9b2a6903ad2ae08c770e8a0f (patch) | |
tree | 97623a9f1f2f6491a55eea8a922bb3a83b10c3f3 | |
parent | e0eeaef318d63ae79522c1d0407e4f5b8212c5f7 (diff) | |
download | mana-d4247f3edb63733e9b2a6903ad2ae08c770e8a0f.tar.gz mana-d4247f3edb63733e9b2a6903ad2ae08c770e8a0f.tar.bz2 mana-d4247f3edb63733e9b2a6903ad2ae08c770e8a0f.tar.xz mana-d4247f3edb63733e9b2a6903ad2ae08c770e8a0f.zip |
Fixes to outfit window
- Moved the outfit button onto the Inventory window
- Fixed 'unequip first' saving bug
Patch by QOAL
-rw-r--r-- | src/gui/inventorywindow.cpp | 18 | ||||
-rw-r--r-- | src/gui/inventorywindow.h | 1 | ||||
-rw-r--r-- | src/gui/outfitwindow.cpp | 2 | ||||
-rw-r--r-- | src/gui/windowmenu.cpp | 6 |
4 files changed, 17 insertions, 10 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()) diff --git a/src/gui/inventorywindow.h b/src/gui/inventorywindow.h index 6e34666d..fbda5ac7 100644 --- a/src/gui/inventorywindow.h +++ b/src/gui/inventorywindow.h @@ -109,6 +109,7 @@ class InventoryWindow : public Window, gcn::Button *mUseButton; gcn::Button *mDropButton; gcn::Button *mSplitButton; + gcn::Button *mOutfitButton; gcn::Label *mWeightLabel; gcn::Label *mSlotsLabel; diff --git a/src/gui/outfitwindow.cpp b/src/gui/outfitwindow.cpp index 1812c58b..53950299 100644 --- a/src/gui/outfitwindow.cpp +++ b/src/gui/outfitwindow.cpp @@ -119,7 +119,7 @@ void OutfitWindow::save() config.setValue("Outfit" + toString(o), outfitStr); outfitStr = ""; } - config.setValue("OutfitUnequip", mUnequipCheck ? true : false); + config.setValue("OutfitUnequip", mUnequipCheck->isSelected()); } void OutfitWindow::action(const gcn::ActionEvent &event) diff --git a/src/gui/windowmenu.cpp b/src/gui/windowmenu.cpp index d66aa602..8964f072 100644 --- a/src/gui/windowmenu.cpp +++ b/src/gui/windowmenu.cpp @@ -47,7 +47,6 @@ extern Window *buddyWindow; extern Window *guildWindow; extern Window *magicDialog; #endif -extern Window *outfitWindow; WindowMenu::WindowMenu(): mEmotePopup(0) @@ -56,7 +55,6 @@ WindowMenu::WindowMenu(): static const char *buttonNames[] = { ":-)", - N_("Outfits"), N_("Status"), N_("Equipment"), N_("Inventory"), @@ -115,10 +113,6 @@ void WindowMenu::action(const gcn::ActionEvent &event) mEmotePopup = 0; } } - else if (event.getId() == "Outfits") - { - window = outfitWindow; - } else if (event.getId() == "Status") { window = statusWindow; |