summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Moore <neil@s-z.org>2014-08-05 10:22:19 -0400
committerNeil Moore <neil@s-z.org>2014-08-05 10:22:20 -0400
commit4841e6f1746505fdd15530e72e3ce314577647f1 (patch)
tree0021c398c8b2c48bfbb03add2e848282c7ea480d
parent063fcaf40b3c530355450bff6af4b83cb473af5f (diff)
downloadcrawl-ref-4841e6f1746505fdd15530e72e3ce314577647f1.tar.gz
crawl-ref-4841e6f1746505fdd15530e72e3ce314577647f1.zip
Shorten memorization help when necessary (#3244)
If we have both hard books and racially unmemorisable spells, shorten the text for both (and for the spell level count) so that we don't push the "Toggle display with '!'" text off the screen.
-rw-r--r--crawl-ref/source/spl-book.cc15
1 files changed, 10 insertions, 5 deletions
diff --git a/crawl-ref/source/spl-book.cc b/crawl-ref/source/spl-book.cc
index 05030611a4..d55b367790 100644
--- a/crawl-ref/source/spl-book.cc
+++ b/crawl-ref/source/spl-book.cc
@@ -977,26 +977,31 @@ static spell_type _choose_mem_spell(spell_list &spells,
spell_menu.action_cycle = Menu::CYCLE_TOGGLE;
spell_menu.menu_action = Menu::ACT_EXECUTE;
- string more_str = make_stringf("<lightgreen>%d spell level%s left"
+ const bool shortmsg = num_unreadable > 0 && num_race > 0;
+ string more_str = make_stringf("<lightgreen>%d %slevel%s left"
"<lightgreen>",
player_spell_levels(),
+ shortmsg ? "" : "spell ",
(player_spell_levels() > 1
|| player_spell_levels() == 0) ? "s" : "");
if (num_unreadable > 0)
{
- more_str += make_stringf(", <lightmagenta>%u overly difficult "
- "spellbook%s</lightmagenta>",
+ more_str += make_stringf(", <lightmagenta>%u %sbook%s</lightmagenta>",
num_unreadable,
+ shortmsg ? "difficult "
+ : "overly difficult spell",
num_unreadable > 1 ? "s" : "");
}
if (num_race > 0)
{
- more_str += make_stringf(", <lightred>%u spell%s unmemorisable"
+ more_str += make_stringf(", <lightred>%u%s%s unmemorisable"
"</lightred>",
num_race,
- num_race > 1 ? "s" : "");
+ shortmsg ? "" : " spell",
+ // shorter message if we have both annotations
+ !shortmsg && num_race > 1 ? "s" : "");
}
#ifndef USE_TILE_LOCAL