curses persistent inventory window tweak

Under curses interface, provide a way to get a little more space
for perm_invent without turning off windowborders entirely.

Possible 'windowborders' values:
 0 = no borders, max screen space available for useful info
 1 = full borders, two lines and two columns wasted for each window
 2 = contingent borders, show if screen is big enough, else hide
New:
 3 = as 1 except no borders for perm_invent window
 4 = as 2 except never borders for perm_invent window

3 and 4 let the map, message, and status windows have borders while
providing two extra lines and two extra columns on each line for
persistent inventory.  It's not much but better than nothing when
borders are enabled.
This commit is contained in:
PatR
2021-02-08 16:34:29 -08:00
parent e411dce04f
commit 71bb01c328
8 changed files with 86 additions and 67 deletions

View File

@@ -3742,13 +3742,15 @@ optfn_windowborders(int optidx, int req, boolean negated, char *opts, char *op)
itmp = 0; /* Off */
else if (op == empty_optstr)
itmp = 1; /* On */
else /* Value supplied; expect 0 (off), 1 (on), or 2 (auto) */
else /* Value supplied; expect 0 (off), 1 (on), 2 (auto)
* or 3 (on for most windows, off for perm_invent)
* or 4 (auto for most windows, off for perm_invent) */
itmp = atoi(op);
if (itmp < 0 || itmp > 2) {
config_error_add("Invalid %s (should be 0, 1, or 2): %s",
if (itmp < 0 || itmp > 4) {
config_error_add("Invalid %s (should be within 0 to 4): %s",
allopt[optidx].name, opts);
retval = optn_err;
retval = optn_silenterr;
} else {
iflags.wc2_windowborders = itmp;
}
@@ -3762,7 +3764,11 @@ optfn_windowborders(int optidx, int req, boolean negated, char *opts, char *op)
(iflags.wc2_windowborders == 0) ? "0=off"
: (iflags.wc2_windowborders == 1) ? "1=on"
: (iflags.wc2_windowborders == 2) ? "2=auto"
: defopt);
: (iflags.wc2_windowborders == 3)
? "3=on, except off for perm_invent"
: (iflags.wc2_windowborders == 4)
? "4=auto, except off for perm_invent"
: defopt);
return optn_ok;
}
return optn_ok;