From 1a6236d61bcee1288e94595c4217920b339445b4 Mon Sep 17 00:00:00 2001 From: haranp Date: Sun, 7 Jan 2007 22:00:13 +0000 Subject: Implemented some of David's ideas: Improved the help browser somewhat and added some hotkeys. The 'm' screen now lets you see your aptitudes with '!' (if you're allowed to know them, that is.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@798 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/menu.cc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'crawl-ref/source/menu.cc') diff --git a/crawl-ref/source/menu.cc b/crawl-ref/source/menu.cc index 2f417f5179..28e5973ef8 100644 --- a/crawl-ref/source/menu.cc +++ b/crawl-ref/source/menu.cc @@ -1317,16 +1317,22 @@ void formatted_scroller::add_text(const std::string& s) } } -void formatted_scroller::add_item_formatted_string(const formatted_string& fs) +void formatted_scroller::add_item_formatted_string(const formatted_string& fs, + int hotkey) { MenuEntry* me = new MenuEntry; me->data = new formatted_string(fs); + if ( hotkey ) + me->add_hotkey(hotkey); add_entry(me); } -void formatted_scroller::add_item_string(const std::string& s) +void formatted_scroller::add_item_string(const std::string& s, int hotkey) { - add_entry( new MenuEntry(s) ); + MenuEntry* me = new MenuEntry(s); + if ( hotkey ) + me->add_hotkey(hotkey); + add_entry(me); } void formatted_scroller::draw_index_item(int index, const MenuEntry *me) const @@ -1419,6 +1425,7 @@ bool formatted_scroller::process_key( int keyin ) { case 0: return true; + case -1: case CK_ESCAPE: return false; case ' ': case '+': case '=': case CK_PGDN: case '>': case '\'': -- cgit v1.2.3-54-g00ecf