From: Pasi Kallinen Date: Wed, 3 Aug 2022 16:18:41 +0000 (+0300) Subject: Add optionsfull extended command X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bfd262ebe8ae005aa5d76121ac9f8652600ab3da;p=nethack Add optionsfull extended command This is the previous, full options list. Adding it as an extended command, so users can do BIND=O:optionsfull to go back to the old behaviour. --- diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index 720ba5535..f30ab2762 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -1388,6 +1388,8 @@ Default key is \(oqo\(cq. Show and change option settings. Default key is \(oqO\(cq. Precede with the \(oqm\(cq prefix to show advanced options. +.lp "#optionsfull" +Show advanced game option settings. .lp #overview Display information you've discovered about the dungeon. Any visited diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index 5c9ad975a..7530ce3dd 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -1498,6 +1498,9 @@ Open a door. Default key is `{\tt o}'. Show and change option settings. Default key is `{\tt O}'. Precede with the {\tt m} prefix to show advanced options. %.lp +\item[\tb{\#optionsfull}] +Show advanced game option settings. +%.lp \item[\tb{\#overview}] Display information you've discovered about the dungeon. Any visited level (unless forgotten due to amnesia) with an annotation is included, diff --git a/include/extern.h b/include/extern.h index ce9f9e9cc..40817593d 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1954,6 +1954,7 @@ extern void initoptions_init(void); extern void initoptions_finish(void); extern boolean parseoptions(char *, boolean, boolean); extern char *get_option_value(const char *); +extern int doset_simple(void); extern int doset(void); extern int dotogglepickup(void); extern void option_help(void); diff --git a/src/cmd.c b/src/cmd.c index a900746ea..7f3efa760 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -58,6 +58,7 @@ extern int doclose(void); /**/ extern int dosh(void); /**/ extern int dodiscovered(void); /**/ extern int doclassdisco(void); /**/ +extern int doset_simple(void); /**/ extern int doset(void); /**/ extern int dotogglepickup(void); /**/ extern int dowhatis(void); /**/ @@ -2528,8 +2529,10 @@ struct ext_func_tab extcmdlist[] = { dosacrifice, AUTOCOMPLETE | CMD_M_PREFIX, NULL }, { 'o', "open", "open a door", doopen, 0, NULL }, - { 'O', "options", "show option settings, possibly change them", - doset, IFBURIED | GENERALCMD | CMD_M_PREFIX, NULL }, + { 'O', "options", "show option settings", + doset_simple, IFBURIED | GENERALCMD | CMD_M_PREFIX, NULL }, + { '\0', "optionsfull", "show all option settings, possibly change them", + doset, IFBURIED | GENERALCMD, 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 caa43f6c2..2d8c54581 100644 --- a/src/options.c +++ b/src/options.c @@ -302,7 +302,6 @@ 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); @@ -7721,7 +7720,7 @@ longest_option_name(int startpass, int endpass) } /* #options - the user friendly version */ -static int +int doset_simple(void) { static boolean made_fmtstr = FALSE; @@ -7734,6 +7733,9 @@ doset_simple(void) boolean *bool_p; const char *name; + if (iflags.menu_requested) + return doset(); + if (!made_fmtstr) { Sprintf(fmtstr_doset, "%%s%%-%us [%%s]", longest_option_name(set_gameview, set_in_game)); @@ -7855,7 +7857,7 @@ rerun: return ECMD_OK; } -/* the #options command */ +/* the #optionsfull command */ int doset(void) /* changing options via menu by Per Liboriussen */ { @@ -7872,9 +7874,6 @@ 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: