diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-01-07 22:00:13 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-01-07 22:00:13 +0000 |
commit | 1a6236d61bcee1288e94595c4217920b339445b4 (patch) | |
tree | d8f3c6b9c639f098f73cbf5a8eacc81a16a3fe84 /crawl-ref/source/menu.cc | |
parent | 84e73a2e1530424121ee0f54b58aa44657aaef30 (diff) | |
download | crawl-ref-1a6236d61bcee1288e94595c4217920b339445b4.tar.gz crawl-ref-1a6236d61bcee1288e94595c4217920b339445b4.zip |
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
Diffstat (limited to 'crawl-ref/source/menu.cc')
-rw-r--r-- | crawl-ref/source/menu.cc | 13 |
1 files changed, 10 insertions, 3 deletions
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 '\'': |