summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tilereg.cc
diff options
context:
space:
mode:
authorennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-12 03:48:04 +0000
committerennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-12 03:48:04 +0000
commit6a0126ebddcf725bed77958aff805739a97ea25f (patch)
tree3f31bab95d1702aa49309f6844f501883b47441a /crawl-ref/source/tilereg.cc
parentd2e316cecd419dc317a1b502ae6733d168fcf083 (diff)
downloadcrawl-ref-6a0126ebddcf725bed77958aff805739a97ea25f.tar.gz
crawl-ref-6a0126ebddcf725bed77958aff805739a97ea25f.zip
[2499489] Allowing mouse clicks for picking up items and for --more-- prompts.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8421 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/tilereg.cc')
-rw-r--r--crawl-ref/source/tilereg.cc21
1 files changed, 14 insertions, 7 deletions
diff --git a/crawl-ref/source/tilereg.cc b/crawl-ref/source/tilereg.cc
index 4291b18a74..a7e6172483 100644
--- a/crawl-ref/source/tilereg.cc
+++ b/crawl-ref/source/tilereg.cc
@@ -816,19 +816,27 @@ int DungeonRegion::handle_mouse(MouseEvent &event)
{
tiles.clear_text_tags(TAG_CELL_DESC);
+ if (!inside(event.px, event.py))
+ return 0;
+
if (mouse_control::current_mode() == MOUSE_MODE_NORMAL
|| mouse_control::current_mode() == MOUSE_MODE_MACRO
|| mouse_control::current_mode() == MOUSE_MODE_MORE)
{
- return 0;
+ if (event.event == MouseEvent::PRESS
+ && event.button == MouseEvent::LEFT)
+ {
+ return CK_MOUSE_CLICK;
+ }
+ else
+ {
+ return 0;
+ }
}
int cx;
int cy;
- if (!inside(event.px, event.py))
- return 0;
-
bool on_map = mouse_pos(event.px, event.py, cx, cy);
const coord_def gc(cx + m_cx_to_gx, cy + m_cy_to_gy);
@@ -2206,15 +2214,14 @@ int MessageRegion::handle_mouse(MouseEvent &event)
// TODO enne - mouse scrolling here should mouse scroll up through
// the message history in the message pane, without going to the CRT.
- if (mouse_control::current_mode() != MOUSE_MODE_COMMAND)
- return 0;
-
if (!inside(event.px, event.py))
return 0;
if (event.event != MouseEvent::PRESS || event.button != MouseEvent::LEFT)
return 0;
+ if (mouse_control::current_mode() != MOUSE_MODE_COMMAND)
+ return CK_MOUSE_CLICK;
return CONTROL('P');
}