move some parts of TTY_PERM_INVENT into core

This starts the tty perm_invent just in time later in the
startup rather than initializing it with the other
game windows.

This also splits the duties:

The core will inquire from the window port about how many
inventory slots it can fill.

The core will handle figuring out the inventory text and
inventory letters, and will do the traversing of internal
data structures like obj chains, and passing customization
options on to the window port.

The window port will look after placing each inventory slot's
text at an appropriate location on the screen.

This, in theory, makes the core-portion available for
window ports other than tty to use, though none currently do.
The decision of what goes in an inventory slot is all left up
to the core with the update_invent_slot interface.

Documentation updates will come later, not at this time.
This commit is contained in:
nhmall
2022-06-24 15:01:38 -04:00
parent 90e7fdaa4b
commit 18b28084f8
9 changed files with 422 additions and 109 deletions

View File

@@ -1174,6 +1174,7 @@ extern long count_contents(struct obj *, boolean, boolean, boolean, boolean);
extern void carry_obj_effects(struct obj *);
extern const char *currency(long);
extern void silly_thing(const char *, struct obj *);
extern void core_update_invent_slot(void);
/* ### ioctl.c ### */