tty: selecting gold in menus
Requested by a beta tester nearly four years ago: '$' is both an inventory "letter" and a group accelator. The letter only works if gold is on the current menu page and was taking precedence over the group accelator. Allow '$' to toggle selection of gold regardless of the page. curses already behaves this way. X11 and Qt menus aren't paginated so also pick gold even if the '$' entry in the menu isn't visible at the time. No idea about Windows GUI...
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.7 wintty.c $NHDT-Date: 1596498345 2020/08/03 23:45:45 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.259 $ */
|
||||
/* NetHack 3.7 wintty.c $NHDT-Date: 1606011660 2020/11/22 02:21:00 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.263 $ */
|
||||
/* Copyright (c) David Cohrs, 1991 */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -1922,7 +1922,12 @@ struct WinDesc *cw;
|
||||
|
||||
if (n > 0) /* at least one group accelerator found */
|
||||
for (rp = gacc, curr = cw->mlist; curr; curr = curr->next)
|
||||
if (curr->gselector && curr->gselector != curr->selector
|
||||
if (curr->gselector
|
||||
&& (curr->gselector != curr->selector
|
||||
/* '$' is both a selector "letter" and a group
|
||||
accelerator; including it in gacc allows gold to
|
||||
be selected via group when not on current page */
|
||||
|| curr->gselector == GOLD_SYM)
|
||||
&& !index(gacc, curr->gselector)
|
||||
&& (cw->how == PICK_ANY
|
||||
|| gcnt[GSELIDX(curr->gselector)] == 1)) {
|
||||
|
||||
Reference in New Issue
Block a user