summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/output.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-23 17:33:20 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-23 17:33:20 +0000
commitfaed135e4f21ba80b74be7aab83d34cfabcf2efc (patch)
tree898823eda0ded041a19a42151618d136ad4b58aa /crawl-ref/source/output.cc
parent68631458c7c936fb0fed22b87feb888fc3ee5d75 (diff)
downloadcrawl-ref-faed135e4f21ba80b74be7aab83d34cfabcf2efc.tar.gz
crawl-ref-faed135e4f21ba80b74be7aab83d34cfabcf2efc.zip
Implement 2022051: Skip hjklyubn (well, currently only bhjkl) when
targetting via monster list, so you can both directly target a monster and manually move your cursor. Has the side-effect of reallowing direct selection of monsters via 'x'. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6641 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/output.cc')
-rw-r--r--crawl-ref/source/output.cc20
1 files changed, 19 insertions, 1 deletions
diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc
index 0c7e129b14..30ab854b2e 100644
--- a/crawl-ref/source/output.cc
+++ b/crawl-ref/source/output.cc
@@ -1344,6 +1344,24 @@ void monster_pane_info::to_string( int count, std::string& desc,
desc = out.str();
}
+static char _mlist_index_to_letter(int index)
+{
+ index += 'a';
+
+ if (index >= 'b')
+ index++;
+ if (index >= 'h')
+ index++;
+ if (index >= 'j')
+ index++;
+ if (index >= 'k')
+ index++;
+ if (index >= 'l')
+ index++;
+
+ return (index);
+}
+
static void _print_next_monster_desc(const std::vector<monster_pane_info>& mons,
int& start, bool zombified = false,
int idx = -1)
@@ -1366,7 +1384,7 @@ static void _print_next_monster_desc(const std::vector<monster_pane_info>& mons,
if (idx >= 0)
{
textcolor(WHITE);
- cprintf( stringize_glyph('a' + idx).c_str() );
+ cprintf( stringize_glyph(_mlist_index_to_letter(idx)).c_str() );
cprintf(" - ");
printed += 4;
}