]> granicus.if.org Git - nethack/commitdiff
tty: selecting gold in menus
authorPatR <rankin@nethack.org>
Sun, 22 Nov 2020 02:21:16 +0000 (18:21 -0800)
committerPatR <rankin@nethack.org>
Sun, 22 Nov 2020 02:21:16 +0000 (18:21 -0800)
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...

doc/fixes37.0
win/tty/wintty.c

index aa20413660328f0e56e02c119f565ad25719c172..1d1f74d7f75c43808b92155bcd371aa8f4fd8853 100644 (file)
@@ -1,4 +1,4 @@
-NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.359 $ $NHDT-Date: 1606008997 2020/11/22 01:36:37 $
+NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.360 $ $NHDT-Date: 1606011660 2020/11/22 02:21:00 $
 
 General Fixes and Modified Features
 -----------------------------------
@@ -506,6 +506,7 @@ Qt+OSX: since menu entry help->"About Qt NetHack" gets hijacked and becomes
 tiles: add indicator of thonged portion to aklys tile
 tty: role and race selection menus weren't filtering out potential choices
        which got excluded by OPTIONS=align:!lawful or !neutral or !chaotic
+tty: '$' can now select gold in a menu even when it isn't on current page
 Unix: when user name is used as default character name, keep hyphenated value
        intact instead stripping off dash and whatever follows as if that
        specified role/race/&c (worked once upon a time; broken since 3.3.0)
index 44445f761068a49b4104acaa6e9e49d1e3dd3b53..05bcfbca4a9a0ba0c672c6e874b7ec757a6716e4 100644 (file)
@@ -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)) {