From: PatR Date: Sun, 7 Feb 2016 02:00:27 +0000 (-0800) Subject: X11 highlight yn prompting X-Git-Tag: NetHack-3.6.1_RC01~945 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5229260f6bce7bde661497b4e405b83c77d69ec1;p=nethack X11 highlight yn prompting For the 'slow' config (prompting for single-char input done on a fixed line at the top of the map rather than via a popup window), invert the background and foreground when creating it so that it looks like part of the map, then invert again when a prompt is active in order to highlight that prompt. --- diff --git a/win/X11/winX.c b/win/X11/winX.c index f5b67ded2..93d8ca2cc 100644 --- a/win/X11/winX.c +++ b/win/X11/winX.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 winX.c $NHDT-Date: 1454637315 2016/02/05 01:55:15 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.36 $ */ +/* NetHack 3.6 winX.c $NHDT-Date: 1454810422 2016/02/07 02:00:22 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.37 $ */ /* Copyright (c) Dean Luick, 1992 */ /* NetHack may be freely redistributed. See license for details. */ @@ -1836,6 +1836,7 @@ char def; /* default response if user hits or */ * handler and reset its label to be the prompt text (below). */ input_func = yn_key; + swap_fg_bg(yn_label); /* highlight the prompt line */ } else if (!yn_label) { /* * Not 'slow'; create a persistent widget that will be popped up @@ -1887,6 +1888,7 @@ char def; /* default response if user hits or */ num_args = 0; XtSetArg(args[num_args], XtNlabel, " "); num_args++; XtSetValues(yn_label, args, num_args); + swap_fg_bg(yn_label); /* un-highlight the prompt line */ } else { nh_XtPopdown(yn_popup); /* this removes the event grab */ } @@ -2027,6 +2029,9 @@ init_standard_windows() XtSetArg(args[num_args], nhStr(XtNresizable), True); num_args++; XtSetArg(args[num_args], nhStr(XtNlabel), " "); num_args++; XtSetValues(yn_label, args, num_args); + /* switch foreground and background so that the prompt line looks + like part of the map */ + swap_fg_bg(yn_label); } /*