]> granicus.if.org Git - nethack/commitdiff
'O' feedback for booleans
authorPatR <rankin@nethack.org>
Fri, 19 Feb 2021 08:24:45 +0000 (00:24 -0800)
committerPatR <rankin@nethack.org>
Fri, 19 Feb 2021 08:24:45 +0000 (00:24 -0800)
Give a message for each boolean option toggled via 'O'.  It may
help catch mistakes sooner if/when player types wrong menu letter.

Only applies to 'O', not booleans manipulated during config file
or NETHACKOPTIONS processing.

doc/fixes37.0
src/options.c

index 5878627e62e4404c554aa7ddbcf933b5d1c619e1..177a4a0e852ca86f97d2a63f893d730958dd80be 100644 (file)
@@ -1,4 +1,4 @@
-NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.455 $ $NHDT-Date: 1613721260 2021/02/19 07:54:20 $
+NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.456 $ $NHDT-Date: 1613723080 2021/02/19 08:24:40 $
 
 General Fixes and Modified Features
 -----------------------------------
@@ -795,6 +795,7 @@ add bonesless to extended conducts field in xlogfile
 show bones levels information in enlightenment at end of game or in explore
        and wizmode
 for #wizintrinsic, use any counts entered during menu selection
+give feedback when boolean options are toggled interactively ('O' command)
 
 
 Platform- and/or Interface-Specific New Features
index 497573c46fa972df28af0826a782933aa3adb67a..caa0484fca7e946a44951b922240d14f57fc54d6 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.7 options.c       $NHDT-Date: 1613721262 2021/02/19 07:54:22 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.507 $ */
+/* NetHack 3.7 options.c       $NHDT-Date: 1613723080 2021/02/19 08:24:40 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.508 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Michael Allison, 2008. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -4279,6 +4279,13 @@ optfn_boolean(int optidx, int req, boolean negated, char *opts, char *op)
             iflags.prev_decor = STONE;
             break;
         }
+
+        /* 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");
+
         return optn_ok;
     }
     if (req == get_val) {