]> granicus.if.org Git - nethack/commitdiff
TTY: Add menu_overlay option
authorPasi Kallinen <paxed@alt.org>
Fri, 8 Jan 2016 20:17:37 +0000 (22:17 +0200)
committerPasi Kallinen <paxed@alt.org>
Fri, 8 Jan 2016 20:17:40 +0000 (22:17 +0200)
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.

dat/opthelp
doc/Guidebook.mn
doc/Guidebook.tex
doc/fixes36.1
include/flag.h
src/options.c
win/tty/wintty.c

index c378e618cf59be6fce5e8f86fecfa04028da1f14..60531aae5225d6f4dded9e5507a817676e4cf75a 100644 (file)
@@ -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
index 2efd8bbf247e8641eec74f442ee351e6c66e38a8..aa06e40c466dd6334aecbad53253ecd38b5e51de 100644 (file)
@@ -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.
index cbb63f7a0b9683a8b206b49bf2cca53a68979d90..849476ef24b8f5437eb12764c7cc9a0879482008 100644 (file)
@@ -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.
index 7e29a0101869a13a79a8257389c803c8d0f3e7a3..a58c4c95e47103a5ed75bfe02e777c3c3419e014 100644 (file)
@@ -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
index bd6d2b2fc85b811884118330feb9cc3176aa889a..a55591a13b1dfdbf0275bce74bf9962511e373d2 100644 (file)
@@ -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 */
index f706d2c0a1037af7e1834d9261cc91a5a3ce642d..0e53320384e8509f92a5b9912a24c0fec6af347e 100644 (file)
@@ -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 },
index 58dee65a3bb9e2d7f7caa5b41c7ec09f3736a12d..0690f8e24c5aa3679e2270a25b64e26bf1070870 100644 (file)
@@ -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