Merge branch 'NetHack-3.6.2'

This commit is contained in:
nhmall
2018-11-04 17:30:16 -05:00
19 changed files with 689 additions and 124 deletions

View File

@@ -202,6 +202,9 @@ boolean init;
static int numlines = 0;
struct xwindow *wp = &window_list[WIN_MESSAGE];
if (init)
curr = (struct line_element *) 0;
if (!curr) {
curr = wp->mesg_information->head;
numlines = 0;
@@ -1920,35 +1923,38 @@ char *input;
/* Display file ----------------------------------------------------------- */
/* uses a menu (with no selectors specified) rather than a text window
to allow previous_page and first_menu actions to move backwards */
void
X11_display_file(str, complain)
const char *str;
boolean complain;
{
dlb *fp;
winid newwin;
struct xwindow *wp;
anything any;
menu_item *menu_list;
#define LLEN 128
char line[LLEN];
/* Use the port-independent file opener to see if the file exists. */
fp = dlb_fopen(str, RDTMODE);
if (!fp) {
if (complain)
pline("Cannot open %s. Sorry.", str);
return; /* it doesn't exist, ignore */
}
winid newwin = X11_create_nhwindow(NHW_MENU);
struct xwindow *wp = &window_list[newwin];
anything any = zeroany;
menu_item *menu_list;
newwin = X11_create_nhwindow(NHW_MENU);
wp = &window_list[newwin];
X11_start_menu(newwin);
any = zeroany;
while (dlb_fgets(line, LLEN, fp)) {
X11_add_menu(newwin, NO_GLYPH, &any, 0, 0, ATR_NONE, line, MENU_UNSELECTED);
X11_add_menu(newwin, NO_GLYPH, &any, 0, 0, ATR_NONE,
line, MENU_UNSELECTED);
}
(void) dlb_fclose(fp);
/* show file name as the window title */

View File

@@ -254,7 +254,8 @@ Cardinal *num_params;
return;
}
if (menu_info->is_active && menu_info->how != PICK_NONE) { /* waiting for input */
/* don't exclude PICK_NONE menus; doing so disables scrolling via keys */
if (menu_info->is_active) { /* waiting for input */
/* first check for an explicit selector match, so that it won't be
overridden if it happens to duplicate a mapped menu command (':'
to look inside a container vs ':' to select via search string) */
@@ -324,12 +325,14 @@ Cardinal *num_params;
} else if (ch == MENU_FIRST_PAGE || ch == MENU_LAST_PAGE) {
Widget hbar = (Widget) 0, vbar = (Widget) 0;
float top = (ch == MENU_FIRST_PAGE) ? 0.0 : 1.0;
find_scrollbars(wp->w, &hbar, &vbar);
if (vbar)
XtCallCallbacks(vbar, XtNjumpProc, &top);
return;
} else if (ch == MENU_NEXT_PAGE || ch == MENU_PREVIOUS_PAGE) {
Widget hbar = (Widget) 0, vbar = (Widget) 0;
find_scrollbars(wp->w, &hbar, &vbar);
if (vbar) {
float shown, top;
@@ -1029,7 +1032,9 @@ Widget form,under;
num_args = 0;
XtSetArg(args[num_args], nhStr(XtNfromVert), label); num_args++;
XtSetArg(args[num_args], nhStr(XtNfromHoriz), ok); num_args++;
#if 0 /* [cancel] is a viable choice even for PICK_NONE */
XtSetArg(args[num_args], nhStr(XtNsensitive), how != PICK_NONE); num_args++;
#endif
XtSetArg(args[num_args], nhStr(XtNtop), XtChainTop); num_args++;
XtSetArg(args[num_args], nhStr(XtNbottom), XtChainTop); num_args++;
XtSetArg(args[num_args], nhStr(XtNleft), XtChainLeft); num_args++;

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 topl.c $NHDT-Date: 1490908468 2017/03/30 21:14:28 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.36 $ */
/* NetHack 3.6 topl.c $NHDT-Date: 1540934784 2018/10/30 21:26:24 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.38 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2009. */
/* NetHack may be freely redistributed. See license for details. */
@@ -637,7 +637,7 @@ boolean init;
*
* It's also called by the quest pager code when a block message
* has a one-line summary specified. We put that line directly
* message history for ^P recall without having displayed it.
* into message history for ^P recall without having displayed it.
*/
void
tty_putmsghistory(msg, restoring_msghist)