]> granicus.if.org Git - nethack/commitdiff
m #optionsfull
authorPatR <rankin@nethack.org>
Fri, 19 Aug 2022 14:03:35 +0000 (07:03 -0700)
committerPatR <rankin@nethack.org>
Fri, 19 Aug 2022 14:03:35 +0000 (07:03 -0700)
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.

doc/Guidebook.mn
doc/Guidebook.tex
src/cmd.c
src/options.c

index b6ca695b23fac5eedfecb28d2979540aab9e9fc9..20f50eeb0c4e4dfb4caa5953d7cc2d615b823f6c 100644 (file)
@@ -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
index 5eb1467acc78a3f5f9162d5c8de298537f68bcb1..fb6c653ee3e2a83a5804274571067e67d1d2429c 100644 (file)
@@ -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
index db8bc8a3f5b9b2e63a7685d4f4359ec0b8742619..719e3ead9b3a8f25b285b1db25a84fc1241a3b05 100644 (file)
--- 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",
index bf4e75762a782445af5a0a13c43c7e1fa3d9787c..0ce353274539a9dae0bc2aace157c14edd1a1644 100644 (file)
@@ -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: