From 6a0126ebddcf725bed77958aff805739a97ea25f Mon Sep 17 00:00:00 2001 From: ennewalker Date: Mon, 12 Jan 2009 03:48:04 +0000 Subject: [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 --- crawl-ref/source/tilereg.cc | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'crawl-ref/source/tilereg.cc') 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'); } -- cgit v1.2.3-54-g00ecf