From 1423a327908fda94b78dd76b17516ec8f40742d5 Mon Sep 17 00:00:00 2001 From: haranp Date: Fri, 9 Mar 2007 14:17:10 +0000 Subject: Changed around the help screen a bit, following David's ideas. Appendix hotkeys now work. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1005 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/command.cc | 55 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 46 insertions(+), 9 deletions(-) (limited to 'crawl-ref/source/command.cc') diff --git a/crawl-ref/source/command.cc b/crawl-ref/source/command.cc index fd38e95970..5c5dd851d7 100644 --- a/crawl-ref/source/command.cc +++ b/crawl-ref/source/command.cc @@ -642,7 +642,14 @@ static void add_file_to_scroller(FILE* fp, formatted_scroller& m, MenuEntry* me = new MenuEntry(buf); if ((next_is_hotkey && isupper(buf[0])) || (is_first && first_hotkey)) { - me->add_hotkey(is_first ? first_hotkey : tolower(buf[0])); + int hotkey = is_first ? first_hotkey : tolower(buf[0]); + if ( !is_first && buf[0] == 'X' && + strlen(buf) >= 3 && isdigit(buf[2]) ) + { + // X.# is hotkeyed to the # + hotkey = buf[2]; + } + me->add_hotkey(hotkey); me->level = MEL_SUBTITLE; me->colour = WHITE; } @@ -668,6 +675,7 @@ help_file help_files[] = { { "tables.txt", '%', false }, { "readme.txt", '^', false }, { "crawl_macros.txt", '~', false }, + { "crawl_options.txt", '!', false }, { NULL, 0, false } }; @@ -700,22 +708,49 @@ static void show_keyhelp_menu(const std::vector &lines, if ( with_manual ) { cmd_help.f_keyfilter = keyhelp_keyfilter; - column_composer cols(1); + column_composer cols(2, 40); cols.add_formatted( 0, "Dungeon Crawl Help\n" "\n" - "Press one of the following keys to obtain more information on a certain\n" + "Press one of the following keys to\n" + "obtain more information on a certain\n" "aspect of Dungeon Crawl.\n" - "?: Key Help Screens\n" - "*: Read the manual\n" + "?: List of keys\n" "^: Quickstart Guide\n" - ":: Browse Notes\n" + ":: Browse character notes\n" "~: Macros help\n" - "%: Table of Aptitudes\n", + "!: Options help\n" + "%: Table of aptitudes\n" + "Home: This screen\n", + true, true, cmdhelp_textfilter); + + cols.add_formatted( + 1, + "Manual Contents\n\n" + "* Table of contents\n" + "A. Overview\n" + "B. Starting Screen\n" + "C. Abilities and Stats\n" + "D. Dungeon Exploration\n" + "E. Experience and Skills\n" + "F. Monsters\n" + "G. Items\n" + "H. Spellcasting\n" + "I. Religion\n" + "J. Mutations\n" + "K. Keymaps, Macros, Options\n" + "L. Licence, Contact, History\n" + "M. Philosophy\n" + "1. List of Species\n" + "2. List of Classes\n" + "3. List of Skills\n" + "4. Keys and Commands\n" + "5. List of Enchantments\n", true, true, cmdhelp_textfilter); + std::vector blines = cols.formatted_lines(); unsigned i; for (i = 0; i < blines.size(); ++i ) @@ -723,6 +758,8 @@ static void show_keyhelp_menu(const std::vector &lines, while ( static_cast(++i) < get_number_of_lines() ) cmd_help.add_item_string(""); + // unscrollable + cmd_help.add_entry(new MenuEntry(std::string(), MEL_TITLE)); } for (unsigned i = 0; i < lines.size(); ++i ) @@ -732,9 +769,9 @@ static void show_keyhelp_menu(const std::vector &lines, { for ( int i = 0; help_files[i].name != NULL; ++i ) { + // attempt to open this file, skip it if unsuccessful FILE* fp = - fopen( - datafile_path(help_files[i].name, false).c_str(), "r"); + fopen(datafile_path(help_files[i].name, false).c_str(), "r"); if ( !fp ) continue; -- cgit v1.2.3-54-g00ecf