diff options
author | Jared Adams <jaxad0127@gmail.com> | 2010-08-03 11:43:34 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2010-08-03 11:43:34 -0600 |
commit | 94f91a5fd9f3f609e93224fe71d2a3bcce1c0866 (patch) | |
tree | 3541e3e91bca871cfa5e4cf395d35957d8f7c5cf /src/gui/widgets | |
parent | 71ea8233334803a079ad24396ead02280a80d8d4 (diff) | |
parent | 98abc793f8fb45d647e1e8c51cf5f38170c6b703 (diff) | |
download | mana-client-94f91a5fd9f3f609e93224fe71d2a3bcce1c0866.tar.gz mana-client-94f91a5fd9f3f609e93224fe71d2a3bcce1c0866.tar.bz2 mana-client-94f91a5fd9f3f609e93224fe71d2a3bcce1c0866.tar.xz mana-client-94f91a5fd9f3f609e93224fe71d2a3bcce1c0866.zip |
Merge remote branch 'origin/1.0'
Conflicts:
src/net/tmwa/chathandler.cpp
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/itemcontainer.cpp | 40 |
1 files changed, 36 insertions, 4 deletions
diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp index 5163fc45..7648eb24 100644 --- a/src/gui/widgets/itemcontainer.cpp +++ b/src/gui/widgets/itemcontainer.cpp @@ -255,14 +255,46 @@ void ItemContainer::mousePressed(gcn::MouseEvent &event) if (mSelectedIndex == index) { - mSelectionStatus = SEL_DESELECTING; + if(event.getClickCount() == 2) + { + if (item->isEquipment()) + { + if (item->isEquipped()) + Net::getInventoryHandler()->unequipItem(item); + else + Net::getInventoryHandler()->equipItem(item); + } + else + Net::getInventoryHandler()->useItem(item); + + } + else + { + mSelectionStatus = SEL_DESELECTING; + } } else if (item && item->getId()) { - setSelectedIndex(index); - mSelectionStatus = SEL_SELECTING; + if(event.getClickCount() == 2) + { + if (item->isEquipment()) + { + if (item->isEquipped()) + Net::getInventoryHandler()->unequipItem(item); + else + Net::getInventoryHandler()->equipItem(item); + } + else + Net::getInventoryHandler()->useItem(item); - itemShortcut->setItemSelected(item->getId()); + } + else + { + setSelectedIndex(index); + mSelectionStatus = SEL_SELECTING; + + itemShortcut->setItemSelected(item->getId()); + } if (item->isEquipment()) outfitWindow->setItemSelected(item->getId()); } |