From feb0e449b8b1d1d5da3a8150d29a857e7d3c1165 Mon Sep 17 00:00:00 2001 From: Matthew Cline Date: Wed, 18 Nov 2009 23:59:46 -0800 Subject: tiles: spell cast tip, no walk with mod-keys Add in the "Ctrl-L-Click" tip for casting spells. Don't walk if you shift/ctrl/alt-click a monster or cell, since that likely happened because you were trying to fire/cast/evoke when you didn't have anything appropriate. --- crawl-ref/source/tilereg.cc | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'crawl-ref/source/tilereg.cc') diff --git a/crawl-ref/source/tilereg.cc b/crawl-ref/source/tilereg.cc index 2e19c06e85..30767d268a 100644 --- a/crawl-ref/source/tilereg.cc +++ b/crawl-ref/source/tilereg.cc @@ -1615,6 +1615,11 @@ int DungeonRegion::handle_mouse(MouseEvent &event) return (CK_MOUSE_CMD); } + // Don't move if we've tried to fire/cast/evoke when there's nothing + // available. + if (event.mod & (MOD_SHIFT | MOD_CTRL | MOD_ALT)) + return (CK_MOUSE_CMD); + return _click_travel(gc, event); } @@ -1776,12 +1781,23 @@ bool DungeonRegion::update_tip_text(std::string& tip) } const actor* target = actor_at(m_cursor[CURSOR_MOUSE]); - if (target && you.can_see(target) - && _have_appropriate_evokable(target)) + if (target && you.can_see(target)) { - if (m_cursor[CURSOR_MOUSE] == you.pos()) - tip += "\n"; - tip += "[Alt-L-Click] Wand\n"; + std::string str = ""; + + if (_have_appropriate_spell(target)) + str += "[Ctrl-L-Click] Cast spell\n"; + + if (_have_appropriate_evokable(target)) + str += "[Alt-L-Click] Zap wand\n"; + + if (!str.empty()) + { + if (m_cursor[CURSOR_MOUSE] == you.pos()) + tip += "\n"; + + tip += str; + } } if (m_cursor[CURSOR_MOUSE] != you.pos()) -- cgit v1.2.3-54-g00ecf