From: Pasi Kallinen Date: Fri, 8 Jan 2016 20:17:37 +0000 (+0200) Subject: TTY: Add menu_overlay option X-Git-Tag: NetHack-3.6.1_RC01~1056 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=befc6a65b50068b46e44f2f1139d71d8e7c81d67;p=nethack TTY: Add menu_overlay option This was a request from a blind player. It's hard to find the left edge of the menu when it's drawn on the map, so clear the screen and align menus to the left edge of the screen when this option is turned off. Originally this was called the window edge patch. --- diff --git a/dat/opthelp b/dat/opthelp index c378e618c..60531aae5 100644 --- a/dat/opthelp +++ b/dat/opthelp @@ -22,6 +22,7 @@ implicit_uncursed omit "uncursed" from inventory, if possible [TRUE] legacy print introductory message [TRUE] lit_corridor show a dark corridor as lit if in sight [FALSE] lootabc use a/b/c rather than o/i/b when looting [FALSE] +menu_overlay overlay menus on the screen and align to right [TRUE] mail enable the mail daemon [TRUE] null allow nulls to be sent to your terminal [TRUE] try turning this option off (forcing NetHack to use its own diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index 2efd8bbf2..aa06e40c4 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -2218,6 +2218,10 @@ Default '>'. .lp menu_objsyms Show object symbols in menu headings in menus where the object symbols act as menu accelerators (default off). +.lp menu_overlay +Do not clear the screen before drawing menus, and align +menus to the right edge of the screen. Only for the tty port. +(default on) .lp menu_previous_page Menu character accelerator to goto the previous menu page. Implemented by the Amiga, Gem and tty ports. diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index cbb63f7a0..849476ef2 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -2664,6 +2664,10 @@ Default `\verb+>+'. \item[\ib{menu\verb+_+objsyms}] Show object symbols in menu headings in menus where the object symbols act as menu accelerators (default off). +\item[\ib{menu\verb+_+overlay}] +Do not clear the screen before drawing menus, and align +menus to the right edge of the screen. Only for the tty port. +(default on) \item[\ib{menu\verb+_+previous\verb+_+page}] Menu character accelerator to goto the previous menu page. Implemented by the Amiga, Gem and tty ports. diff --git a/doc/fixes36.1 b/doc/fixes36.1 index 7e29a0101..a58c4c95e 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -150,6 +150,7 @@ database entries for Cleaver, Sunsword, Frost and Fire brands, and Platform- and/or Interface-Specific New Features ------------------------------------------------ +tty: menu_overlay -option to clear screen and align menus to left NetHack Community Patches (or Variation) Included diff --git a/include/flag.h b/include/flag.h index bd6d2b2fc..a55591a13 100644 --- a/include/flag.h +++ b/include/flag.h @@ -199,6 +199,7 @@ struct instance_flags { boolean mention_walls; /* give feedback when bumping walls */ boolean menu_tab_sep; /* Use tabs to separate option menu fields */ boolean menu_head_objsym; /* Show obj symbol in menu headings */ + boolean menu_overlay; /* Draw menus over the map */ boolean menu_requested; /* Flag for overloaded use of 'm' prefix * on some non-move commands */ boolean renameallowed; /* can change hero name during role selection */ diff --git a/src/options.c b/src/options.c index f706d2c0a..0e5332038 100644 --- a/src/options.c +++ b/src/options.c @@ -149,6 +149,11 @@ static struct Bool_Opt { /* for menu debugging only*/ { "menu_tab_sep", &iflags.menu_tab_sep, FALSE, SET_IN_WIZGAME }, { "menu_objsyms", &iflags.menu_head_objsym, FALSE, SET_IN_GAME }, +#ifdef TTY_GRAPHICS + { "menu_overlay", &iflags.menu_overlay, TRUE, SET_IN_GAME }, +#else + { "menu_overlay", (boolean *) 0, FALSE, SET_IN_FILE }, +#endif { "mouse_support", &iflags.wc_mouse_support, TRUE, DISP_IN_GAME }, /*WC*/ #ifdef NEWS { "news", &iflags.news, TRUE, DISP_IN_GAME }, diff --git a/win/tty/wintty.c b/win/tty/wintty.c index 58dee65a3..0690f8e24 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -2108,13 +2108,15 @@ boolean blocking; /* with ttys, all windows are blocking */ if (ttyDisplay->toplin == 1) tty_display_nhwindow(WIN_MESSAGE, TRUE); #ifdef H2344_BROKEN - if (cw->maxrow >= (int) ttyDisplay->rows) + if (cw->maxrow >= (int) ttyDisplay->rows + || !iflags.menu_overlay) #else - if (cw->offx == 10 || cw->maxrow >= (int) ttyDisplay->rows) + if (cw->offx == 10 || cw->maxrow >= (int) ttyDisplay->rows + || !iflags.menu_overlay) #endif { cw->offx = 0; - if (cw->offy) { + if (cw->offy || iflags.menu_overlay) { tty_curs(window, 1, 0); cl_eos(); } else