summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/menu.cc
diff options
context:
space:
mode:
authorRaphael Langella <raphael.langella@gmail.com>2012-10-08 15:17:50 +0200
committerRaphael Langella <raphael.langella@gmail.com>2012-10-08 18:11:11 +0200
commit4fa33068a4e812ae36422af806e84416bd92b421 (patch)
treeb7fa7c7a4c31deb2194cf4e3e85a5badd85c21c1 /crawl-ref/source/menu.cc
parent9966aa71c571ff24f06802f12a3ac15ca45d7333 (diff)
downloadcrawl-ref-4fa33068a4e812ae36422af806e84416bd92b421.tar.gz
crawl-ref-4fa33068a4e812ae36422af806e84416bd92b421.zip
Skill menu: map shift-click and right-click to single select.
Does the same as shift-letter.
Diffstat (limited to 'crawl-ref/source/menu.cc')
-rw-r--r--crawl-ref/source/menu.cc15
1 files changed, 4 insertions, 11 deletions
diff --git a/crawl-ref/source/menu.cc b/crawl-ref/source/menu.cc
index 6e15ef7e16..7b013e39a5 100644
--- a/crawl-ref/source/menu.cc
+++ b/crawl-ref/source/menu.cc
@@ -3372,11 +3372,12 @@ MenuObject::InputReturnValue MenuFreeform::handle_mouse(const MouseEvent& me)
return INPUT_NO_ACTION;
}
- MenuItem* find_item = NULL;
+ MenuItem* find_item = _find_item_by_mouse_coords(coord_def(me.px, me.py));
- if (me.event == MouseEvent::MOVE)
+ if (find_item && find_item->handle_mouse(me))
+ return MenuObject::INPUT_SELECTED; // The object handled the event
+ else if (me.event == MouseEvent::MOVE)
{
- find_item = _find_item_by_mouse_coords(coord_def(me.px, me.py));
if (find_item == NULL)
{
if (m_active_item != NULL)
@@ -3397,8 +3398,6 @@ MenuObject::InputReturnValue MenuFreeform::handle_mouse(const MouseEvent& me)
}
if (me.event == MouseEvent::PRESS && me.button == MouseEvent::LEFT)
{
- find_item = _find_item_by_mouse_coords(coord_def(me.px,
- me.py));
if (find_item != NULL)
{
select_item(find_item);
@@ -3408,12 +3407,6 @@ MenuObject::InputReturnValue MenuFreeform::handle_mouse(const MouseEvent& me)
return MenuObject::INPUT_DESELECTED;
}
}
- if (me.event == MouseEvent::PRESS && me.button == MouseEvent::LEFT)
- {
- // TODO
- // pass mouse press event to objects, in case we pressed
- // down on top of an item with such action
- }
// all the other Mouse Events are uninteresting and are ignored
return INPUT_NO_ACTION;
}