alternative to display_inventory for window-port

Several window ports that support perm_invent were
using a call back to the core display_inventory()
function.

While calling from the window port back to core functions
is arguably not ideal in the first place, it was recently
brought to light that code NetHack-3.7 code changes to
display_inventory() actually caused it to stop repopulating
the perm_invent window as intended under certain circumstances.

For now, provide an alternative function, repopulate_perminvent(),
that hopefullshould still work the way it did previously.

There will likely be some additional changes after this to
further improve things, at some point.

For now though, this
Resolves #1454
This commit is contained in:
nhmall
2025-11-08 14:26:07 -05:00
parent 6fa324d52a
commit d5658018ac
8 changed files with 21 additions and 9 deletions

View File

@@ -284,7 +284,7 @@ update_inventory(arg)
-- For an argument of 0:
-- Indicate to the window port that the inventory has
been changed.
-- Merely calls display_inventory() for window-ports
-- Merely calls repopulate_perminvent() for window-ports
that leave the window up, otherwise empty.
-- or for a non-zero argument:
-- Prompts the user for a menu scrolling action and
@@ -1001,6 +1001,10 @@ char display_inventory(lets, want_reply)
-- Calls a start_menu()/add_menu()/select_menu() sequence.
It returns the item selected, or '\0' if none is selected.
Returns '\033' if the menu was canceled.
void repopulate_perminvent(void)
-- a minimal alternative to display_inventory() that
focuses only on repopulating the permanent inventory
window.
raw_printf(str, ...)
-- Like raw_print(), but accepts arguments like printf(). This
routine processes the arguments and then calls raw_print().