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 +++++++++-- src/resources/itemdb.cpp | 1 + 2 files changed, 10 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) diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp index 95fdae2f..4db7b085 100644 --- a/src/resources/itemdb.cpp +++ b/src/resources/itemdb.cpp @@ -355,6 +355,7 @@ void TaItemDB::load() // Everything not unusable or usable is equippable by the Ta type system. itemInfo->mEquippable = itemInfo->mType != ITEM_UNUSABLE && itemInfo->mType != ITEM_USABLE; + itemInfo->mActivatable = itemInfo->mType == ITEM_USABLE; // Load nano description std::vector effect; -- cgit v1.2.3-60-g2f50