From 7e452018a6a9618d33b1173dbe223ec8682e4baa Mon Sep 17 00:00:00 2001 From: nhmall Date: Fri, 23 Feb 2024 09:32:50 -0500 Subject: [PATCH] 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. --- doc/fixes3-7-0.txt | 4 ++++ win/win32/mhmenu.c | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 03cbc7bd1..72d362ff2 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -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 diff --git a/win/win32/mhmenu.c b/win/win32/mhmenu.c index defdedbe4..fe53bab0a 100644 --- a/win/win32/mhmenu.c +++ b/win/win32/mhmenu.c @@ -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); } }