diff options
author | ennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-02-12 05:05:43 +0000 |
---|---|---|
committer | ennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-02-12 05:05:43 +0000 |
commit | 76a5cc5049290770249b6661a2f4558b7fbb645e (patch) | |
tree | fa2131d2cef62d963d3c6c821c3ca230b541260f /crawl-ref/source/directn.cc | |
parent | aa6dd78dceb8d09547021cd319aaaef053df1f4f (diff) | |
download | crawl-ref-76a5cc5049290770249b6661a2f4558b7fbb645e.tar.gz crawl-ref-76a5cc5049290770249b6661a2f4558b7fbb645e.zip |
Mousing over monsters, items, and features will now show their description in the message window. This inadvertantly fixes [2469950], where some lines would appear off screen.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9030 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/directn.cc')
-rw-r--r-- | crawl-ref/source/directn.cc | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc index 3bfc704e25..4ba3d94528 100644 --- a/crawl-ref/source/directn.cc +++ b/crawl-ref/source/directn.cc @@ -1658,8 +1658,38 @@ void terse_describe_square(const coord_def &c, bool in_range) _describe_cell(c, in_range); } +void get_square_desc(const coord_def &c, describe_info &inf) +{ + // NOTE: Keep this function in sync with full_describe_square. + + // Don't give out information for things outside LOS + if (!see_grid(c.x, c.y)) + return; + + const int mid = mgrd(c); + const int oid = igrd(c); + + if (mid != NON_MONSTER && player_monster_visible(&menv[mid])) + { + // First priority: monsters. + get_monster_desc(menv[mid], inf); + } + else if (oid != NON_ITEM) + { + // Second priority: objects. + get_item_desc(mitm[oid], inf); + } + else + { + // Third priority: features. + get_feature_desc(c, inf); + } +} + void full_describe_square(const coord_def &c) { + // NOTE: Keep this function in sync with get_square_desc. + // Don't give out information for things outside LOS if (!see_grid(c.x, c.y)) return; |