From f3591ea07d2f33ff248bddb28908ecd5f40d6372 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Wed, 3 Aug 2022 14:07:17 +0300 Subject: [PATCH] User-friendly options menu Make the default options menu only show the most important options, split into categories. The full, traditional menu can be accessed by using the m-prefix. --- doc/Guidebook.mn | 2 + doc/Guidebook.tex | 2 + doc/fixes3-7-0.txt | 1 + include/optlist.h | 459 +++++++++++++++++++++++---------------------- src/cmd.c | 2 +- src/options.c | 156 ++++++++++++++- 6 files changed, 388 insertions(+), 234 deletions(-) diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index 163564368..832c2484c 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -868,6 +868,7 @@ The available options are listed later in this Guidebook. Options are usually set before the game rather than with the \(oqO\(cq command; see the section on options below. +Precede \(oqO\(cq with the \(oqm\(cq prefix to show advanced options. .lp \(haO Show overview. .lp "" @@ -1384,6 +1385,7 @@ Default key is \(oqo\(cq. .lp "#options " Show and change option settings. Default key is \(oqO\(cq. +Precede with the \(oqm\(cq prefix to show advanced options. .lp #overview Display information you've discovered about the dungeon. Any visited diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index 177fb69a5..b107d6bf3 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -962,6 +962,7 @@ a further menu or prompt will appear once you've closed this menu. The available options are listed later in this Guidebook. Options are usually set before the game rather than with the `{\tt O}' command; see the section on options below. +Precede {\tt O} with the {\tt m} prefix to show advanced options. %.lp \item[\tb{\^{}O}] Show overview.\\ @@ -1494,6 +1495,7 @@ Open a door. Default key is `{\tt o}'. %.lp \item[\tb{\#options}] Show and change option settings. Default key is `{\tt O}'. +Precede with the {\tt m} prefix to show advanced options. %.lp \item[\tb{\#overview}] Display information you've discovered about the dungeon. Any visited diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index b25261f1b..01ddfb0df 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -1763,6 +1763,7 @@ add wizard mode #wizkill command to remove monster(s) from play some quest nemeses release a cloud of poisonous gas when they die taming magic acting on an already tame creature might make it become tamer eliminate scimitar skill and have scimitars use saber skill +simplified configuration options menu Platform- and/or Interface-Specific New Features diff --git a/include/optlist.h b/include/optlist.h index 38125b65f..18d59f645 100644 --- a/include/optlist.h +++ b/include/optlist.h @@ -16,9 +16,12 @@ static int optfn_boolean(int, int, boolean, char *, char *); enum OptType {BoolOpt, CompOpt, OthrOpt}; enum Y_N {No, Yes}; enum Off_On {Off, On}; +/* Advanced options are only shown in the full, traditional options menu */ +enum OptSection {OptS_General, OptS_Behavior, OptS_Map, OptS_Status, OptS_Advanced}; struct allopt_t { const char *name; + enum OptSection section; int minmatch; int expectedbuf; int idx; @@ -43,36 +46,36 @@ struct allopt_t { #define NoAlias ((const char *) 0) #if defined(NHOPT_PROTO) -#define NHOPTB(a, b, c, s, i, n, v, d, al, bp) -#define NHOPTC(a, b, c, s, n, v, d, h, al, z) \ +#define NHOPTB(a, sec, b, c, s, i, n, v, d, al, bp) +#define NHOPTC(a, sec, b, c, s, n, v, d, h, al, z) \ static int optfn_##a(int, int, boolean, char *, char *); -#define NHOPTP(a, b, c, s, n, v, d, h, al, z) \ +#define NHOPTP(a, sec, b, c, s, n, v, d, h, al, z) \ static int pfxfn_##a(int, int, boolean, char *, char *); -#define NHOPTO(m, a, b, c, s, n, v, d, al, z) \ +#define NHOPTO(m, sec, a, b, c, s, n, v, d, al, z) \ static int optfn_##a(int, int, boolean, char *, char *); #elif defined(NHOPT_ENUM) -#define NHOPTB(a, b, c, s, i, n, v, d, al, bp) \ +#define NHOPTB(a, sec, b, c, s, i, n, v, d, al, bp) \ opt_##a, -#define NHOPTC(a, b, c, s, n, v, d, h, al, z) \ +#define NHOPTC(a, sec, b, c, s, n, v, d, h, al, z) \ opt_##a, -#define NHOPTP(a, b, c, s, n, v, d, h, al, z) \ +#define NHOPTP(a, sec, b, c, s, n, v, d, h, al, z) \ pfx_##a, -#define NHOPTO(m, a, b, c, s, n, v, d, al, z) \ +#define NHOPTO(m, sec, a, b, c, s, n, v, d, al, z) \ opt_##a, #elif defined(NHOPT_PARSE) -#define NHOPTB(a, b, c, s, i, n, v, d, al, bp) \ -{ #a, 0, b, opt_##a, s, BoolOpt, n, v, d, No, c, bp, &optfn_boolean, \ +#define NHOPTB(a, sec, b, c, s, i, n, v, d, al, bp) \ +{ #a, OptS_##sec, 0, b, opt_##a, s, BoolOpt, n, v, d, No, c, bp, &optfn_boolean, \ al, (const char *) 0, (const char *) 0, i, 0, 0 }, -#define NHOPTC(a, b, c, s, n, v, d, h, al, z) \ -{ #a, 0, b, opt_##a, s, CompOpt, n, v, d, No, c, (boolean *) 0, &optfn_##a, \ +#define NHOPTC(a, sec, b, c, s, n, v, d, h, al, z) \ +{ #a, OptS_##sec, 0, b, opt_##a, s, CompOpt, n, v, d, No, c, (boolean *) 0, &optfn_##a, \ al, z, (const char *) 0, Off, h, 0 }, -#define NHOPTP(a, b, c, s, n, v, d, h, al, z) \ -{ #a, 0, b, pfx_##a, s, CompOpt, n, v, d, Yes, c, (boolean *) 0, &pfxfn_##a, \ +#define NHOPTP(a, sec, b, c, s, n, v, d, h, al, z) \ +{ #a, OptS_##sec, 0, b, pfx_##a, s, CompOpt, n, v, d, Yes, c, (boolean *) 0, &pfxfn_##a, \ al, z, #a, Off, h, 0 }, -#define NHOPTO(m, a, b, c, s, n, v, d, al, z) \ -{ m, 0, b, opt_##a, s, OthrOpt, n, v, d, No, c, (boolean *) 0, &optfn_##a, \ +#define NHOPTO(m, sec, a, b, c, s, n, v, d, al, z) \ +{ m, OptS_##sec, 0, b, opt_##a, s, OthrOpt, n, v, d, No, c, (boolean *) 0, &optfn_##a, \ al, z, (const char *) 0, On, On, 0 }, #ifdef USE_TILES @@ -88,521 +91,521 @@ opt_##a, /* C:nm, ln, opt_*, setwhere?, negateok?, valok?, dupok?, hndlr? Alias, desc */ /* P:pfx, ln, opt_*, setwhere?, negateok?, valok?, dupok?, hndlr? Alias, desc*/ - NHOPTB(acoustics, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, + NHOPTB(acoustics, Advanced, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, &flags.acoustics) - NHOPTC(align, 8, opt_in, set_gameview, No, Yes, No, No, NoAlias, + NHOPTC(align, Advanced, 8, opt_in, set_gameview, No, Yes, No, No, NoAlias, "your starting alignment (lawful, neutral, or chaotic)") - NHOPTC(align_message, 20, opt_in, set_gameview, Yes, Yes, No, Yes, NoAlias, + NHOPTC(align_message, Advanced, 20, opt_in, set_gameview, Yes, Yes, No, Yes, NoAlias, "message window alignment") - NHOPTC(align_status, 20, opt_in, set_gameview, No, Yes, No, Yes, NoAlias, + NHOPTC(align_status, Advanced, 20, opt_in, set_gameview, No, Yes, No, Yes, NoAlias, "status window alignment") #ifdef WIN32 - NHOPTC(altkeyhandling, 20, opt_in, set_in_game, No, Yes, No, Yes, + NHOPTC(altkeyhandling, Advanced, 20, opt_in, set_in_game, No, Yes, No, Yes, "altkeyhandler", "alternative key handling") #else - NHOPTC(altkeyhandling, 20, opt_in, set_in_config, No, Yes, No, Yes, + NHOPTC(altkeyhandling, Advanced, 20, opt_in, set_in_config, No, Yes, No, Yes, "altkeyhandler", "(not applicable)") #endif #ifdef ALTMETA - NHOPTB(altmeta, 0, opt_out, set_in_game, Off, Yes, No, No, NoAlias, + NHOPTB(altmeta, Advanced, 0, opt_out, set_in_game, Off, Yes, No, No, NoAlias, &iflags.altmeta) #else - NHOPTB(altmeta, 0, opt_out, set_in_config, Off, Yes, No, No, NoAlias, + NHOPTB(altmeta, Advanced, 0, opt_out, set_in_config, Off, Yes, No, No, NoAlias, (boolean *) 0) #endif - NHOPTB(ascii_map, 0, opt_in, set_in_game, ascii_map_Def, Yes, No, No, + NHOPTB(ascii_map, Advanced, 0, opt_in, set_in_game, ascii_map_Def, Yes, No, No, NoAlias, &iflags.wc_ascii_map) - NHOPTB(autodescribe, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, + NHOPTB(autodescribe, Advanced, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, &iflags.autodescribe) - NHOPTB(autodig, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, + NHOPTB(autodig, Behavior, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, &flags.autodig) - NHOPTB(autoopen, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, + NHOPTB(autoopen, Behavior, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, &flags.autoopen) - NHOPTB(autopickup, 0, opt_out, set_in_game, Off, Yes, No, No, NoAlias, + NHOPTB(autopickup, Behavior, 0, opt_out, set_in_game, Off, Yes, No, No, NoAlias, &flags.pickup) - NHOPTO("autopickup exceptions", o_autopickup_exceptions, BUFSZ, opt_in, + NHOPTO("autopickup exceptions", Behavior, o_autopickup_exceptions, BUFSZ, opt_in, set_in_game, No, Yes, No, NoAlias, "edit autopickup exceptions") - NHOPTB(autoquiver, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, + NHOPTB(autoquiver, Behavior, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, &flags.autoquiver) - NHOPTC(autounlock, + NHOPTC(autounlock, Behavior, (sizeof "none" + sizeof "untrap" + sizeof "apply-key" + sizeof "kick" + sizeof "force" + 20), opt_out, set_in_game, Yes, Yes, No, Yes, NoAlias, "action to take when encountering locked door or chest") #if defined(MICRO) && !defined(AMIGA) - NHOPTB(BIOS, 0, opt_in, set_in_config, Off, Yes, No, No, NoAlias, + NHOPTB(BIOS, Advanced, 0, opt_in, set_in_config, Off, Yes, No, No, NoAlias, &iflags.BIOS) #else - NHOPTB(BIOS, 0, opt_in, set_in_config, Off, No, No, No, NoAlias, + NHOPTB(BIOS, Advanced, 0, opt_in, set_in_config, Off, No, No, No, NoAlias, (boolean *) 0) #endif - NHOPTB(blind, 0, opt_in, set_in_config, Off, Yes, No, No, NoAlias, + NHOPTB(blind, Advanced, 0, opt_in, set_in_config, Off, Yes, No, No, NoAlias, &u.uroleplay.blind) - NHOPTB(bones, 0, opt_out, set_in_config, On, Yes, No, No, NoAlias, + NHOPTB(bones, Advanced, 0, opt_out, set_in_config, On, Yes, No, No, NoAlias, &flags.bones) #ifdef BACKWARD_COMPAT - NHOPTC(boulder, 1, opt_in, set_in_game , No, Yes, No, No, NoAlias, + NHOPTC(boulder, Advanced, 1, opt_in, set_in_game , No, Yes, No, No, NoAlias, "deprecated (use S_boulder in sym file instead)") #endif - NHOPTC(catname, PL_PSIZ, opt_in, set_gameview, No, Yes, No, No, NoAlias, + NHOPTC(catname, Advanced, PL_PSIZ, opt_in, set_gameview, No, Yes, No, No, NoAlias, "name of your starting pet if it is a kitten") #ifdef INSURANCE - NHOPTB(checkpoint, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, + NHOPTB(checkpoint, Advanced, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, &flags.ins_chkpt) #else - NHOPTB(checkpoint, 0, opt_out, set_in_game, Off, No, No, No, NoAlias, + NHOPTB(checkpoint, Advanced, 0, opt_out, set_in_game, Off, No, No, No, NoAlias, (boolean *) 0) #endif - NHOPTB(clicklook, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, + NHOPTB(clicklook, Advanced, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, &iflags.clicklook) - NHOPTB(cmdassist, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, + NHOPTB(cmdassist, Behavior, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, &iflags.cmdassist) - NHOPTB(color, 0, opt_in, set_in_game, On, Yes, No, No, "colour", + NHOPTB(color, Advanced, 0, opt_in, set_in_game, On, Yes, No, No, "colour", &iflags.wc_color) - NHOPTB(confirm, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, + NHOPTB(confirm, Advanced, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, &flags.confirm) #ifdef CURSES_GRAPHICS - NHOPTC(cursesgraphics, 70, opt_in, set_in_config, No, Yes, No, No, NoAlias, + NHOPTC(cursesgraphics, Advanced, 70, opt_in, set_in_config, No, Yes, No, No, NoAlias, "load curses display symbols") #endif - NHOPTB(dark_room, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, + NHOPTB(dark_room, Advanced, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, &flags.dark_room) #ifdef BACKWARD_COMPAT - NHOPTC(DECgraphics, 70, opt_in, set_in_config, Yes, Yes, No, No, NoAlias, + NHOPTC(DECgraphics, Advanced, 70, opt_in, set_in_config, Yes, Yes, No, No, NoAlias, "load DECGraphics display symbols") #endif - NHOPTC(disclose, sizeof flags.end_disclose * 2, + NHOPTC(disclose, Advanced, sizeof flags.end_disclose * 2, opt_in, set_in_game, Yes, Yes, No, Yes, NoAlias, "the kinds of information to disclose at end of game") - NHOPTC(dogname, PL_PSIZ, opt_in, set_gameview, No, Yes, No, No, NoAlias, + NHOPTC(dogname, Advanced, PL_PSIZ, opt_in, set_gameview, No, Yes, No, No, NoAlias, "name of your starting pet if it is a little dog") - NHOPTC(dungeon, MAXDCHARS + 1,opt_in, set_in_config, No, Yes, No, No, + NHOPTC(dungeon, Advanced, MAXDCHARS + 1,opt_in, set_in_config, No, Yes, No, No, NoAlias, "list of symbols to use in drawing the dungeon map") - NHOPTC(effects, MAXECHARS + 1, opt_in, set_in_config, No, Yes, No, No, + NHOPTC(effects, Advanced, MAXECHARS + 1, opt_in, set_in_config, No, Yes, No, No, NoAlias, "list of symbols to use in drawing special effects") - NHOPTB(eight_bit_tty, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, + NHOPTB(eight_bit_tty, Advanced, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, &iflags.wc_eight_bit_input) - NHOPTB(extmenu, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, + NHOPTB(extmenu, Advanced, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, &iflags.extmenu) - NHOPTB(female, 0, opt_in, set_in_config, Off, Yes, No, No, "male", + NHOPTB(female, Advanced, 0, opt_in, set_in_config, Off, Yes, No, No, "male", &flags.female) - NHOPTB(fireassist, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, + NHOPTB(fireassist, Behavior, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, &iflags.fireassist) - NHOPTB(fixinv, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, + NHOPTB(fixinv, Advanced, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, &flags.invlet_constant) - NHOPTC(font_map, 40, opt_in, set_gameview, Yes, Yes, Yes, No, NoAlias, + NHOPTC(font_map, Advanced, 40, opt_in, set_gameview, Yes, Yes, Yes, No, NoAlias, "font to use in the map window") - NHOPTC(font_menu, 40, opt_in, set_gameview, Yes, Yes, Yes, No, NoAlias, + NHOPTC(font_menu, Advanced, 40, opt_in, set_gameview, Yes, Yes, Yes, No, NoAlias, "font to use in menus") - NHOPTC(font_message, 40, opt_in, set_gameview, Yes, Yes, Yes, No, NoAlias, + NHOPTC(font_message, Advanced, 40, opt_in, set_gameview, Yes, Yes, Yes, No, NoAlias, "font to use in the message window") - NHOPTC(font_size_map, 20, opt_in, set_gameview, Yes, Yes, Yes, No, NoAlias, + NHOPTC(font_size_map, Advanced, 20, opt_in, set_gameview, Yes, Yes, Yes, No, NoAlias, "size of the map font") - NHOPTC(font_size_menu, 20, opt_in, set_gameview, Yes, Yes, Yes, No, + NHOPTC(font_size_menu, Advanced, 20, opt_in, set_gameview, Yes, Yes, Yes, No, NoAlias, "size of the menu font") - NHOPTC(font_size_message, 20, opt_in, set_gameview, Yes, Yes, Yes, No, + NHOPTC(font_size_message, Advanced, 20, opt_in, set_gameview, Yes, Yes, Yes, No, NoAlias, "size of the message font") - NHOPTC(font_size_status, 20, opt_in, set_gameview, Yes, Yes, Yes, No, + NHOPTC(font_size_status, Advanced, 20, opt_in, set_gameview, Yes, Yes, Yes, No, NoAlias, "size of the status font") - NHOPTC(font_size_text, 20, opt_in, set_gameview, Yes, Yes, Yes, No, + NHOPTC(font_size_text, Advanced, 20, opt_in, set_gameview, Yes, Yes, Yes, No, NoAlias, "size of the text font") - NHOPTC(font_status, 40, opt_in, set_gameview, Yes, Yes, Yes, No, NoAlias, + NHOPTC(font_status, Advanced, 40, opt_in, set_gameview, Yes, Yes, Yes, No, NoAlias, "font to use in status window") - NHOPTC(font_text, 40, opt_in, set_gameview, Yes, Yes, Yes, No, NoAlias, + NHOPTC(font_text, Advanced, 40, opt_in, set_gameview, Yes, Yes, Yes, No, NoAlias, "font to use in text windows") - NHOPTB(force_invmenu, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, + NHOPTB(force_invmenu, Advanced, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, &iflags.force_invmenu) - NHOPTC(fruit, PL_FSIZ, opt_in, set_in_game, No, Yes, No, No, NoAlias, + NHOPTC(fruit, General, PL_FSIZ, opt_in, set_in_game, No, Yes, No, No, NoAlias, "name of a fruit you enjoy eating") - NHOPTB(fullscreen, 0, opt_in, set_in_config, Off, Yes, No, No, NoAlias, + NHOPTB(fullscreen, Advanced, 0, opt_in, set_in_config, Off, Yes, No, No, NoAlias, &iflags.wc2_fullscreen) - NHOPTC(gender, 8, opt_in, set_gameview, No, Yes, No, No, NoAlias, + NHOPTC(gender, Advanced, 8, opt_in, set_gameview, No, Yes, No, No, NoAlias, "your starting gender (male or female)") - NHOPTC(glyph, 40, opt_in, set_in_game, No, Yes, Yes, No, NoAlias, + NHOPTC(glyph, Advanced, 40, opt_in, set_in_game, No, Yes, Yes, No, NoAlias, "set representation of a glyph to a unicode value and color") - NHOPTB(goldX, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, + NHOPTB(goldX, Advanced, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, &flags.goldX) - NHOPTB(guicolor, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, + NHOPTB(guicolor, Advanced, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, &iflags.wc2_guicolor) - NHOPTB(help, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, + NHOPTB(help, Advanced, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, &flags.help) - NHOPTB(herecmd_menu, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, + NHOPTB(herecmd_menu, Advanced, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, &iflags.herecmd_menu) #if defined(MAC) - NHOPTC(hicolor, 15, opt_in, set_in_config, No, Yes, No, No, NoAlias, + NHOPTC(hicolor, Advanced, 15, opt_in, set_in_config, No, Yes, No, No, NoAlias, "same as palette, only order is reversed") #endif - NHOPTB(hilite_pet, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, + NHOPTB(hilite_pet, Map, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, &iflags.wc_hilite_pet) - NHOPTB(hilite_pile, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, + NHOPTB(hilite_pile, Map, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, &iflags.hilite_pile) #ifdef STATUS_HILITES - NHOPTC(hilite_status, 13, opt_out, set_in_game, Yes, Yes, Yes, No, NoAlias, + NHOPTC(hilite_status, Advanced, 13, opt_out, set_in_game, Yes, Yes, Yes, No, NoAlias, "a status highlighting rule (can occur multiple times)") #else - NHOPTC(hilite_status, 13, opt_out, set_in_config, Yes, Yes, Yes, No, + NHOPTC(hilite_status, Advanced, 13, opt_out, set_in_config, Yes, Yes, Yes, No, NoAlias, "(not available)") #endif - NHOPTB(hitpointbar, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, + NHOPTB(hitpointbar, Status, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, &iflags.wc2_hitpointbar) - NHOPTC(horsename, PL_PSIZ, opt_in, set_gameview, No, Yes, No, No, NoAlias, + NHOPTC(horsename, Advanced, PL_PSIZ, opt_in, set_gameview, No, Yes, No, No, NoAlias, "name of your starting pet if it is a pony") #ifdef BACKWARD_COMPAT - NHOPTC(IBMgraphics, 70, opt_in, set_in_config, Yes, Yes, No, No, NoAlias, + NHOPTC(IBMgraphics, Advanced, 70, opt_in, set_in_config, Yes, Yes, No, No, NoAlias, "load IBMGraphics display symbols") #endif #ifndef MAC - NHOPTB(ignintr, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, + NHOPTB(ignintr, Advanced, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, &flags.ignintr) #else - NHOPTB(ignintr, 0, opt_in, set_in_config, Off, Yes, No, No, NoAlias, + NHOPTB(ignintr, Advanced, 0, opt_in, set_in_config, Off, Yes, No, No, NoAlias, (boolean *) 0) #endif - NHOPTB(implicit_uncursed, 0, opt_out, set_in_game, On, Yes, No, No, + NHOPTB(implicit_uncursed, Advanced, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, &flags.implicit_uncursed) #if 0 /* obsolete - pre-OSX Mac */ - NHOPTB(large_font, 0, opt_in, set_in_config, Off, Yes, No, No, NoAlias, + NHOPTB(large_font, Advanced, 0, opt_in, set_in_config, Off, Yes, No, No, NoAlias, &iflags.obsolete) #endif - NHOPTB(legacy, 0, opt_out, set_in_config, On, Yes, No, No, NoAlias, + NHOPTB(legacy, Advanced, 0, opt_out, set_in_config, On, Yes, No, No, NoAlias, &flags.legacy) - NHOPTB(lit_corridor, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, + NHOPTB(lit_corridor, Advanced, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, &flags.lit_corridor) - NHOPTB(lootabc, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, + NHOPTB(lootabc, Advanced, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, &flags.lootabc) #if defined(BACKWARD_COMPAT) && defined(MAC_GRAPHICS_ENV) - NHOPTC(Macgraphics, 70, opt_in, set_in_config, No, Yes, No, No, NoAlias, + NHOPTC(Macgraphics, Advanced, 70, opt_in, set_in_config, No, Yes, No, No, NoAlias, "load MACGraphics display symbols") #endif - NHOPTB(mail, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, + NHOPTB(mail, Advanced, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, &flags.biff) - NHOPTC(map_mode, 20, opt_in, set_gameview, Yes, Yes, No, No, NoAlias, + NHOPTC(map_mode, Advanced, 20, opt_in, set_gameview, Yes, Yes, No, No, NoAlias, "map display mode under Windows") - NHOPTB(mention_decor, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, + NHOPTB(mention_decor, Advanced, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, &flags.mention_decor) - NHOPTB(mention_walls, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, + NHOPTB(mention_walls, Advanced, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, &flags.mention_walls) - NHOPTC(menu_deselect_all, 4, opt_in, set_in_config, No, Yes, No, No, + NHOPTC(menu_deselect_all, Advanced, 4, opt_in, set_in_config, No, Yes, No, No, NoAlias, "deselect all items in a menu") - NHOPTC(menu_deselect_page, 4, opt_in, set_in_config, No, Yes, No, No, + NHOPTC(menu_deselect_page, Advanced, 4, opt_in, set_in_config, No, Yes, No, No, NoAlias, "deselect all items on this page of a menu") - NHOPTC(menu_first_page, 4, opt_in, set_in_config, No, Yes, No, No, + NHOPTC(menu_first_page, Advanced, 4, opt_in, set_in_config, No, Yes, No, No, NoAlias, "jump to the first page in a menu") - NHOPTC(menu_headings, 4, opt_in, set_in_game, No, Yes, No, Yes, NoAlias, + NHOPTC(menu_headings, Advanced, 4, opt_in, set_in_game, No, Yes, No, Yes, NoAlias, "display style for menu headings") - NHOPTC(menu_invert_all, 4, opt_in, set_in_config, No, Yes, No, No, NoAlias, + NHOPTC(menu_invert_all, Advanced, 4, opt_in, set_in_config, No, Yes, No, No, NoAlias, "invert all items in a menu") - NHOPTC(menu_invert_page, 4, opt_in, set_in_config, No, Yes, No, No, + NHOPTC(menu_invert_page, Advanced, 4, opt_in, set_in_config, No, Yes, No, No, NoAlias, "invert all items on this page of a menu") - NHOPTC(menu_last_page, 4, opt_in, set_in_config, No, Yes, No, No, NoAlias, + NHOPTC(menu_last_page, Advanced, 4, opt_in, set_in_config, No, Yes, No, No, NoAlias, "jump to the last page in a menu") - NHOPTC(menu_next_page, 4, opt_in, set_in_config, No, Yes, No, No, NoAlias, + NHOPTC(menu_next_page, Advanced, 4, opt_in, set_in_config, No, Yes, No, No, NoAlias, "go to the next menu page") - NHOPTB(menu_objsyms, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, + NHOPTB(menu_objsyms, Advanced, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, &iflags.menu_head_objsym) #ifdef TTY_GRAPHICS - NHOPTB(menu_overlay, 0, opt_in, set_in_game, On, Yes, No, No, NoAlias, + NHOPTB(menu_overlay, Advanced, 0, opt_in, set_in_game, On, Yes, No, No, NoAlias, &iflags.menu_overlay) #else - NHOPTB(menu_overlay, 0, opt_in, set_in_config, Off, No, No, No, NoAlias, + NHOPTB(menu_overlay, Advanced, 0, opt_in, set_in_config, Off, No, No, No, NoAlias, (boolean *) 0) #endif - NHOPTC(menu_previous_page, 4, opt_in, set_in_config, No, Yes, No, No, + NHOPTC(menu_previous_page, Advanced, 4, opt_in, set_in_config, No, Yes, No, No, NoAlias, "go to the previous menu page") - NHOPTC(menu_search, 4, opt_in, set_in_config, No, Yes, No, No, NoAlias, + NHOPTC(menu_search, Advanced, 4, opt_in, set_in_config, No, Yes, No, No, NoAlias, "search for a menu item") - NHOPTC(menu_select_all, 4, opt_in, set_in_config, No, Yes, No, No, NoAlias, + NHOPTC(menu_select_all, Advanced, 4, opt_in, set_in_config, No, Yes, No, No, NoAlias, "select all items in a menu") - NHOPTC(menu_select_page, 4, opt_in, set_in_config, No, Yes, No, No, + NHOPTC(menu_select_page, Advanced, 4, opt_in, set_in_config, No, Yes, No, No, NoAlias, "select all items on this page of a menu") - NHOPTC(menu_shift_left, 4, opt_in, set_in_config, No, Yes, No, No, + NHOPTC(menu_shift_left, Advanced, 4, opt_in, set_in_config, No, Yes, No, No, NoAlias, "pan current menu page left") - NHOPTC(menu_shift_right, 4, opt_in, set_in_config, No, Yes, No, No, + NHOPTC(menu_shift_right, Advanced, 4, opt_in, set_in_config, No, Yes, No, No, NoAlias, "pan current menu page right") - NHOPTB(menu_tab_sep, 0, opt_in, set_wizonly, Off, Yes, No, No, NoAlias, + NHOPTB(menu_tab_sep, Advanced, 0, opt_in, set_wizonly, Off, Yes, No, No, NoAlias, &iflags.menu_tab_sep) - NHOPTB(menucolors, 0, opt_in, set_in_game, Off, Yes, Yes, No, NoAlias, + NHOPTB(menucolors, Advanced, 0, opt_in, set_in_game, Off, Yes, Yes, No, NoAlias, &iflags.use_menu_color) - NHOPTO("menu colors", o_menu_colors, BUFSZ, opt_in, set_in_game, + NHOPTO("menu colors", Status, o_menu_colors, BUFSZ, opt_in, set_in_game, No, Yes, No, NoAlias, "edit menu colors") - NHOPTC(menuinvertmode, 5, opt_in, set_in_game, No, Yes, No, No, NoAlias, + NHOPTC(menuinvertmode, Advanced, 5, opt_in, set_in_game, No, Yes, No, No, NoAlias, "experimental behaviour of menu inverts") - NHOPTC(menustyle, MENUTYPELEN, opt_in, set_in_game, Yes, Yes, No, Yes, + NHOPTC(menustyle, Advanced, MENUTYPELEN, opt_in, set_in_game, Yes, Yes, No, Yes, NoAlias, "user interface for object selection") - NHOPTO("message types", o_message_types, BUFSZ, opt_in, set_in_game, + NHOPTO("message types", Advanced, o_message_types, BUFSZ, opt_in, set_in_game, No, Yes, No, NoAlias, "edit message types") - NHOPTB(monpolycontrol, 0, opt_in, set_wizonly, Off, Yes, No, No, NoAlias, + NHOPTB(monpolycontrol, Advanced, 0, opt_in, set_wizonly, Off, Yes, No, No, NoAlias, &iflags.mon_polycontrol) - NHOPTC(monsters, MAXMCLASSES, opt_in, set_in_config, No, Yes, No, No, + NHOPTC(monsters, Advanced, MAXMCLASSES, opt_in, set_in_config, No, Yes, No, No, NoAlias, "list of symbols to use for monsters") - NHOPTC(mouse_support, 0, opt_in, set_in_game, No, Yes, No, No, NoAlias, + NHOPTC(mouse_support, Advanced, 0, opt_in, set_in_game, No, Yes, No, No, NoAlias, "game receives click info from mouse") #if PREV_MSGS /* tty or curses */ - NHOPTC(msg_window, 1, opt_in, set_in_game, Yes, Yes, No, Yes, NoAlias, + NHOPTC(msg_window, Advanced, 1, opt_in, set_in_game, Yes, Yes, No, Yes, NoAlias, "control of \"view previous message(s)\" (^P) behavior") #else - NHOPTC(msg_window, 1, opt_in, set_in_config, Yes, Yes, No, Yes, NoAlias, + NHOPTC(msg_window, Advanced, 1, opt_in, set_in_config, Yes, Yes, No, Yes, NoAlias, "control of \"view previous message(s)\" (^P) behavior") #endif - NHOPTC(msghistory, 5, opt_in, set_gameview, Yes, Yes, No, No, NoAlias, + NHOPTC(msghistory, Advanced, 5, opt_in, set_gameview, Yes, Yes, No, No, NoAlias, "number of top line messages to save") - NHOPTC(name, PL_NSIZ, opt_in, set_gameview, No, Yes, No, No, NoAlias, + NHOPTC(name, Advanced, PL_NSIZ, opt_in, set_gameview, No, Yes, No, No, NoAlias, "your character's name (e.g., name:Merlin-W)") #ifdef NEWS - NHOPTB(news, 0, opt_in, set_in_config, Off, Yes, No, No, NoAlias, + NHOPTB(news, Advanced, 0, opt_in, set_in_config, Off, Yes, No, No, NoAlias, &iflags.news) #else - NHOPTB(news, 0, opt_in, set_in_config, Off, No, No, No, NoAlias, + NHOPTB(news, Advanced, 0, opt_in, set_in_config, Off, No, No, No, NoAlias, (boolean *) 0) #endif - NHOPTB(nudist, 0, opt_in, set_in_config, Off, Yes, No, No, NoAlias, + NHOPTB(nudist, Advanced, 0, opt_in, set_in_config, Off, Yes, No, No, NoAlias, &u.uroleplay.nudist) - NHOPTB(null, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, + NHOPTB(null, Advanced, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, &flags.null) - NHOPTC(number_pad, 1, opt_in, set_in_game, No, Yes, No, Yes, NoAlias, + NHOPTC(number_pad, General, 1, opt_in, set_in_game, No, Yes, No, Yes, NoAlias, "use the number pad for movement") - NHOPTC(objects, MAXOCLASSES, opt_in, set_in_config, No, Yes, No, No, + NHOPTC(objects, Advanced, MAXOCLASSES, opt_in, set_in_config, No, Yes, No, No, NoAlias, "list of symbols to use for objects") - NHOPTC(packorder, MAXOCLASSES, opt_in, set_in_game, No, Yes, No, No, + NHOPTC(packorder, Advanced, MAXOCLASSES, opt_in, set_in_game, No, Yes, No, No, NoAlias, "the inventory order of the items in your pack") #ifdef CHANGE_COLOR #ifndef WIN32 - NHOPTC(palette, 15, opt_in, set_in_game, No, Yes, No, No, "hicolor", + NHOPTC(palette, Advanced, 15, opt_in, set_in_game, No, Yes, No, No, "hicolor", "palette (00c/880/-fff is blue/yellow/reverse white)") #else - NHOPTC(palette, 15, opt_in, set_in_config, No, Yes, No, No, "hicolor", + NHOPTC(palette, Advanced, 15, opt_in, set_in_config, No, Yes, No, No, "hicolor", "palette (adjust an RGB color in palette (color-R-G-B)") #endif #endif - NHOPTC(paranoid_confirmation, 28, opt_in, set_in_game, Yes, Yes, Yes, Yes, + NHOPTC(paranoid_confirmation, Advanced, 28, opt_in, set_in_game, Yes, Yes, Yes, Yes, "prayconfirm", "extra prompting in certain situations") - NHOPTB(perm_invent, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, + NHOPTB(perm_invent, Advanced, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, &iflags.perm_invent) - NHOPTC(petattr, 88, opt_in, set_in_game, No, Yes, No, No, NoAlias, + NHOPTC(petattr, Advanced, 88, opt_in, set_in_game, No, Yes, No, No, NoAlias, "attributes for highlighting pets") - NHOPTC(pettype, 4, opt_in, set_gameview, Yes, Yes, No, No, "pet", + NHOPTC(pettype, Advanced, 4, opt_in, set_gameview, Yes, Yes, No, No, "pet", "your preferred initial pet type") - NHOPTC(pickup_burden, 20, opt_in, set_in_game, No, Yes, No, Yes, NoAlias, + NHOPTC(pickup_burden, Advanced, 20, opt_in, set_in_game, No, Yes, No, Yes, NoAlias, "maximum burden picked up before prompt") - NHOPTB(pickup_thrown, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, + NHOPTB(pickup_thrown, Behavior, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, &flags.pickup_thrown) - NHOPTC(pickup_types, MAXOCLASSES, opt_in, set_in_game, No, Yes, No, Yes, + NHOPTC(pickup_types, Advanced, MAXOCLASSES, opt_in, set_in_game, No, Yes, No, Yes, NoAlias, "types of objects to pick up automatically") - NHOPTC(pile_limit, 24, opt_in, set_in_game, Yes, Yes, No, No, NoAlias, + NHOPTC(pile_limit, Advanced, 24, opt_in, set_in_game, Yes, Yes, No, No, NoAlias, "threshold for \"there are many objects here\"") - NHOPTC(player_selection, 12, opt_in, set_gameview, No, Yes, No, No, + NHOPTC(player_selection, Advanced, 12, opt_in, set_gameview, No, Yes, No, No, NoAlias, "choose character via dialog or prompts") - NHOPTC(playmode, 8, opt_in, set_gameview, No, Yes, No, No, NoAlias, + NHOPTC(playmode, Advanced, 8, opt_in, set_gameview, No, Yes, No, No, NoAlias, "normal play, non-scoring explore mode, or debug mode") - NHOPTB(popup_dialog, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, + NHOPTB(popup_dialog, Advanced, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, &iflags.wc_popup_dialog) - NHOPTB(preload_tiles, 0, opt_out, set_in_config, On, Yes, No, No, NoAlias, + NHOPTB(preload_tiles, Advanced, 0, opt_out, set_in_config, On, Yes, No, No, NoAlias, &iflags.wc_preload_tiles) - NHOPTB(pushweapon, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, + NHOPTB(pushweapon, Behavior, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, &flags.pushweapon) - NHOPTB(quick_farsight, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, + NHOPTB(quick_farsight, Advanced, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, &flags.quick_farsight) - NHOPTC(race, PL_CSIZ, opt_in, set_gameview, No, Yes, No, No, NoAlias, + NHOPTC(race, Advanced, PL_CSIZ, opt_in, set_gameview, No, Yes, No, No, NoAlias, "your starting race (e.g., Human, Elf)") #ifdef MICRO - NHOPTB(rawio, 0, opt_in, set_in_config, Off, Yes, No, No, NoAlias, + NHOPTB(rawio, Advanced, 0, opt_in, set_in_config, Off, Yes, No, No, NoAlias, &iflags.rawio) #else - NHOPTB(rawio, 0, opt_in, set_in_config, Off, No, No, No, NoAlias, + NHOPTB(rawio, Advanced, 0, opt_in, set_in_config, Off, No, No, No, NoAlias, (boolean *) 0) #endif - NHOPTB(rest_on_space, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, + NHOPTB(rest_on_space, Advanced, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, &flags.rest_on_space) - NHOPTC(roguesymset, 70, opt_in, set_in_game, No, Yes, No, Yes, NoAlias, + NHOPTC(roguesymset, Advanced, 70, opt_in, set_in_game, No, Yes, No, Yes, NoAlias, "load a set of rogue display symbols from symbols file") - NHOPTC(role, PL_CSIZ, opt_in, set_gameview, No, Yes, No, No, "character", + NHOPTC(role, Advanced, PL_CSIZ, opt_in, set_gameview, No, Yes, No, No, "character", "your starting role (e.g., Barbarian, Valkyrie)") - NHOPTC(runmode, sizeof "teleport", opt_in, set_in_game, Yes, Yes, No, Yes, + NHOPTC(runmode, Advanced, sizeof "teleport", opt_in, set_in_game, Yes, Yes, No, Yes, NoAlias, "display frequency when `running' or `travelling'") - NHOPTB(safe_pet, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, + NHOPTB(safe_pet, Advanced, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, &flags.safe_dog) - NHOPTB(safe_wait, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, + NHOPTB(safe_wait, Advanced, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, &flags.safe_wait) - NHOPTB(sanity_check, 0, opt_in, set_wizonly, Off, Yes, No, No, NoAlias, + NHOPTB(sanity_check, Advanced, 0, opt_in, set_wizonly, Off, Yes, No, No, NoAlias, &iflags.sanity_check) - NHOPTC(scores, 32, opt_in, set_in_game, No, Yes, No, No, NoAlias, + NHOPTC(scores, Advanced, 32, opt_in, set_in_game, No, Yes, No, No, NoAlias, "the parts of the score list you wish to see") - NHOPTC(scroll_amount, 20, opt_in, set_gameview, Yes, Yes, No, No, NoAlias, + NHOPTC(scroll_amount, Advanced, 20, opt_in, set_gameview, Yes, Yes, No, No, NoAlias, "amount to scroll map when scroll_margin is reached") - NHOPTC(scroll_margin, 20, opt_in, set_gameview, Yes, Yes, No, No, NoAlias, + NHOPTC(scroll_margin, Advanced, 20, opt_in, set_gameview, Yes, Yes, No, No, NoAlias, "scroll map when this far from the edge") - NHOPTB(selectsaved, 0, opt_out, set_in_config, On, Yes, No, No, NoAlias, + NHOPTB(selectsaved, Advanced, 0, opt_out, set_in_config, On, Yes, No, No, NoAlias, &iflags.wc2_selectsaved) - NHOPTB(showexp, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, + NHOPTB(showexp, Status, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, &flags.showexp) - NHOPTB(showrace, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, + NHOPTB(showrace, Map, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, &flags.showrace) #ifdef SCORE_ON_BOTL - NHOPTB(showscore, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, + NHOPTB(showscore, Advanced, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, &flags.showscore) #else - NHOPTB(showscore, 0, opt_in, set_in_config, Off, Yes, No, No, NoAlias, + NHOPTB(showscore, Advanced, 0, opt_in, set_in_config, Off, Yes, No, No, NoAlias, (boolean *) 0) #endif - NHOPTB(silent, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, + NHOPTB(silent, Advanced, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, &flags.silent) - NHOPTB(softkeyboard, 0, opt_in, set_in_config, Off, Yes, No, No, NoAlias, + NHOPTB(softkeyboard, Advanced, 0, opt_in, set_in_config, Off, Yes, No, No, NoAlias, &iflags.wc2_softkeyboard) - NHOPTC(sortdiscoveries, 0, opt_in, set_in_game, Yes, Yes, No, Yes, + NHOPTC(sortdiscoveries, Advanced, 0, opt_in, set_in_game, Yes, Yes, No, Yes, NoAlias, "preferred order when displaying discovered objects") - NHOPTC(sortloot, 4, opt_in, set_in_game, No, Yes, No, Yes, NoAlias, + NHOPTC(sortloot, Advanced, 4, opt_in, set_in_game, No, Yes, No, Yes, NoAlias, "sort object selection lists by description") - NHOPTB(sortpack, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, + NHOPTB(sortpack, Advanced, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, &flags.sortpack) - NHOPTB(sparkle, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, + NHOPTB(sparkle, Map, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, &flags.sparkle) - NHOPTB(splash_screen, 0, opt_out, set_in_config, On, Yes, No, No, NoAlias, + NHOPTB(splash_screen, Advanced, 0, opt_out, set_in_config, On, Yes, No, No, NoAlias, &iflags.wc_splash_screen) - NHOPTB(standout, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, + NHOPTB(standout, Advanced, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, &flags.standout) - NHOPTB(status_updates, 0, opt_out, set_in_config, On, Yes, No, No, NoAlias, + NHOPTB(status_updates, Advanced, 0, opt_out, set_in_config, On, Yes, No, No, NoAlias, &iflags.status_updates) - NHOPTO("status condition fields", o_status_cond, BUFSZ, opt_in, + NHOPTO("status condition fields", Status, o_status_cond, BUFSZ, opt_in, set_in_game, No, Yes, No, NoAlias, "edit status condition fields") #ifdef STATUS_HILITES - NHOPTC(statushilites, 20, opt_in, set_in_game, Yes, Yes, Yes, No, NoAlias, + NHOPTC(statushilites, Advanced, 20, opt_in, set_in_game, Yes, Yes, Yes, No, NoAlias, "0=no status highlighting, N=show highlights for N turns") - NHOPTO("status highlight rules", o_status_hilites, BUFSZ, opt_in, + NHOPTO("status highlight rules", Status, o_status_hilites, BUFSZ, opt_in, set_in_game, No, Yes, No, NoAlias, "edit status hilites") #else - NHOPTC(statushilites, 20, opt_in, set_in_config, Yes, Yes, Yes, No, + NHOPTC(statushilites, Advanced, 20, opt_in, set_in_config, Yes, Yes, Yes, No, NoAlias, "highlight control") #endif - NHOPTC(statuslines, 20, opt_in, set_in_game, No, Yes, No, No, NoAlias, + NHOPTC(statuslines, Advanced, 20, opt_in, set_in_game, No, Yes, No, No, NoAlias, "2 or 3 lines for status display") #ifdef WIN32 - NHOPTC(subkeyvalue, 7, opt_in, set_in_config, No, Yes, Yes, No, NoAlias, + NHOPTC(subkeyvalue, Advanced, 7, opt_in, set_in_config, No, Yes, Yes, No, NoAlias, "override keystroke value") #endif - NHOPTC(suppress_alert, 8, opt_in, set_in_game, No, Yes, Yes, No, NoAlias, + NHOPTC(suppress_alert, Advanced, 8, opt_in, set_in_game, No, Yes, Yes, No, NoAlias, "suppress alerts about version-specific features") - NHOPTC(symset, 70, opt_in, set_in_game, No, Yes, No, Yes, NoAlias, + NHOPTC(symset, Map, 70, opt_in, set_in_game, No, Yes, No, Yes, NoAlias, "load a set of display symbols from symbols file") - NHOPTC(term_cols, 6, opt_in, set_in_config, No, Yes, No, No, "termcolumns", + NHOPTC(term_cols, Advanced, 6, opt_in, set_in_config, No, Yes, No, No, "termcolumns", "number of columns") - NHOPTC(term_rows, 6, opt_in, set_in_config, No, Yes, No, No, NoAlias, + NHOPTC(term_rows, Advanced, 6, opt_in, set_in_config, No, Yes, No, No, NoAlias, "number of rows") - NHOPTC(tile_file, 70, opt_in, set_gameview, No, Yes, No, No, NoAlias, + NHOPTC(tile_file, Advanced, 70, opt_in, set_gameview, No, Yes, No, No, NoAlias, "name of tile file") - NHOPTC(tile_height, 20, opt_in, set_gameview, Yes, Yes, No, No, NoAlias, + NHOPTC(tile_height, Advanced, 20, opt_in, set_gameview, Yes, Yes, No, No, NoAlias, "height of tiles") - NHOPTC(tile_width, 20, opt_in, set_gameview, Yes, Yes, No, No, NoAlias, + NHOPTC(tile_width, Advanced, 20, opt_in, set_gameview, Yes, Yes, No, No, NoAlias, "width of tiles") - NHOPTB(tiled_map, 0, opt_in, set_in_game, tiled_map_Def, Yes, No, No, + NHOPTB(tiled_map, Advanced, 0, opt_in, set_in_game, tiled_map_Def, Yes, No, No, NoAlias, &iflags.wc_tiled_map) - NHOPTB(time, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, + NHOPTB(time, Status, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, &flags.time) #ifdef TIMED_DELAY - NHOPTB(timed_delay, 0, opt_out, set_in_game, Off, Yes, No, No, NoAlias, + NHOPTB(timed_delay, Map, 0, opt_out, set_in_game, Off, Yes, No, No, NoAlias, &flags.nap) #else - NHOPTB(timed_delay, 0, opt_in, set_in_game, Off, No, No, No, NoAlias, + NHOPTB(timed_delay, Map, 0, opt_in, set_in_game, Off, No, No, No, NoAlias, (boolean *) 0) #endif - NHOPTB(tombstone, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, + NHOPTB(tombstone, Advanced, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, &flags.tombstone) - NHOPTB(toptenwin, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, + NHOPTB(toptenwin, Advanced, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, &iflags.toptenwin) - NHOPTC(traps, MAXTCHARS + 1, opt_in, set_in_config, No, Yes, No, No, + NHOPTC(traps, Advanced, MAXTCHARS + 1, opt_in, set_in_config, No, Yes, No, No, NoAlias, "list of symbols to use in drawing traps") - NHOPTB(travel, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, + NHOPTB(travel, Advanced, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, &flags.travelcmd) #ifdef DEBUG - NHOPTB(travel_debug, 0, opt_out, set_wizonly, Off, Yes, No, No, NoAlias, + NHOPTB(travel_debug, Advanced, 0, opt_out, set_wizonly, Off, Yes, No, No, NoAlias, &iflags.trav_debug) #else - NHOPTB(travel_debug, 0, opt_out, set_wizonly, Off, No, No, No, NoAlias, + NHOPTB(travel_debug, Advanced, 0, opt_out, set_wizonly, Off, No, No, No, NoAlias, (boolean *) 0) #endif - NHOPTB(use_darkgray, 0, opt_out, set_in_config, On, Yes, No, No, NoAlias, + NHOPTB(use_darkgray, Advanced, 0, opt_out, set_in_config, On, Yes, No, No, NoAlias, &iflags.wc2_darkgray) - NHOPTB(use_inverse, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, + NHOPTB(use_inverse, Advanced, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, &iflags.wc_inverse) - NHOPTB(use_truecolor, 0, opt_in, set_in_config, Off, Yes, No, No, + NHOPTB(use_truecolor, Advanced, 0, opt_in, set_in_config, Off, Yes, No, No, "use_truecolour", &iflags.use_truecolor) - NHOPTC(vary_msgcount, 20, opt_in, set_gameview, No, Yes, No, No, NoAlias, + NHOPTC(vary_msgcount, Advanced, 20, opt_in, set_gameview, No, Yes, No, No, NoAlias, "show more old messages at a time") #if defined(NO_VERBOSE_GRANULARITY) - NHOPTB(verbose, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, + NHOPTB(verbose, Advanced, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias, &flags.verbose) #endif #ifdef MSDOS - NHOPTC(video, 20, opt_in, set_in_config, No, Yes, No, No, NoAlias, + NHOPTC(video, Advanced, 20, opt_in, set_in_config, No, Yes, No, No, NoAlias, "method of video updating") #endif #ifdef VIDEOSHADES - NHOPTC(videocolors, 40, opt_in, set_gameview, No, Yes, No, No, + NHOPTC(videocolors, Advanced, 40, opt_in, set_gameview, No, Yes, No, No, "videocolours", "color mappings for internal screen routines") - NHOPTC(videoshades, 32, opt_in, set_gameview, No, Yes, No, No, NoAlias, + NHOPTC(videoshades, Advanced, 32, opt_in, set_gameview, No, Yes, No, No, NoAlias, "gray shades to map to black/gray/white") #endif #ifdef MSDOS - NHOPTC(video_width, 10, opt_in, set_gameview, No, Yes, No, No, NoAlias, + NHOPTC(video_width, Advanced, 10, opt_in, set_gameview, No, Yes, No, No, NoAlias, "video width") - NHOPTC(video_height, 10, opt_in, set_gameview, No, Yes, No, No, NoAlias, + NHOPTC(video_height, Advanced, 10, opt_in, set_gameview, No, Yes, No, No, NoAlias, "video height") #endif #ifdef TTY_TILES_ESCCODES - NHOPTB(vt_tiledata, 0, opt_in, set_in_config, Off, Yes, No, No, NoAlias, + NHOPTB(vt_tiledata, Advanced, 0, opt_in, set_in_config, Off, Yes, No, No, NoAlias, &iflags.vt_tiledata) #else - NHOPTB(vt_tiledata, 0, opt_in, set_in_config, Off, Yes, No, No, NoAlias, + NHOPTB(vt_tiledata, Advanced, 0, opt_in, set_in_config, Off, Yes, No, No, NoAlias, (boolean *) 0) #endif #ifdef TTY_SOUND_ESCCODES - NHOPTB(vt_sounddata, 0, opt_in, set_in_config, Off, Yes, No, No, NoAlias, + NHOPTB(vt_sounddata, Advanced, 0, opt_in, set_in_config, Off, Yes, No, No, NoAlias, &iflags.vt_sounddata) #else - NHOPTB(vt_sounddata, 0, opt_in, set_in_config, Off, Yes, No, No, NoAlias, + NHOPTB(vt_sounddata, Advanced, 0, opt_in, set_in_config, Off, Yes, No, No, NoAlias, (boolean *) 0) #endif - NHOPTC(warnings, 10, opt_in, set_in_config, No, Yes, No, No, NoAlias, + NHOPTC(warnings, Advanced, 10, opt_in, set_in_config, No, Yes, No, No, NoAlias, "display characters for warnings") - NHOPTC(whatis_coord, 1, opt_in, set_in_game, Yes, Yes, No, Yes, NoAlias, + NHOPTC(whatis_coord, Advanced, 1, opt_in, set_in_game, Yes, Yes, No, Yes, NoAlias, "show coordinates when auto-describing cursor position") - NHOPTC(whatis_filter, 1, opt_in, set_in_game, Yes, Yes, No, Yes, NoAlias, + NHOPTC(whatis_filter, Advanced, 1, opt_in, set_in_game, Yes, Yes, No, Yes, NoAlias, "filter coordinate locations when targeting next or previous") - NHOPTB(whatis_menu, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, + NHOPTB(whatis_menu, Advanced, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, &iflags.getloc_usemenu) - NHOPTB(whatis_moveskip, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, + NHOPTB(whatis_moveskip, Advanced, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, &iflags.getloc_moveskip) - NHOPTC(windowborders, 9, opt_in, set_in_game, Yes, Yes, No, No, NoAlias, + NHOPTC(windowborders, Advanced, 9, opt_in, set_in_game, Yes, Yes, No, No, NoAlias, "0 (off), 1 (on), 2 (auto)") #ifdef WINCHAIN - NHOPTC(windowchain, WINTYPELEN, opt_in, set_in_sysconf, No, Yes, No, No, + NHOPTC(windowchain, Advanced, WINTYPELEN, opt_in, set_in_sysconf, No, Yes, No, No, NoAlias, "window processor to use") #endif - NHOPTC(windowcolors, 80, opt_in, set_gameview, No, Yes, No, No, NoAlias, + NHOPTC(windowcolors, Advanced, 80, opt_in, set_gameview, No, Yes, No, No, NoAlias, "the foreground/background colors of windows") - NHOPTC(windowtype, WINTYPELEN, opt_in, set_gameview, No, Yes, No, No, + NHOPTC(windowtype, Advanced, WINTYPELEN, opt_in, set_gameview, No, Yes, No, No, NoAlias, "windowing system to use (should be specified first)") - NHOPTB(wizmgender, 0, opt_in, set_wizonly, Off, Yes, No, No, NoAlias, + NHOPTB(wizmgender, Advanced, 0, opt_in, set_wizonly, Off, Yes, No, No, NoAlias, &iflags.wizmgender) - NHOPTB(wizweight, 0, opt_in, set_wizonly, Off, Yes, No, No, NoAlias, + NHOPTB(wizweight, Advanced, 0, opt_in, set_wizonly, Off, Yes, No, No, NoAlias, &iflags.wizweight) - NHOPTB(wraptext, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, + NHOPTB(wraptext, Advanced, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, &iflags.wc2_wraptext) /* * Prefix-based Options */ - NHOPTP(cond_, 0, opt_in, set_hidden, No, No, Yes, Yes, NoAlias, + NHOPTP(cond_, Advanced, 0, opt_in, set_hidden, No, No, Yes, Yes, NoAlias, "prefix for cond_ options") - NHOPTP(font, 0, opt_in, set_hidden, Yes, Yes, Yes, No, NoAlias, + NHOPTP(font, Advanced, 0, opt_in, set_hidden, Yes, Yes, Yes, No, NoAlias, "prefix for font options") #if defined(MICRO) && !defined(AMIGA) /* included for compatibility with old NetHack.cnf files */ - NHOPTP(IBM_, 0, opt_in, set_hidden, No, No, Yes, No, NoAlias, + NHOPTP(IBM_, Advanced, 0, opt_in, set_hidden, No, No, Yes, No, NoAlias, "prefix for old micro IBM_ options") #endif /* MICRO */ #if !defined(NO_VERBOSE_GRANULARITY) - NHOPTP(verbose, 0, opt_out, set_in_game, Yes, Yes, Yes, Yes, NoAlias, + NHOPTP(verbose, Advanced, 0, opt_out, set_in_game, Yes, Yes, Yes, Yes, NoAlias, "suppress verbose messages") #endif #undef NoAlias diff --git a/src/cmd.c b/src/cmd.c index b89668bcb..a900746ea 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -2529,7 +2529,7 @@ struct ext_func_tab extcmdlist[] = { { 'o', "open", "open a door", doopen, 0, NULL }, { 'O', "options", "show option settings, possibly change them", - doset, IFBURIED | GENERALCMD, NULL }, + doset, IFBURIED | GENERALCMD | CMD_M_PREFIX, NULL }, /* #overview used to need autocomplete and has retained that even after being assigned to ^O [old wizard mode ^O is now #wizwhere] */ { C('o'), "overview", "show a summary of the explored dungeon", diff --git a/src/options.c b/src/options.c index 075def9ea..caa43f6c2 100644 --- a/src/options.c +++ b/src/options.c @@ -64,7 +64,7 @@ enum opt { #define NHOPT_PARSE static struct allopt_t allopt_init[] = { #include "optlist.h" - {(const char *) 0, 0, 0, 0, set_in_sysconf, BoolOpt, + {(const char *) 0, OptS_Advanced, 0, 0, 0, set_in_sysconf, BoolOpt, No, No, No, No, 0, (boolean *) 0, (int (*)(int, int, boolean, char *, char *)) 0, (char *) 0, (const char *) 0, (const char *) 0, 0, 0, 0} @@ -112,6 +112,11 @@ extern char ttycolors[CLR_MAX]; /* in sys/msdos/video.c */ static char empty_optstr[] = { '\0' }; boolean duplicate, using_alias; +static boolean give_opt_msg = TRUE; + +static NEARDATA const char *OptS_type[OptS_Advanced+1] = { + "General", "Behavior", "Map", "Status", "Advanced" +}; static const char def_inv_order[MAXOCLASSES] = { COIN_CLASS, AMULET_CLASS, WEAPON_CLASS, ARMOR_CLASS, FOOD_CLASS, @@ -297,6 +302,7 @@ static void free_one_menu_coloring(int); static int count_menucolors(void); static boolean parse_role_opts(int, boolean, const char *, char *, char **); +static int doset_simple(void); static unsigned int longest_option_name(int, int); static void doset_add_menu(winid, const char *, int, int); static int handle_add_list_remove(const char *, int); @@ -1360,7 +1366,8 @@ optfn_fruit(int optidx UNUSED, int req, boolean negated, a new fruit; it can only be nonNull if no fruits have been created since the previous name was put in place */ (void) fruitadd(g.pl_fruit, forig); - pline("Fruit is now \"%s\".", g.pl_fruit); + if (give_opt_msg) + pline("Fruit is now \"%s\".", g.pl_fruit); } /* If initial, then initoptions is allowed to do it instead * of here (initoptions always has to do it even if there's @@ -4552,8 +4559,9 @@ optfn_boolean(int optidx, int req, boolean negated, char *opts, char *op) /* boolean value has been toggled but some option changes can still be pending at this point (mainly for opt_need_redraw); give the toggled message now regardless */ - pline("'%s' option toggled %s.", allopt[optidx].name, - !negated ? "on" : "off"); + if (give_opt_msg) + pline("'%s' option toggled %s.", allopt[optidx].name, + !negated ? "on" : "off"); return optn_ok; } @@ -4745,7 +4753,7 @@ handler_autounlock(int optidx) } destroy_nhwindow(tmpwin); chngd = (flags.autounlock != oldflags); - if (chngd || Verbose(2, handler_autounlock)) { + if ((chngd || Verbose(2, handler_autounlock)) && give_opt_msg) { optfn_autounlock(optidx, get_val, FALSE, buf, (char *) NULL); pline("'%s' %s '%s'.", optname, chngd ? "changed to" : "is still", buf); @@ -7712,6 +7720,141 @@ longest_option_name(int startpass, int endpass) return longest_name_len; } +/* #options - the user friendly version */ +static int +doset_simple(void) +{ + static boolean made_fmtstr = FALSE; + char buf[BUFSZ]; + winid tmpwin; + anything any; + menu_item *pick_list; + int i, pick_cnt, pick_idx; + enum OptSection section; + boolean *bool_p; + const char *name; + + if (!made_fmtstr) { + Sprintf(fmtstr_doset, "%%s%%-%us [%%s]", + longest_option_name(set_gameview, set_in_game)); + made_fmtstr = TRUE; + } + + give_opt_msg = FALSE; +rerun: + tmpwin = create_nhwindow(NHW_MENU); + start_menu(tmpwin, MENU_BEHAVE_STANDARD); + + for (section = OptS_General; section < OptS_Advanced; section++) { + any = cg.zeroany; + if (section != OptS_General) + add_menu(tmpwin, &nul_glyphinfo, &any, 0, 0, ATR_NONE, + 0, "", MENU_ITEMFLAGS_NONE); + Sprintf(buf, " %-30s ", OptS_type[section]); + add_menu(tmpwin, &nul_glyphinfo, &any, 0, 0, + iflags.menu_headings, 0, + buf /*OptS_type[section]*/, MENU_ITEMFLAGS_NONE); + for (i = 0; (name = allopt[i].name) != 0; i++) { + if (allopt[i].section != section) + continue; + if ((is_wc_option(name) && !wc_supported(name)) + || (is_wc2_option(name) && !wc2_supported(name))) + continue; + + any.a_int = i + 1; + switch (allopt[i].opttyp) { + case BoolOpt: + bool_p = allopt[i].addr; + Sprintf(buf, fmtstr_doset, "", + name, *bool_p ? "X" : " "); + break; + case CompOpt: + case OthrOpt: + { + const char *value = "unknown"; + int reslt = optn_err; + char buf2[BUFSZ]; + + buf2[0] = '\0'; + if (allopt[i].optfn) + reslt = (*allopt[i].optfn)(allopt[i].idx, get_val, + FALSE, buf2, empty_optstr); + if (reslt == optn_ok && buf2[0]) + value = (const char *) buf2; + Sprintf(buf, fmtstr_doset, "", name, value); + } + break; + default: + Sprintf(buf, "ERROR"); + break; + } + add_menu(tmpwin, &nul_glyphinfo, &any, 0, 0, + ATR_NONE, 0, buf, MENU_ITEMFLAGS_NONE); + } + } + + end_menu(tmpwin, "Options"); + g.opt_need_redraw = FALSE; + g.opt_need_glyph_reset = FALSE; + if ((pick_cnt = select_menu(tmpwin, PICK_ONE, &pick_list)) > 0) { + for (pick_idx = 0; pick_idx < pick_cnt; ++pick_idx) { + int k = pick_list[pick_idx].item.a_int - 1; + + if (allopt[k].opttyp == BoolOpt) { + /* boolean option */ + Sprintf(buf, "%s%s", *allopt[k].addr ? "!" : "", + allopt[k].name); + (void) parseoptions(buf, FALSE, FALSE); + } else { + /* compound option */ + int reslt UNUSED; + + if (allopt[k].has_handler && allopt[k].optfn) { + reslt = (*allopt[k].optfn)(allopt[k].idx, do_handler, + FALSE, empty_optstr, + empty_optstr); + } else { + char abuf[BUFSZ]; + + Sprintf(buf, "Set %s to what?", allopt[k].name); + abuf[0] = '\0'; + getlin(buf, abuf); + if (abuf[0] == '\033') + continue; + Sprintf(buf, "%s:", allopt[k].name); + (void) strncat(eos(buf), abuf, + (sizeof buf - 1 - strlen(buf))); + /* pass the buck */ + (void) parseoptions(buf, FALSE, FALSE); + } + } + if (wc_supported(allopt[k].name) + || wc2_supported(allopt[k].name)) + preference_update(allopt[k].name); + } + free((genericptr_t) pick_list), pick_list = (menu_item *) 0; + } + destroy_nhwindow(tmpwin); + + if (g.opt_need_glyph_reset) { + reset_glyphmap(gm_optionchange); + } + if (g.opt_need_redraw) { + check_gold_symbol(); + reglyph_darkroom(); + (void) doredraw(); + } + if (g.context.botl || g.context.botlx) { + bot(); + } + + if (pick_cnt > 0) + goto rerun; + + give_opt_msg = TRUE; + return ECMD_OK; +} + /* the #options command */ int doset(void) /* changing options via menu by Per Liboriussen */ @@ -7729,6 +7872,9 @@ doset(void) /* changing options via menu by Per Liboriussen */ gavehelp = FALSE, skiphelp = !iflags.cmdassist; int clr = 0; + if (!iflags.menu_requested) + return doset_simple(); + /* if we offer '?' as a choice and it is the only thing chosen, we'll end up coming back here after showing the explanatory text */ rerun: