summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorErik Schilling <ablu.erikschilling@googlemail.com>2012-02-11 23:11:07 +0100
committerErik Schilling <ablu.erikschilling@googlemail.com>2012-02-11 23:22:34 +0100
commitd3267f81ac036a51bbf3ee83574df1cbca0eaa85 (patch)
treeb0ff5b2a5b49f69aa09203f272f18a9d76fb9b95 /src/gui
parentd27f25a3a142e59d83c5e4f14399b08eee0ec361 (diff)
downloadmana-d3267f81ac036a51bbf3ee83574df1cbca0eaa85.tar.gz
mana-d3267f81ac036a51bbf3ee83574df1cbca0eaa85.tar.bz2
mana-d3267f81ac036a51bbf3ee83574df1cbca0eaa85.tar.xz
mana-d3267f81ac036a51bbf3ee83574df1cbca0eaa85.zip
Made items equippable by double click in inventory
+ Fixed disabling of use button when possible Reviewed-by: bjorn.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/inventorywindow.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp
index 9c8e860c..c6b93723 100644
--- a/src/gui/inventorywindow.cpp
+++ b/src/gui/inventorywindow.cpp
@@ -251,9 +251,16 @@ void InventoryWindow::mouseClicked(gcn::MouseEvent &event)
if (event.getSource() == mItems && item && isDoubleClick(item->getInvIndex()))
{
-
if (isMainInventory() && item->getInfo().getActivatable())
- action(gcn::ActionEvent(mUseButton, mUseButton->getActionEventId()));
+ {
+ action(gcn::ActionEvent(mUseButton,
+ mUseButton->getActionEventId()));
+ }
+ else if (isMainInventory() && item->getInfo().getEquippable())
+ {
+ action(gcn::ActionEvent(mEquipButton,
+ mEquipButton->getActionEventId()));
+ }
}
if (event.getButton() == gcn::MouseEvent::RIGHT)