From: PatR Date: Fri, 19 Aug 2022 14:03:35 +0000 (-0700) Subject: m #optionsfull X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=50665d10f2753f6f6a0568f032c415ed2520606c;p=nethack m #optionsfull Preceding #options or the key bound to that with m runs 'advanced' options. Implement the inverse: preceding #optionsfull or the key bound to that with m now runs 'simple' options. --- diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index b6ca695b2..20f50eeb0 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -1391,8 +1391,12 @@ 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" +.lp #optionsfull Show advanced game option settings. +No default key. +Precede with the \(oqm\(cq prefix to execute the simpler options command. +(Mainly useful if you use \f(CRBINDING=O:optionsfull\fP to switch +\(oq\f(CRO\fP\(cq from simple options back to traditional 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 5eb1467ac..fb6c653ee 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -1504,6 +1504,10 @@ Precede with the {\tt m} prefix to show advanced options. %.lp \item[\tb{\#optionsfull}] Show advanced game option settings. +No default key. +Precede with the `{\tt m}' prefix to execute the simpler options command. +(Mainly useful if you use {\tt BINDING=O:optionsfull} to switch +`{\tt O}' from simple options back to traditional advanced options.) %.lp \item[\tb{\#overview}] Display information you've discovered about the dungeon. Any visited diff --git a/src/cmd.c b/src/cmd.c index db8bc8a3f..719e3ead9 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -2552,10 +2552,12 @@ struct ext_func_tab extcmdlist[] = { dosacrifice, AUTOCOMPLETE | CMD_M_PREFIX, NULL }, { 'o', "open", "open a door", doopen, 0, NULL }, + /* 'm #options' runs doset() */ { 'O', "options", "show option settings", doset_simple, IFBURIED | GENERALCMD | CMD_M_PREFIX, NULL }, + /* 'm #optionsfull' runs doset_simple() */ { '\0', "optionsfull", "show all 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 bf4e75762..0ce353274 100644 --- a/src/options.c +++ b/src/options.c @@ -7895,8 +7895,12 @@ doset_simple(void) boolean *bool_p; const char *name; - if (iflags.menu_requested) + if (iflags.menu_requested) { + /* doset() checks for 'm' and calls doset_simple(); clear the + menu-requested flag to avoid doing that recursively */ + iflags.menu_requested = FALSE; return doset(); + } if (!made_fmtstr) { Sprintf(fmtstr_doset, "%%s%%-%us [%%s]", @@ -8054,6 +8058,13 @@ doset(void) /* changing options via menu by Per Liboriussen */ gavehelp = FALSE, skiphelp = !iflags.cmdassist; int clr = 0; + if (iflags.menu_requested) { + /* doset_simple() checks for 'm' and calls doset(); clear the + menu-requested flag to avoid doing that recursively */ + iflags.menu_requested = FALSE; + 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: