revise X11 highlight yn prompting

The three line change I made previously to implement highlighting for
prompts that ask for single-character input was easy and worked well
for a tiles map, but it didn't look very good for a text map.  This
handles both text map and tile map and also adds a configurable
'highlight_prompt' X resource to let the user enable or disable the
feature.  The resource template file (win/X11/NetHack.ad, copied to
$HACKDIR during install) now has it enabled by default.

The highlighting--more specifically, the "lowlighting" when no prompt
is active--still looks bad if the map window has a vertical scrollbar
on left edge.  I don't have any inspiration about how to fix that up.
This commit is contained in:
PatR
2016-02-08 16:32:07 -08:00
parent 518e067e82
commit c8aa84337b
4 changed files with 60 additions and 12 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 winX.h $NHDT-Date: 1454455159 2016/02/02 23:19:19 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.21 $ */
/* NetHack 3.6 winX.h $NHDT-Date: 1454977916 2016/02/09 00:31:56 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.22 $ */
/* Copyright (c) Dean Luick, 1992 */
/* NetHack may be freely redistributed. See license for details. */
@@ -244,9 +244,10 @@ E boolean exit_x_event; /* exit condition for event loop */
E int click_x, click_y, click_button, updated_inventory;
typedef struct {
Boolean slow;
Boolean autofocus;
Boolean message_line;
Boolean slow; /* issue prompts between map and message wins */
Boolean autofocus; /* grab pointer focus for popup windows */
Boolean message_line; /* separate current turn mesgs from prev ones */
Boolean highlight_prompt; /* if 'slow', highlight yn prompts */
Boolean double_tile_size; /* double tile size */
String tile_file; /* name of file to open for tiles */
String icon; /* name of desired icon */
@@ -290,6 +291,7 @@ E Boolean FDECL(nhApproxColor, (Screen *, Colormap, char *, XColor *));
E Dimension FDECL(nhFontHeight, (Widget));
E char FDECL(key_event_to_char, (XKeyEvent *));
E void FDECL(msgkey, (Widget, XtPointer, XEvent *));
E void FDECL(highlight_yn, (BOOLEAN_P));
E void FDECL(nh_XtPopup, (Widget, int, Widget));
E void FDECL(nh_XtPopdown, (Widget));
E void FDECL(win_X11_init, (int));