tty role selection - 'random' default
Instead of just using 'random' as the default choice if the user hits <return> when picking role, race, gender, or alignment, flag it as pre-selected in the menu so that it can be seen to be the default. Someday somebody is going to have to fix up the interaction between PICK_ONE menu and pre-selected choice....
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 role.c $NHDT-Date: 1450320155 2015/12/17 02:42:35 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.35 $ */
|
||||
/* NetHack 3.6 role.c $NHDT-Date: 1453514597 2016/01/23 02:03:17 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.36 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985-1999. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -1809,9 +1809,10 @@ winid where;
|
||||
|
||||
/* add a "pick alignment first"-type entry to the specified menu */
|
||||
void
|
||||
role_menu_extra(which, where)
|
||||
role_menu_extra(which, where, preselect)
|
||||
int which;
|
||||
winid where;
|
||||
boolean preselect;
|
||||
{
|
||||
static NEARDATA const char RS_menu_let[] = {
|
||||
'=', /* name */
|
||||
@@ -1941,11 +1942,11 @@ winid where;
|
||||
} else if (which == ROLE_RANDOM) {
|
||||
any.a_int = ROLE_RANDOM;
|
||||
add_menu(where, NO_GLYPH, &any, '*', 0, ATR_NONE, "Random",
|
||||
MENU_UNSELECTED);
|
||||
preselect ? MENU_SELECTED : MENU_UNSELECTED);
|
||||
} else if (which == ROLE_NONE) {
|
||||
any.a_int = ROLE_NONE;
|
||||
add_menu(where, NO_GLYPH, &any, 'q', 0, ATR_NONE, "Quit",
|
||||
MENU_UNSELECTED);
|
||||
preselect ? MENU_SELECTED : MENU_UNSELECTED);
|
||||
} else {
|
||||
impossible("role_menu_extra: bad arg (%d)", which);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user