more interactive !pickup_types

More on clearing pickup_types so that autopickup reverts to picking up
evertyhing:  for menustyle:Full and Partial, add a menu entry for 'all
classes' as an alternative to unselecting every class already set.

Also, Full and Partial had no way to include venom.  Now it's a choice
when in wizard mode.  There's still no way--other than switching to
Traditional or Combination--during normal play (where venom objects can
exist if they were wished for in wizard mode and then left in bones).
This commit is contained in:
PatR
2018-12-13 17:33:46 -08:00
parent bdae51503c
commit d18ddb2c95
2 changed files with 24 additions and 1 deletions

View File

@@ -268,6 +268,9 @@ if levitating hero poly'd into pass-wall creature jumped or teleported from
blocking of levitation wasn't updated properly
clairvoyance revealing underwater or under-lava objects left object displayed
instead of restoring the water or lava
make it easier to clear 'pickup_types' (menustyles Traditional and Combination
could do so by setting it to 'a'; now ' ' works too; Full and Partial
allowed unselecting every object class; now 'all classes' is a choice)
Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 options.c $NHDT-Date: 1544748881 2018/12/14 00:54:41 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.345 $ */
/* NetHack 3.6 options.c $NHDT-Date: 1544751219 2018/12/14 01:33:39 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.346 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2008. */
/* NetHack may be freely redistributed. See license for details. */
@@ -3001,6 +3001,8 @@ boolean tinitial, tfrom_file;
use_menu = TRUE;
}
if (use_menu) {
if (wizard && !index(ocl, VENOM_SYM))
strkitten(ocl, VENOM_SYM);
(void) choose_classes_menu("Autopickup what?", 1, TRUE, ocl,
tbuf);
op = tbuf;
@@ -6329,10 +6331,28 @@ char *class_select;
break;
}
}
if (category == 1 && next_accelerator <= 'z') {
/* for objects, add "A - ' ' all classes", after a separator */
any = zeroany;
add_menu(win, NO_GLYPH, &any, 0, 0, ATR_NONE, "", MENU_UNSELECTED);
any.a_int = (int) ' ';
Sprintf(buf, "%c %s", (char) any.a_int, "all classes of objects");
/* we won't preselect this even if the incoming list is empty;
having it selected means that it would have to be explicitly
de-selected in order to select anything else */
add_menu(win, NO_GLYPH, &any, 'A', 0, ATR_NONE, buf, MENU_UNSELECTED);
}
end_menu(win, prompt);
n = select_menu(win, way ? PICK_ANY : PICK_ONE, &pick_list);
destroy_nhwindow(win);
if (n > 0) {
/* first check for 'all'; it means 'use a blank list'
rather than 'collect every possible choice' */
for (i = 0; i < n; ++i)
if (pick_list[i].item.a_int == ' ') {
pick_list[0].item.a_int = ' ';
n = 1; /* return 1; also an implicit 'break;' */
}
for (i = 0; i < n; ++i)
*class_select++ = (char) pick_list[i].item.a_int;
free((genericptr_t) pick_list);