diff options
author | BlackSheep <chris.terenzi@gmail.com> | 2013-08-26 13:18:51 -0400 |
---|---|---|
committer | Neil Moore <neil@s-z.org> | 2013-08-28 09:05:02 -0400 |
commit | 8398dde4d467a5b0407743a143e8d17889746f30 (patch) | |
tree | 84c5fcaff89e90ec32afb25552c8f9700231d47b /crawl-ref/source/stash.cc | |
parent | 2b775c0f2f683689d119861049562b87b5275b1b (diff) | |
download | crawl-ref-8398dde4d467a5b0407743a143e8d17889746f30.tar.gz crawl-ref-8398dde4d467a5b0407743a143e8d17889746f30.zip |
Variable width menu title for stash search results
Diffstat (limited to 'crawl-ref/source/stash.cc')
-rw-r--r-- | crawl-ref/source/stash.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/crawl-ref/source/stash.cc b/crawl-ref/source/stash.cc index c4a5201d23..399d4dc610 100644 --- a/crawl-ref/source/stash.cc +++ b/crawl-ref/source/stash.cc @@ -1875,8 +1875,15 @@ void StashSearchMenu::draw_title() { if (title) { + const unsigned avail_width = get_number_of_cols(); cgotoxy(1, 1); formatted_string fs = formatted_string(title->colour); + if (avail_width > 92) + { + fs.cprintf("%d %s%s, ", + title->quantity, title->text.c_str(), + title->quantity > 1 ? "es" : ""); + } fs.cprintf("%s %s %s", stack_style, sort_style, filtered); fs.display(); @@ -1889,9 +1896,10 @@ void StashSearchMenu::draw_title() " <w>?</w>/<w>!</w>: %s" " <w>-</w>:stacking" " <w>/</w>:sorting" - " <w>=</w>:filter]", + " <w>=</w>:filter%s]", menu_action == ACT_EXECUTE ? "go" : "view", - menu_action == ACT_EXECUTE ? "view" : "go")), false); + menu_action == ACT_EXECUTE ? "view" : "go", + avail_width > 100 ? " useless" : "")), false); } } |