From b02081c00450d274c23b7198620ee7748756bd72 Mon Sep 17 00:00:00 2001 From: Angelo Castellani Date: Sun, 22 May 2011 19:07:41 -0400 Subject: Added more double clickable actions - double clicking a do_choice item submits it - double clicking the npc chat will hit 'next' - double click to buy/sell a single item - clicking on no item in the inventory now deselects - double click to use/activate items in inventory --- src/gui/widgets/itemcontainer.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/gui/widgets/itemcontainer.cpp') diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp index 0967055b..2cd0fa23 100644 --- a/src/gui/widgets/itemcontainer.cpp +++ b/src/gui/widgets/itemcontainer.cpp @@ -278,12 +278,19 @@ void ItemContainer::mousePressed(gcn::MouseEvent &event) { const int index = getSlotIndex(event.getX(), event.getY()); if (index == Inventory::NO_SLOT_INDEX) + { + mSelectionStatus = SEL_DESELECTING; return; + } Item *item = getItemAt(index); if (!item) + { + mSelectionStatus = SEL_DESELECTING; return; + } + // put item name into chat window if (mDescItems) @@ -293,7 +300,6 @@ void ItemContainer::mousePressed(gcn::MouseEvent &event) if (mSelectedIndex == index) { - mSelectionStatus = SEL_DESELECTING; } else if (item && item->getId()) { -- cgit v1.2.3-70-g09d2