window port interface change - add mbehavior flags to start_menu()

Provide a way to communicate additional behaviors and/or appearances
desired from NetHack window port menus.

This is foundation work for changes to follow at a future date.
This commit is contained in:
nhmall
2020-02-20 20:12:51 -05:00
parent 8e6e4922f8
commit d81c096ce6
55 changed files with 170 additions and 134 deletions

View File

@@ -569,7 +569,7 @@ tty_player_selection()
tty_clear_nhwindow(BASE_WINDOW);
role_selection_prolog(RS_ROLE, BASE_WINDOW);
win = create_nhwindow(NHW_MENU);
start_menu(win);
start_menu(win, MENU_BEHAVE_STANDARD);
/* populate the menu with role choices */
setup_rolemenu(win, TRUE, RACE, GEND, ALGN);
/* add miscellaneous menu entries */
@@ -666,7 +666,7 @@ tty_player_selection()
tty_clear_nhwindow(BASE_WINDOW);
role_selection_prolog(RS_RACE, BASE_WINDOW);
win = create_nhwindow(NHW_MENU);
start_menu(win);
start_menu(win, MENU_BEHAVE_STANDARD);
any = cg.zeroany; /* zero out all bits */
/* populate the menu with role choices */
setup_racemenu(win, TRUE, ROLE, GEND, ALGN);
@@ -758,7 +758,7 @@ tty_player_selection()
tty_clear_nhwindow(BASE_WINDOW);
role_selection_prolog(RS_GENDER, BASE_WINDOW);
win = create_nhwindow(NHW_MENU);
start_menu(win);
start_menu(win, MENU_BEHAVE_STANDARD);
any = cg.zeroany; /* zero out all bits */
/* populate the menu with gender choices */
setup_gendmenu(win, TRUE, ROLE, RACE, ALGN);
@@ -848,7 +848,7 @@ tty_player_selection()
tty_clear_nhwindow(BASE_WINDOW);
role_selection_prolog(RS_ALGNMNT, BASE_WINDOW);
win = create_nhwindow(NHW_MENU);
start_menu(win);
start_menu(win, MENU_BEHAVE_STANDARD);
any = cg.zeroany; /* zero out all bits */
setup_algnmenu(win, TRUE, ROLE, RACE, GEND);
role_menu_extra(ROLE_RANDOM, win, TRUE);
@@ -927,7 +927,7 @@ tty_player_selection()
tty_clear_nhwindow(BASE_WINDOW);
role_selection_prolog(ROLE_NONE, BASE_WINDOW);
win = create_nhwindow(NHW_MENU);
start_menu(win);
start_menu(win, MENU_BEHAVE_STANDARD);
any = cg.zeroany; /* zero out all bits */
any.a_int = 0;
if (!roles[ROLE].name.f
@@ -1030,7 +1030,7 @@ reset_role_filtering()
menu_item *selected = 0;
win = create_nhwindow(NHW_MENU);
start_menu(win);
start_menu(win, MENU_BEHAVE_STANDARD);
any = cg.zeroany;
/* no extra blank line preceding this entry; end_menu supplies one */
@@ -1456,6 +1456,7 @@ int type;
newwin->mlist = (tty_menu_item *) 0;
newwin->plist = (tty_menu_item **) 0;
newwin->npages = newwin->plist_size = newwin->nitems = newwin->how = 0;
newwin->mbehavior = 0U;
switch (type) {
case NHW_BASE:
/* base window, used for absolute movement on the screen */
@@ -2907,9 +2908,11 @@ boolean complain;
}
void
tty_start_menu(window)
tty_start_menu(window, mbehavior)
winid window;
unsigned long mbehavior;
{
wins[window]->mbehavior = mbehavior;
tty_clear_nhwindow(window);
return;
}