From 5006c1e3f3d193c18cd2bf76a50163fbab1b8052 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Sun, 13 Jul 2008 19:38:46 +0000 Subject: Fix 2017251: The annotation prompt not escaping properly. Fix 2016627: Ranged weapons of protection autoIDing when wielded by monsters. Fix the double prompt when using Ctrl-P in the quivering interface (part of BR 2017260), fix targetting via monster list to be turned off if there are no monsters in sight, and map auto-travel to both G and Ctrl-G. (The monster list command moves to V.) Again, I'm not sure I got all the relevant documentation. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6529 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/output.cc | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'crawl-ref/source/output.cc') diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc index cc48f273a0..a162edfcfc 100644 --- a/crawl-ref/source/output.cc +++ b/crawl-ref/source/output.cc @@ -1477,16 +1477,21 @@ void get_monster_pane_info(std::vector& mons) } #define BOTTOM_JUSTIFY_MONSTER_LIST 0 -bool update_monster_pane() +// Returns -1 if the monster list is empty, 0 if there are so many monsters +// they have to be consolidated, and 1 otherwise. +int update_monster_pane() { const int max_print = crawl_view.mlistsz.y; textbackground(BLACK); if (max_print <= 0) - return (false); + return (-1); std::vector mons; get_monster_pane_info(mons); + if (mons.empty()) + return (-1); + std::sort(mons.begin(), mons.end(), monster_pane_info::less_than); // Count how many groups of monsters there are @@ -1495,10 +1500,10 @@ bool update_monster_pane() if (!monster_pane_info::less_than(mons[i-1], mons[i])) --lines_needed; - bool zombified = true; + bool full_info = true; if (lines_needed > (unsigned int) max_print) { - zombified = false; + full_info = false; // Use type names rather than full names ("small zombie" vs // "rat zombie") in order to take up less lines. @@ -1527,7 +1532,7 @@ bool update_monster_pane() // i_mons is incremented by _print_next_monster_desc if (i_print >= skip_lines && i_mons < (int) mons.size()) { - _print_next_monster_desc(mons, i_mons, zombified, + _print_next_monster_desc(mons, i_mons, full_info, Options.mlist_targetting == MLIST_TARGET_ON ? i_print : -1); } @@ -1542,11 +1547,11 @@ bool update_monster_pane() cprintf(" ... "); } - return zombified; + return full_info; } #else // FIXME: Implement this for Tiles! -bool update_monster_pane() +int update_monster_pane() { return (false); } -- cgit v1.2.3-54-g00ecf