diff options
Diffstat (limited to 'src/gui/outfitwindow.cpp')
-rw-r--r-- | src/gui/outfitwindow.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/gui/outfitwindow.cpp b/src/gui/outfitwindow.cpp index 89bf47da..f16ebd39 100644 --- a/src/gui/outfitwindow.cpp +++ b/src/gui/outfitwindow.cpp @@ -22,18 +22,17 @@ #include "outfitwindow.h" #include "configuration.h" -#include "localplayer.h" +#include "equipment.h" #include "graphics.h" #include "inventory.h" -#include "equipment.h" #include "item.h" #include "log.h" +#include "playerinfo.h" #include "gui/chat.h" #include "gui/widgets/button.h" #include "gui/widgets/checkbox.h" -#include "gui/widgets/chattab.h" #include "gui/widgets/label.h" #include "gui/widgets/layout.h" @@ -168,11 +167,11 @@ void OutfitWindow::wearOutfit(int outfit) Item *item; for (int i = 0; i < OUTFIT_ITEM_COUNT; i++) { - item = player_node->getInventory()->findItem(mItems[outfit][i]); + item = PlayerInfo::getInventory()->findItem(mItems[outfit][i]); if (item && !item->isEquipped() && item->getQuantity()) { if (item->isEquipment()) - Net::getInventoryHandler()->equipItem(item); + item->doEvent("doEquip"); } } } @@ -206,7 +205,7 @@ void OutfitWindow::draw(gcn::Graphics *graphics) } Item *item = - player_node->getInventory()->findItem(mItems[mCurrentOutfit][i]); + PlayerInfo::getInventory()->findItem(mItems[mCurrentOutfit][i]); if (item) { // Draw item icon. @@ -245,7 +244,7 @@ void OutfitWindow::mouseDragged(gcn::MouseEvent &event) const int itemId = mItems[mCurrentOutfit][index]; if (itemId < 0) return; - Item *item = player_node->getInventory()->findItem(itemId); + Item *item = PlayerInfo::getInventory()->findItem(itemId); if (item) { mItemMoved = item; @@ -319,7 +318,7 @@ int OutfitWindow::getIndexFromGrid(int pointX, int pointY) const void OutfitWindow::unequipNotInOutfit(int outfit) { - Inventory *inventory = player_node->getInventory(); + Inventory *inventory = PlayerInfo::getInventory(); if (!inventory) return; @@ -338,7 +337,10 @@ void OutfitWindow::unequipNotInOutfit(int outfit) } if (!found) { - Net::getInventoryHandler()->unequipItem(inventory->getItem(i)); + Item *item = inventory->getItem(i); + + if (item) + item->doEvent("doUnequip"); } } } |