Merge 'curses-mouse_support' into NetHack-3.6

Fully support the mouse_support option for curses, via 'O' as well as
via config file.  At the moment, mouse_support:1 and mouse_support:2
are equivalent.

Also, fix the screen-to-map coordinate translation.  When the mouse
is active and over the map, the pointer's cursor becomes a cross-hair
(may very by platform) and the character cell chosen for a click
seems to be a few pixels to the right of the center of the '+'.
This commit is contained in:
PatR
2019-06-28 03:08:30 -07:00
7 changed files with 53 additions and 14 deletions
+5
View File
@@ -26,6 +26,9 @@ extern long curs_mesg_suppress_turn; /* from cursmesg.c */
struct window_procs curses_procs = {
"curses",
(WC_ALIGN_MESSAGE | WC_ALIGN_STATUS | WC_COLOR | WC_HILITE_PET
#ifdef NCURSES_MOUSE_VERSION /* (this macro name works for PDCURSES too) */
| WC_MOUSE_SUPPORT
#endif
| WC_PERM_INVENT | WC_POPUP_DIALOG | WC_SPLASH_SCREEN),
(WC2_DARKGRAY | WC2_HITPOINTBAR
#if defined(STATUS_HILITES)
@@ -906,6 +909,8 @@ curses_preference_update(const char *pref)
redo_status = TRUE;
else if (!strcmp(pref, "align_message"))
redo_main = TRUE;
else if (!strcmp(pref, "mouse_support"))
curses_mouse_support(iflags.wc_mouse_support);
if (redo_main || redo_status)
curs_reset_windows(redo_main, redo_status);