Windows GUI: vertical menu row spacing for tiles

The menus in nethackw.exe were being spaced according to the vertical
tile size of custom tiles, but the tiles were being rendered in menus
at the default size anyway, resulting in unnecessary gaps between menu
rows.

Use the default size of 16 for the vertical spacing calculation.
This commit is contained in:
nhmall
2024-02-23 09:32:50 -05:00
parent 4478200964
commit 7e452018a6
2 changed files with 10 additions and 2 deletions

View File

@@ -1965,6 +1965,10 @@ Windows: when VIRTUAL_TERMINAL_SEQUENCES was not defined, the preprocessing
Windows: original fix for GLYPH_UNEXPLORED background tile merging resulted
in a new issue where the map wasn't being cleared on level changes
Windows: don't dupstr the return value of setlocale if it is NULL
Windows: nethackw.exe was vertically spacing out menu items based on
the height of the tileset in use, even though the tiles in the
menu were drawn at the default height of 16 anyway; get rid of
the extraneous vertical spacing between the menu rows
X11: fix build failure if STATUS_HILITES is disabled
X11: was still initializing map to 'stone' instead of 'unexplored' after they
became separate glyphs

View File

@@ -972,14 +972,18 @@ onMeasureItem(HWND hWnd, WPARAM wParam, LPARAM lParam)
/* Set the height of the list box items to max height of the individual
* items */
for (i = 0; i < data->menui.menu.size; i++) {
/* int map_y = GetNHApp()->mapTile_Y; */
int map_y = 16; /* leave it at the default size, unless
* we are actually showing the larger
* icons in the menu */
if (NHMENU_HAS_GLYPH(data->menui.menu.items[i])
&& !IS_MAP_ASCII(iflags.wc_map_mode)) {
lpmis->itemHeight =
max(lpmis->itemHeight,
(UINT) max(tm.tmHeight, GetNHApp()->mapTile_Y) + 2);
(UINT) max(tm.tmHeight, map_y) + 2);
} else {
lpmis->itemHeight =
max(lpmis->itemHeight, (UINT) max(tm.tmHeight, TILE_Y) + 2);
max(lpmis->itemHeight, (UINT) max(tm.tmHeight, map_y) + 2);
}
}