'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.
This commit is contained in:
PatR
2021-02-19 00:24:45 -08:00
parent f480803970
commit bb57bf16f1
2 changed files with 10 additions and 2 deletions

View 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

View 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) {