]> granicus.if.org Git - nethack/commitdiff
Add optionsfull extended command
authorPasi Kallinen <paxed@alt.org>
Wed, 3 Aug 2022 16:18:41 +0000 (19:18 +0300)
committerPasi Kallinen <paxed@alt.org>
Wed, 3 Aug 2022 16:18:44 +0000 (19:18 +0300)
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.

doc/Guidebook.mn
doc/Guidebook.tex
include/extern.h
src/cmd.c
src/options.c

index 720ba553510af0e65ed27f0c48bfd69c9d47c975..f30ab276285ba0c6b389144200696afe4d0c6faa 100644 (file)
@@ -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
index 5c9ad975afee3a750e02a9e1a325c756ad7c61cc..7530ce3dd9fa87b42a3c00ea53055ddcd0007ead 100644 (file)
@@ -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,
index ce9f9e9ccd710aa65d7d020acd7e8bbb40f90209..40817593d4ddd9bbff0d6e1d5c01e16a40df0160 100644 (file)
@@ -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);
index a900746eaf57dc43af1439bc1c038e622e7f59c9..7f3efa76078ff5b89fb6d825dafe367d3d93e5ca 100644 (file)
--- 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",
index caa43f6c2d5f87f657b66f5fe8fe462c217b2d23..2d8c54581eedfeb6e407132bd80d29b0d6590ef7 100644 (file)
@@ -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: