summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/menu.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-03-13 21:10:05 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-03-13 21:10:05 +0000
commit725e6975fd33e7e0c164bf757778d3b3cc867f34 (patch)
tree19cc9442f128a7af03697ede44fff9415bf28a57 /crawl-ref/source/menu.cc
parent6d6703ddc09ee848464bdcbb4ae69cbfcda70993 (diff)
downloadcrawl-ref-725e6975fd33e7e0c164bf757778d3b3cc867f34.tar.gz
crawl-ref-725e6975fd33e7e0c164bf757778d3b3cc867f34.zip
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
Diffstat (limited to 'crawl-ref/source/menu.cc')
-rw-r--r--crawl-ref/source/menu.cc20
1 files changed, 10 insertions, 10 deletions
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;
}