diff options
author | Erik Schilling <ablu.erikschilling@googlemail.com> | 2012-02-11 23:11:07 +0100 |
---|---|---|
committer | Erik Schilling <ablu.erikschilling@googlemail.com> | 2012-02-11 23:22:34 +0100 |
commit | d3267f81ac036a51bbf3ee83574df1cbca0eaa85 (patch) | |
tree | b0ff5b2a5b49f69aa09203f272f18a9d76fb9b95 /src | |
parent | d27f25a3a142e59d83c5e4f14399b08eee0ec361 (diff) | |
download | mana-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')
-rw-r--r-- | src/gui/inventorywindow.cpp | 11 | ||||
-rw-r--r-- | 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<std::string> effect; |