summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2010-08-03 11:43:34 -0600
committerJared Adams <jaxad0127@gmail.com>2010-08-03 11:43:34 -0600
commit94f91a5fd9f3f609e93224fe71d2a3bcce1c0866 (patch)
tree3541e3e91bca871cfa5e4cf395d35957d8f7c5cf /src/gui
parent71ea8233334803a079ad24396ead02280a80d8d4 (diff)
parent98abc793f8fb45d647e1e8c51cf5f38170c6b703 (diff)
downloadMana-94f91a5fd9f3f609e93224fe71d2a3bcce1c0866.tar.gz
Mana-94f91a5fd9f3f609e93224fe71d2a3bcce1c0866.tar.bz2
Mana-94f91a5fd9f3f609e93224fe71d2a3bcce1c0866.tar.xz
Mana-94f91a5fd9f3f609e93224fe71d2a3bcce1c0866.zip
Merge remote branch 'origin/1.0'
Conflicts: src/net/tmwa/chathandler.cpp
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/widgets/itemcontainer.cpp40
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());
}