From d3267f81ac036a51bbf3ee83574df1cbca0eaa85 Mon Sep 17 00:00:00 2001 From: Erik Schilling Date: Sat, 11 Feb 2012 23:11:07 +0100 Subject: Made items equippable by double click in inventory + Fixed disabling of use button when possible Reviewed-by: bjorn. --- src/gui/inventorywindow.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/gui') 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) -- cgit v1.2.3-70-g09d2