diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-01 07:14:50 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-01 07:14:50 +0000 |
commit | f090b4c11c5dbfe108933d6a6507cd9c3e697f4e (patch) | |
tree | 3aa86f4285605b8a95da265f778a5c7c7004b134 /crawl-ref/source/command.cc | |
parent | 3ba8bc84d018da1452880ac897a433ca7752ebb5 (diff) | |
download | crawl-ref-f090b4c11c5dbfe108933d6a6507cd9c3e697f4e.tar.gz crawl-ref-f090b4c11c5dbfe108933d6a6507cd9c3e697f4e.zip |
Bug 2006559: don't include quotes about in a monster's description if it
won't fit on the screen.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6282 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/command.cc')
-rw-r--r-- | crawl-ref/source/command.cc | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/crawl-ref/source/command.cc b/crawl-ref/source/command.cc index aab6f71042..30651524f8 100644 --- a/crawl-ref/source/command.cc +++ b/crawl-ref/source/command.cc @@ -1092,6 +1092,9 @@ static void _recap_feat_keys(std::vector<std::string> &keys) static bool _do_description(std::string key, std::string footer = "") { std::string desc = getLongDescription(key); + + std::string prefix, suffix; + int width = get_number_of_cols(); if (width > 80) width = 80; @@ -1155,33 +1158,19 @@ static bool _do_description(std::string key, std::string footer = "") std::string symbol_prefix = "__"; symbol_prefix += symbol; symbol_prefix += "_prefix"; - desc = getLongDescription(symbol_prefix) + desc; + prefix = getLongDescription(symbol_prefix); std::string symbol_suffix = "__"; symbol_suffix += symbol; symbol_suffix += "_suffix"; - desc += getLongDescription(symbol_suffix); - desc += getLongDescription(symbol_suffix + "_lookup"); + suffix += getLongDescription(symbol_suffix); + suffix += getLongDescription(symbol_suffix + "_lookup"); } } - key = uppercase_first(key); - key += "$$"; - clrscr(); - print_description(key + desc); - - if (!footer.empty()) - { - int num_lines = linebreak_string2(footer, width); - num_lines++; - - // So the footer doesn't get lonely on large displays. :) - const int bottom_line = std::min(30, get_number_of_lines()); - - cgotoxy(1, bottom_line - num_lines); - - cprintf(footer.c_str()); - } + key = uppercase_first(key); + linebreak_string2(footer, width - 1); + print_description(desc, key, suffix, prefix, footer); return (true); } |