From a37536cb8e61301d865bf8d909643bd4fca2f230 Mon Sep 17 00:00:00 2001 From: haranp Date: Thu, 8 Mar 2007 22:55:30 +0000 Subject: Confined help menu scrolling to within a file (David.) I'm iffy as to whether this really helps, but I'm putting it in for now. 1,000th commit... git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1000 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/command.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'crawl-ref/source/command.cc') diff --git a/crawl-ref/source/command.cc b/crawl-ref/source/command.cc index 771012383a..fd38e95970 100644 --- a/crawl-ref/source/command.cc +++ b/crawl-ref/source/command.cc @@ -629,6 +629,14 @@ static void add_file_to_scroller(FILE* fp, formatted_scroller& m, bool next_is_hotkey = false; bool is_first = true; char buf[200]; + + // bracket with MEL_TITLES, so that you won't scroll + // into it or above it + m.add_entry(new MenuEntry(std::string(), MEL_TITLE)); + for ( int i = 0; i < get_number_of_lines(); ++i ) + m.add_entry(new MenuEntry(std::string())); + m.add_entry(new MenuEntry(std::string(), MEL_TITLE)); + while (fgets(buf, sizeof buf, fp)) { MenuEntry* me = new MenuEntry(buf); -- cgit v1.2.3-54-g00ecf