From bb57bf16f16d8121e048247035eb0afefb2d8e6f Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 19 Feb 2021 00:24:45 -0800 Subject: [PATCH] 'O' feedback for booleans 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 | 3 ++- src/options.c | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/doc/fixes37.0 b/doc/fixes37.0 index 5878627e6..177a4a0e8 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -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 diff --git a/src/options.c b/src/options.c index 497573c46..caa0484fc 100644 --- a/src/options.c +++ b/src/options.c @@ -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) { -- 2.50.1