menuinvertmode

Change the 'menuinvertmode' default from 0 to 1 so that it gets more
exercise.  It can be changed back to 0 via option settings but it's
doubtful that anyone will care enough to bother.

Some pickup/take-off actions have been using it to avoid setting
their 'all' choice when bulk toggling for current-page or whole-menu
takes place; 'O' specifies it for its '?' help choice.  This adds
the skipinvert flag to the 'all' choice of #wizidentify.

The comments describing it now state that menuinvertmode applies to
bulk set-on operations as well as to toggle-on/off operations but
that will only be true if/when interfaces call menuitem_invert_test()
for set as well as for invert.  tty is about to start doing that.
This commit is contained in:
PatR
2022-03-16 16:19:30 -07:00
parent 7f484815e5
commit 5db6dac863
4 changed files with 40 additions and 16 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 options.c $NHDT-Date: 1645000577 2022/02/16 08:36:17 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.540 $ */
/* NetHack 3.7 options.c $NHDT-Date: 1647472681 2022/03/16 23:18:01 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.542 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2008. */
/* NetHack may be freely redistributed. See license for details. */
@@ -5838,6 +5838,19 @@ initoptions_init(void)
/* only used by curses */
iflags.wc2_windowborders = 2; /* 'Auto' */
/*
* A few menus have certain items (typically operate-on-everything or
* change-subset or sort or help entries) flagged as 'skip-invert' to
* control how whole-page and whole-menu operations affect them.
* 'menuinvertmode' controls how that functions:
* 0: ignore 'skip-invert' flag on menu items (used to be the default);
* 1: don't toggle 'skip-invert' items On for set-all/set-page/invert-
* all/invert-page but do toggle Off if already set (default);
* 2: don't toggle 'skip-invert' items either On of Off for set-all/
* set-page/unset-all/unset-page/invert-all/invert-page.
*/
iflags.menuinvertmode = 1;
/* since this is done before init_objects(), do partial init here */
objects[SLIME_MOLD].oc_name_idx = SLIME_MOLD;
nmcpy(g.pl_fruit, OBJ_NAME(objects[SLIME_MOLD]), PL_FSIZ);