]> granicus.if.org Git - nethack/commitdiff
provisional fix for bz239 - '[tty] Enter key...'
authorPatR <rankin@nethack.org>
Wed, 6 Jan 2016 08:07:54 +0000 (00:07 -0800)
committerPatR <rankin@nethack.org>
Wed, 6 Jan 2016 08:07:54 +0000 (00:07 -0800)
'... inconsistency in character creation menus'.

During role selection, the final 'is this ok?' menu has 'yes'
preselected so accepted <return> or <enter> to answer yes.  The
pick-role, pick-race, &c menus prior to getting to that stage didn't
have a default, so using <enter> meant nothing was chosen, and choosing
nothing was treated as a request to quit.  This changes that so it's a
request for 'random' instead.

'Provisional fix' because it ought to do this by making 'random' be a
pre-selected menu entry so that the default choice is visible.  But
that takes more effort than I'm inclined to expend on this.

doc/fixes36.1
win/tty/wintty.c

index eae8a53ff150ef056443487ce7b5af9d922d65ef..dee5ca5247d98094441f9b34fc33e10735ac0f25 100644 (file)
@@ -100,6 +100,8 @@ tty: M-N gave "Unknown command 'M-" with "'." finishing the sentence on the
        line below it, leaving bogus '.' displayed on the top row of the map
 tty: specifying all four of role, race, gender, and alignment still prompted
        for confirmation with "Is this ok?" before starting play
+tty: responding with <return> or <enter> duing role, race, &c selection
+       behaved same as <escape> to quit; now it will pick [random] instead
 unix/X11: in top level Makefile, some commented out definitions of VARDATND
        misspelled pilemark.xbm (as pilemark.xpm)
 unix/tty: fix compile warning about 'has_colors' for some configurations
index 96cc9b1eeee7dc2cb6b1dd0787be8e0e823aaee2..58dee65a3bb9e2d7f7caa5b41c7ec09f3736a12d 100644 (file)
@@ -441,7 +441,8 @@ makepicks:
                     Strcpy(pbuf, "Pick a role or profession");
                     end_menu(win, pbuf);
                     n = select_menu(win, PICK_ONE, &selected);
-                    choice = (n == 1) ? selected[0].item.a_int : ROLE_NONE;
+                    choice = (n == 1) ? selected[0].item.a_int
+                           : (n == 0) ? ROLE_RANDOM : ROLE_NONE;
                     if (selected)
                         free((genericptr_t) selected), selected = 0;
                     destroy_nhwindow(win);
@@ -526,7 +527,7 @@ makepicks:
                         end_menu(win, pbuf);
                         n = select_menu(win, PICK_ONE, &selected);
                         choice = (n == 1) ? selected[0].item.a_int
-                                          : ROLE_NONE;
+                               : (n == 0) ? ROLE_RANDOM : ROLE_NONE;
                         if (selected)
                             free((genericptr_t) selected), selected = 0;
                         destroy_nhwindow(win);
@@ -615,7 +616,7 @@ makepicks:
                         end_menu(win, pbuf);
                         n = select_menu(win, PICK_ONE, &selected);
                         choice = (n == 1) ? selected[0].item.a_int
-                                          : ROLE_NONE;
+                               : (n == 0) ? ROLE_RANDOM : ROLE_NONE;
                         if (selected)
                             free((genericptr_t) selected), selected = 0;
                         destroy_nhwindow(win);
@@ -700,7 +701,7 @@ makepicks:
                         end_menu(win, pbuf);
                         n = select_menu(win, PICK_ONE, &selected);
                         choice = (n == 1) ? selected[0].item.a_int
-                                          : ROLE_NONE;
+                               : (n == 0) ? ROLE_RANDOM : ROLE_NONE;
                         if (selected)
                             free((genericptr_t) selected), selected = 0;
                         destroy_nhwindow(win);