Enable TTY_PERM_INVENT
The permanent inventory will be automatically shown if the terminal size allows. But only output an error message if the player requested it via perm_invent option.
This commit is contained in:
@@ -562,7 +562,7 @@ typedef unsigned char uchar;
|
|||||||
|
|
||||||
/* An experimental minimalist inventory list capability under tty if you have
|
/* An experimental minimalist inventory list capability under tty if you have
|
||||||
* at least 28 additional rows beneath the status window on your terminal */
|
* at least 28 additional rows beneath the status window on your terminal */
|
||||||
/* #define TTY_PERM_INVENT */
|
#define TTY_PERM_INVENT
|
||||||
|
|
||||||
/* NetHack will execute an external program whenever a new message-window
|
/* NetHack will execute an external program whenever a new message-window
|
||||||
* message is shown. The program to execute is given in environment variable
|
* message is shown. The program to execute is given in environment variable
|
||||||
|
|||||||
@@ -636,7 +636,7 @@ display_gamewindows(void)
|
|||||||
start_menu(WIN_INVEN, 0U), end_menu(WIN_INVEN, (char *) 0);
|
start_menu(WIN_INVEN, 0U), end_menu(WIN_INVEN, (char *) 0);
|
||||||
|
|
||||||
#ifdef TTY_PERM_INVENT
|
#ifdef TTY_PERM_INVENT
|
||||||
if (WINDOWPORT("tty") && iflags.perm_invent) {
|
if (WINDOWPORT("tty")) {
|
||||||
g.tty_invent_win = create_nhwindow(NHW_TTYINVENT);
|
g.tty_invent_win = create_nhwindow(NHW_TTYINVENT);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1625,23 +1625,29 @@ tty_create_nhwindow(int type)
|
|||||||
|
|
||||||
if (newwin->rows < tty_pi_minrow) {
|
if (newwin->rows < tty_pi_minrow) {
|
||||||
tty_destroy_nhwindow(newid);
|
tty_destroy_nhwindow(newid);
|
||||||
raw_printf("tty perm_invent has been disabled.");
|
if (iflags.perm_invent) {
|
||||||
raw_printf(
|
raw_printf("tty perm_invent has been disabled.");
|
||||||
"tty perm_invent requires %d rows, your terminal has %d.",
|
raw_printf(
|
||||||
(iflags.wc2_statuslines > 2) ? 54 : 53, ttyDisplay->rows);
|
"tty perm_invent requires %d rows, your terminal has %d.",
|
||||||
iflags.perm_invent = FALSE;
|
(iflags.wc2_statuslines > 2) ? 54 : 53, ttyDisplay->rows);
|
||||||
|
iflags.perm_invent = FALSE;
|
||||||
|
}
|
||||||
return WIN_ERR;
|
return WIN_ERR;
|
||||||
} else if (newwin->cols < tty_pi_mincol) {
|
} else if (newwin->cols < tty_pi_mincol) {
|
||||||
tty_destroy_nhwindow(newid);
|
tty_destroy_nhwindow(newid);
|
||||||
raw_printf("tty perm_invent has been disabled.");
|
if (iflags.perm_invent) {
|
||||||
raw_printf(
|
raw_printf("tty perm_invent has been disabled.");
|
||||||
"tty perm_invent requires %d columns, your terminal has %d.",
|
raw_printf(
|
||||||
tty_pi_mincol, ttyDisplay->cols);
|
"tty perm_invent requires %d columns, your terminal has %d.",
|
||||||
iflags.perm_invent = FALSE;
|
tty_pi_mincol, ttyDisplay->cols);
|
||||||
|
iflags.perm_invent = FALSE;
|
||||||
|
}
|
||||||
return WIN_ERR;
|
return WIN_ERR;
|
||||||
} else {
|
} else {
|
||||||
int r, c;
|
int r, c;
|
||||||
|
|
||||||
|
iflags.perm_invent = TRUE;
|
||||||
|
|
||||||
newwin->maxrow = tty_pi_minrow;
|
newwin->maxrow = tty_pi_minrow;
|
||||||
newwin->maxcol = newwin->cols;
|
newwin->maxcol = newwin->cols;
|
||||||
/* establish the borders */
|
/* establish the borders */
|
||||||
|
|||||||
Reference in New Issue
Block a user