NHOPTO("menu colors", o_menu_colors, BUFSZ, opt_in, set_in_game,
No, Yes, No, NoAlias, "edit menu colors")
NHOPTC(menuinvertmode, 5, opt_in, set_in_game, No, Yes, No, No, NoAlias,
- "behaviour of menu iverts")
+ "experimental behaviour of menu inverts")
NHOPTC(menustyle, MENUTYPELEN, opt_in, set_in_game, Yes, Yes, No, Yes,
NoAlias, "user interface for object selection")
NHOPTO("message types", o_message_types, BUFSZ, opt_in, set_in_game,
-/* NetHack 3.7 invent.c $NHDT-Date: 1629409876 2021/08/19 21:51:16 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.339 $ */
+/* NetHack 3.7 invent.c $NHDT-Date: 1647472704 2022/03/16 23:18:24 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.355 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
Sprintf(eos(prompt), " (%s for all)",
visctrl(iflags.override_ID));
add_menu(win, &nul_glyphinfo, &any, '_', iflags.override_ID,
- ATR_NONE, prompt, MENU_ITEMFLAGS_NONE);
+ ATR_NONE, prompt, MENU_ITEMFLAGS_SKIPINVERT);
gotsomething = TRUE;
}
} else if (xtra_choice) {
-/* 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. */
/* 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);
-/* NetHack 3.7 windows.c $NHDT-Date: 1612127121 2021/01/31 21:05:21 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.82 $ */
+/* NetHack 3.7 windows.c $NHDT-Date: 1647472699 2022/03/16 23:18:19 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.86 $ */
/* Copyright (c) D. Cohrs, 1993. */
/* NetHack may be freely redistributed. See license for details. */
* logic into one place instead of 7 different window-port routines.
*/
boolean
-menuitem_invert_test(int mode,
- unsigned itemflags, /* The itemflags for the item */
- boolean is_selected) /* The current selection status
- of the item */
+menuitem_invert_test(
+ int mode UNUSED, /* 0: invert; 1: set; 2: unset */
+ unsigned itemflags, /* itemflags for the item */
+ boolean is_selected) /* current selection status of the item */
{
boolean skipinvert = (itemflags & MENU_ITEMFLAGS_SKIPINVERT) != 0;
- if ((iflags.menuinvertmode == 1 || iflags.menuinvertmode == 2)
- && !mode && skipinvert && !is_selected)
- return FALSE;
- else if (iflags.menuinvertmode == 2
- && !mode && skipinvert && is_selected)
- return TRUE;
- else
+ if (!skipinvert) /* if not flagged SKIPINVERT, always pass test */
return TRUE;
+ /*
+ * mode 0: inverting current on/off state;
+ * 1: unconditionally setting on;
+ * 2: unconditionally setting off.
+ * menuinvertmode 0: treat entries flagged with skipinvert as ordinary
+ * (same as if not flagged);
+ * menuinvertmode 1: don't toggle bulk invert or bulk set entries On
+ * (allow such toggling or setting to change to Off);
+ * menuinvertmode 2: don't toggle skipinvert entries either On or Off
+ * when a bulk change is performed.
+ */
+ if (iflags.menuinvertmode == 2) {
+ return FALSE;
+ } else if (iflags.menuinvertmode == 1) {
+ return is_selected ? TRUE : FALSE;
+ }
+ return TRUE;
}
/*windows.c*/