diff --git a/include/extern.h b/include/extern.h index 02bf047aa..49af9d19e 100644 --- a/include/extern.h +++ b/include/extern.h @@ -3442,6 +3442,8 @@ extern void add_menu(winid, const glyph_info *, const ANY_P *, char, char, int, int, const char *, unsigned int); extern void add_menu_heading(winid, const char *); extern void add_menu_str(winid, const char *); +extern int select_menu(winid, int, menu_item **); + extern void getlin(const char *, char *); /* ### windows.c ### */ diff --git a/include/winprocs.h b/include/winprocs.h index 24c09b991..40e68a6b8 100644 --- a/include/winprocs.h +++ b/include/winprocs.h @@ -125,13 +125,15 @@ extern #define putmixed (*windowprocs.win_putmixed) #define display_file (*windowprocs.win_display_file) #define start_menu (*windowprocs.win_start_menu) -/* 3.7: There is a real add_menu() in the core now, which does - * some common activities, such as menu_colors. - * add_menu() is in windows.c +#define end_menu (*windowprocs.win_end_menu) +/* 3.7: There are real add_menu() and select_menu + * in the core now. + * add_menu does some common activities, such as menu_colors. + * select_menu does some before and after activities. + * add_menu() and select_menu() are in windows.c */ /* #define add_menu (*windowprocs.win_add_menu) */ -#define end_menu (*windowprocs.win_end_menu) -#define select_menu (*windowprocs.win_select_menu) +/* #define select_menu (*windowprocs.win_select_menu) */ #define message_menu (*windowprocs.win_message_menu) #define mark_synch (*windowprocs.win_mark_synch) diff --git a/src/options.c b/src/options.c index 479fe24dd..de04e2ceb 100644 --- a/src/options.c +++ b/src/options.c @@ -8739,7 +8739,8 @@ doset(void) /* changing options via menu by Per Liboriussen */ menu_item *pick_list; int indexoffset, startpass, endpass; boolean setinitial = FALSE, fromfile = FALSE, - gavehelp = FALSE, skiphelp = !iflags.cmdassist; + gavehelp = FALSE, skiphelp = !iflags.cmdassist, + save_bot_disabled; int clr = NO_COLOR; if (iflags.menu_requested) { @@ -8874,6 +8875,8 @@ doset(void) /* changing options via menu by Per Liboriussen */ end_menu(tmpwin, "Set what options?"); go.opt_need_redraw = FALSE; go.opt_need_glyph_reset = FALSE; + save_bot_disabled = gb.bot_disabled; + gb.bot_disabled = TRUE; if ((pick_cnt = select_menu(tmpwin, PICK_ANY, &pick_list)) > 0) { /* * Walk down the selection list and either invert the booleans @@ -8930,6 +8933,7 @@ doset(void) /* changing options via menu by Per Liboriussen */ } destroy_nhwindow(tmpwin); + gb.bot_disabled = save_bot_disabled; if (pick_cnt == 1 && gavehelp) { /* when '?' is only the thing selected, go back and pick all diff --git a/src/windows.c b/src/windows.c index ccd4477ee..ff442ade7 100644 --- a/src/windows.c +++ b/src/windows.c @@ -1679,6 +1679,17 @@ get_menu_coloring(const char *str, int *color, int *attr) return FALSE; } +int select_menu(winid window, int how, menu_item **menu_list) +{ + int reslt; + boolean old_bot_disabled = gb.bot_disabled; + + gb.bot_disabled = TRUE; + reslt = (*windowprocs.win_select_menu)(window, how, menu_list); + gb.bot_disabled = old_bot_disabled; + return reslt; +} + void getlin(const char *query, register char *bufp) {