From 725e6975fd33e7e0c164bf757778d3b3cc867f34 Mon Sep 17 00:00:00 2001 From: haranp Date: Tue, 13 Mar 2007 21:10:05 +0000 Subject: Requesting help when choosing race/class jumps you to the appropriate section of the manual. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1034 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/menu.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'crawl-ref/source/menu.cc') diff --git a/crawl-ref/source/menu.cc b/crawl-ref/source/menu.cc index 8b312c7878..49f4f52e84 100644 --- a/crawl-ref/source/menu.cc +++ b/crawl-ref/source/menu.cc @@ -1226,6 +1226,15 @@ bool formatted_scroller::line_up() return false; } +bool formatted_scroller::jump_to_hotkey( int keyin ) +{ + for ( unsigned int i = 0; i < items.size(); ++i ) + if ( items[i]->is_hotkey(keyin) ) + return jump_to(i); + return false; +} + + bool formatted_scroller::process_key( int keyin ) { @@ -1264,16 +1273,7 @@ bool formatted_scroller::process_key( int keyin ) break; } default: - // look for it as a hotkey - for ( unsigned int i = 0; i < items.size(); ++i ) - { - // found it - if ( items[i]->is_hotkey(keyin) ) - { - repaint = jump_to(i); - break; - } - } + repaint = jump_to_hotkey(keyin); break; } -- cgit v1.2.3-54-g00ecf