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:
@@ -12,10 +12,6 @@
|
||||
#include <signal.h>
|
||||
#endif
|
||||
|
||||
#ifdef TTY_PERM_INVENT
|
||||
#include "wintty.h" /* just for define of NHW_TTYINVENT */
|
||||
#endif
|
||||
|
||||
static void moveloop_preamble(boolean);
|
||||
static void u_calc_moveamt(int);
|
||||
#ifdef POSITIONBAR
|
||||
@@ -635,11 +631,6 @@ display_gamewindows(void)
|
||||
ever having been used, use it here to pacify the Qt interface */
|
||||
start_menu(WIN_INVEN, 0U), end_menu(WIN_INVEN, (char *) 0);
|
||||
|
||||
#ifdef TTY_PERM_INVENT
|
||||
if (WINDOWPORT("tty") && iflags.perm_invent) {
|
||||
g.tty_invent_win = create_nhwindow(NHW_TTYINVENT);
|
||||
}
|
||||
#endif
|
||||
#ifdef MAC
|
||||
/* This _is_ the right place for this - maybe we will
|
||||
* have to split display_gamewindows into create_gamewindows
|
||||
@@ -659,11 +650,7 @@ display_gamewindows(void)
|
||||
display_nhwindow(WIN_MESSAGE, FALSE);
|
||||
clear_glyph_buffer();
|
||||
display_nhwindow(WIN_MAP, FALSE);
|
||||
#ifdef TTY_PERM_INVENT
|
||||
if (g.tty_invent_win != WIN_ERR)
|
||||
display_nhwindow(g.tty_invent_win, FALSE);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
newgame(void)
|
||||
|
||||
Reference in New Issue
Block a user