summaryrefslogtreecommitdiff
path: root/src/gui/inventorywindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/inventorywindow.cpp')
-rw-r--r--src/gui/inventorywindow.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp
index 6a897700..54215ffc 100644
--- a/src/gui/inventorywindow.cpp
+++ b/src/gui/inventorywindow.cpp
@@ -21,6 +21,7 @@
#include "gui/inventorywindow.h"
+#include "client.h"
#include "inventory.h"
#include "item.h"
#include "units.h"
@@ -240,10 +241,17 @@ void InventoryWindow::mouseClicked(gcn::MouseEvent &event)
{
Window::mouseClicked(event);
- if (event.getButton() == gcn::MouseEvent::RIGHT)
+ Item *item = mItems->getSelectedItem();
+
+ if (event.getSource() == mItems && item && isDoubleClick((int)item))
{
- Item *item = mItems->getSelectedItem();
+ if (isMainInventory() && item->getInfo().getActivatable())
+ action(gcn::ActionEvent(mUseButton, mUseButton->getActionEventId()));
+ }
+
+ if (event.getButton() == gcn::MouseEvent::RIGHT)
+ {
if (!item)
return;