replace getenv("TTYINV") with perminv_mode option

Add a new option 'perminv_mode' to augment perm_invent.  It handles
the same choices as the temporary TTYINV method:  show all items other
than gold, show full inventory including gold, or only show in-use
items (similar to the '*' command).

For tty, both the all-except-gold and full-inventory modes can add
the poorly named 'sparse' variation which populates unused slots in
its fixed grid with the inventory letter that would go in each.

For others, the default has been changed from full-inventory to
all-except-gold.  Note that gold is treated as part of 'all' or of
'in-use' if it is quivered because having the amount be shown on the
status line doesn't make that redundant.

Changing the default may mess up WinGUI if it assumes that perm_invent
is full inventory with gold.

Initially I was going to change perm_invent into a compound but this
leaves it as an on/off toggle and adds perminv_mode as a separate
option for how to show the inventory when the toggle is on.  It may
make sense to combine them since dual controls is a little confusing,
but right now setting perm_invent On when perminv_mode is 'none'
changes that to 'all' and changing perminv_mode away from 'none' when
perm_invent is Off toggles it to On.

Guidebook.mn has been updated but as usual Guidebook.tex is lagging.
This commit is contained in:
PatR
2023-11-05 02:31:26 -08:00
parent e16f80395b
commit 2ee7509945
8 changed files with 369 additions and 79 deletions

View File

@@ -271,7 +271,7 @@ struct instance_flags {
boolean menu_tab_sep; /* Use tabs to separate option menu fields */
boolean news; /* print news */
boolean num_pad; /* use numbers for movement commands */
boolean perm_invent; /* keep full inventories up until dismissed */
boolean perm_invent; /* display persistent inventory window */
boolean renameallowed; /* can change hero name during role selection */
boolean renameinprogress; /* we are changing hero name */
boolean sounds; /* master on/off switch for using soundlib */
@@ -292,7 +292,14 @@ struct instance_flags {
* compression of levels when writing savefile */
schar ice_rating; /* ice_descr()'s classification of ice terrain */
schar prev_decor; /* 'mention_decor' just mentioned this */
uchar num_pad_mode;
uchar num_pad_mode; /* for num_pad==True, controls how 5 behaves
* and/or 789456123 vs phone-style 123456789;
* for False, qwertY vs qwertZ */
uchar perminv_mode; /* what to display in persistent invent window
* 0: nothing, 1: all inventory except gold,
* 2: full including gold, 8: in-use items only,
* 5|6: 1|2 with invent letters shown in empty
* slots (TTY only: 'sparse' modes) */
uchar bouldersym; /* symbol for boulder display */
char prevmsg_window; /* type of old message window to use */
boolean extmenu; /* extended commands use menu interface */