Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2

This commit is contained in:
nhmall
2018-09-20 18:45:08 -04:00
68 changed files with 765 additions and 294 deletions

View File

@@ -2906,7 +2906,7 @@ int NetHackQtMenuWindow::SelectMenu(int h, MENU_ITEM_P **menu_list)
if (dialog->result()<0)
qApp->enter_loop();
}
//if ( (nhid != WIN_INVEN || !flags.perm_invent) ) // doesn't work yet
//if ( (nhid != WIN_INVEN || !iflags.perm_invent) ) // doesn't work yet
{
dialog->hide();
}
@@ -4840,7 +4840,7 @@ void NetHackQtBind::qt_update_inventory()
if (main)
main->updateInventory();
/* doesn't work yet
if (program_state.something_worth_saving && flags.perm_invent)
if (program_state.something_worth_saving && iflags.perm_invent)
display_inventory(NULL, FALSE);
*/
}

View File

@@ -401,7 +401,7 @@ void NetHackQtBind::qt_update_inventory()
if (main)
main->updateInventory();
/* doesn't work yet
if (program_state.something_worth_saving && flags.perm_invent)
if (program_state.something_worth_saving && iflags.perm_invent)
display_inventory(NULL, false);
*/
}

View File

@@ -2404,7 +2404,7 @@ void
nh_XtPopup(w, g, childwid)
Widget w; /* widget */
int g; /* type of grab */
Widget childwid; /* child to recieve focus (can be None) */
Widget childwid; /* child to receive focus (can be None) */
{
XtPopup(w, (XtGrabKind) g);
XSetWMProtocols(XtDisplay(w), XtWindow(w), &wm_delete_window, 1);

View File

@@ -826,7 +826,7 @@ menu_item **menu_list;
* each time.
*/
if (menu_info->valid_widgets
&& (window != WIN_INVEN || !flags.perm_invent)) {
&& (window != WIN_INVEN || !iflags.perm_invent)) {
XtDestroyWidget(wp->popup);
menu_info->valid_widgets = FALSE;
menu_info->is_up = FALSE;

View File

@@ -702,7 +702,7 @@ identifier
outside of the standard accelerator (see above) or a
number. If 0, the item is unaffected by any group
accelerator. If this accelerator conflicts with
the menu command (or their user defined alises), it loses.
the menu command (or their user defined aliases), it loses.
The menu commands and aliases take care not to interfere
with the default object class symbols.
-- If you want this choice to be preselected when the

View File

@@ -700,7 +700,7 @@ mswin_layout_main_window(HWND changed_child)
GetNHApp()->rtInvenWindow.bottom = GetNHApp()->rtMenuWindow.bottom;
/* adjust map window size only if perm_invent is set */
if (flags.perm_invent)
if (iflags.perm_invent)
GetNHApp()->rtMapWindow.right = GetNHApp()->rtMenuWindow.left;
}
@@ -712,7 +712,7 @@ mswin_layout_main_window(HWND changed_child)
/* kludge - inventory window should have its own type (same as
menu-text
as a matter of fact) */
if (flags.perm_invent && i == WIN_INVEN) {
if (iflags.perm_invent && i == WIN_INVEN) {
mswin_get_window_placement(NHW_INVEN, &rt);
} else {
mswin_get_window_placement(GetNHApp()->windowlist[i].type,

View File

@@ -251,7 +251,7 @@ mswin_menu_window_select_menu(HWND hWnd, int how, MENU_ITEM_P **_selected,
/* If we just used the permanent inventory window to pick something,
* set the menu back to its display inventory state.
*/
if (flags.perm_invent && mswin_winid_from_handle(hWnd) == WIN_INVEN
if (iflags.perm_invent && mswin_winid_from_handle(hWnd) == WIN_INVEN
&& how != PICK_NONE) {
data->menu.prompt[0] = '\0';
SetMenuListType(hWnd, PICK_NONE);
@@ -322,7 +322,7 @@ MenuWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
GetWindowRect(hWnd, &rt);
ScreenToClient(GetNHApp()->hMainWnd, (LPPOINT) &rt);
ScreenToClient(GetNHApp()->hMainWnd, ((LPPOINT) &rt) + 1);
if (flags.perm_invent && mswin_winid_from_handle(hWnd) == WIN_INVEN)
if (iflags.perm_invent && mswin_winid_from_handle(hWnd) == WIN_INVEN)
mswin_update_window_placement(NHW_INVEN, &rt);
else
mswin_update_window_placement(NHW_MENU, &rt);
@@ -334,7 +334,7 @@ MenuWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
GetWindowRect(hWnd, &rt);
ScreenToClient(GetNHApp()->hMainWnd, (LPPOINT) &rt);
ScreenToClient(GetNHApp()->hMainWnd, ((LPPOINT) &rt) + 1);
if (flags.perm_invent && mswin_winid_from_handle(hWnd) == WIN_INVEN)
if (iflags.perm_invent && mswin_winid_from_handle(hWnd) == WIN_INVEN)
mswin_update_window_placement(NHW_INVEN, &rt);
else
mswin_update_window_placement(NHW_MENU, &rt);

View File

@@ -1102,7 +1102,7 @@ identifier
outside of the standard accelerator (see above) or a
number. If 0, the item is unaffected by any group
accelerator. If this accelerator conflicts with
the menu command (or their user defined alises), it loses.
the menu command (or their user defined aliases), it loses.
The menu commands and aliases take care not to interfere
with the default object class symbols.
-- If you want this choice to be preselected when the
@@ -1194,7 +1194,7 @@ mswin_select_menu(winid wid, int how, MENU_ITEM_P **selected)
ShowWindow(GetNHApp()->windowlist[wid].win, SW_SHOW);
nReturned = mswin_menu_window_select_menu(
GetNHApp()->windowlist[wid].win, how, selected,
!(flags.perm_invent && wid == WIN_INVEN
!(iflags.perm_invent && wid == WIN_INVEN
&& how == PICK_NONE) /* don't activate inventory window if
perm_invent is on */
);
@@ -1211,7 +1211,7 @@ void
mswin_update_inventory()
{
logDebug("mswin_update_inventory()\n");
if (flags.perm_invent && program_state.something_worth_saving
if (iflags.perm_invent && program_state.something_worth_saving
&& iflags.window_inited && WIN_INVEN != WIN_ERR)
display_inventory(NULL, FALSE);
}
@@ -2118,6 +2118,7 @@ initMapTiles(void)
HBITMAP hBmp;
BITMAP bm;
TCHAR wbuf[MAX_PATH];
DWORD errcode;
int tl_num;
SIZE map_size;
extern int total_tiles_used;
@@ -2131,8 +2132,13 @@ initMapTiles(void)
NH_A2W(iflags.wc_tile_file, wbuf, MAX_PATH),
IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_DEFAULTSIZE);
if (hBmp == NULL) {
raw_print(
"Cannot load tiles from the file. Reverting back to default.");
char errmsg[BUFSZ];
errcode = GetLastError();
Sprintf(errmsg, "%s (0x%x).",
"Cannot load tiles from the file. Reverting back to default",
errcode);
raw_print(errmsg);
return FALSE;
}
@@ -2243,7 +2249,7 @@ mswin_popup_destroy(HWND hWnd)
DrawMenuBar(GetNHApp()->hMainWnd);
/* Don't hide the permanent inventory window ... leave it showing */
if (!flags.perm_invent || mswin_winid_from_handle(hWnd) != WIN_INVEN)
if (!iflags.perm_invent || mswin_winid_from_handle(hWnd) != WIN_INVEN)
ShowWindow(hWnd, SW_HIDE);
GetNHApp()->hPopupWnd = NULL;