diff options
author | Pekka Lampila <pekka.lampila@iki.fi> | 2013-06-07 07:23:27 +0300 |
---|---|---|
committer | Neil Moore <neil@s-z.org> | 2013-06-07 01:59:51 -0400 |
commit | f35a63b0d44ae5deaa2ab246b614d31e08343d02 (patch) | |
tree | 8e5fbf432db56ef54eda4c42625bdbee571f95ce /crawl-ref/source/stash.cc | |
parent | 0edb3d0cfcadf004b65ba9f222c9f787fc04e1f2 (diff) | |
download | crawl-ref-f35a63b0d44ae5deaa2ab246b614d31e08343d02.tar.gz crawl-ref-f35a63b0d44ae5deaa2ab246b614d31e08343d02.zip |
Improve handling of menu titles in WebTiles
Diffstat (limited to 'crawl-ref/source/stash.cc')
-rw-r--r-- | crawl-ref/source/stash.cc | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/crawl-ref/source/stash.cc b/crawl-ref/source/stash.cc index 9444235f88..8b2e5402b7 100644 --- a/crawl-ref/source/stash.cc +++ b/crawl-ref/source/stash.cc @@ -460,20 +460,20 @@ void StashMenu::draw_title() if (title) { cgotoxy(1, 1); - textcolor(title->colour); - cprintf("%s", title->text.c_str()); + formatted_string fs = formatted_string(title->colour); + fs.cprintf("%s", title->text.c_str()); if (title->quantity) { - cprintf(", %d item%s", title->quantity, - title->quantity == 1? "" : "s"); + fs.cprintf(", %d item%s", title->quantity, + title->quantity == 1? "" : "s"); } - cprintf(")"); + fs.cprintf(")"); if (action_cycle == Menu::CYCLE_TOGGLE) { - cprintf(" [a-z: %s ?/!: %s]", - menu_action == ACT_EXAMINE ? "examine" : "shopping", - menu_action == ACT_EXAMINE ? "shopping" : "examine"); + fs.cprintf(" [a-z: %s ?/!: %s]", + menu_action == ACT_EXAMINE ? "examine" : "shopping", + menu_action == ACT_EXAMINE ? "shopping" : "examine"); } if (can_travel) @@ -488,8 +488,13 @@ void StashMenu::draw_title() flags |= MF_ALWAYS_SHOW_MORE; } else - cprintf(" [ENTER: travel]"); + fs.cprintf(" [ENTER: travel]"); } + fs.display(); + +#ifdef USE_TILE_WEB + webtiles_set_title(fs); +#endif } } @@ -1865,11 +1870,16 @@ void StashSearchMenu::draw_title() if (title) { cgotoxy(1, 1); - textcolor(title->colour); - cprintf("%d %s%s, %s %s", + formatted_string fs = formatted_string(title->colour); + fs.cprintf("%d %s%s, %s %s", title->quantity, title->text.c_str(), title->quantity > 1? "es" : "", stack_style, sort_style); + fs.display(); + +#ifdef USE_TILE_WEB + webtiles_set_title(fs); +#endif draw_title_suffix(formatted_string::parse_string(make_stringf( "<lightgrey> [<w>a-z</w>: %s" |