I’ve been meaning to add tall inventory listings to my adv3Lite-based WIP, and banged out this tonight:
modify gameMain
/** Global switch for enabling tall inventory listings. */
useTallInventory = nil
;
/**
* Customize ItemLister to support tall listings.
*/
modify ItemLister
/** Enable tall listings. */
useTall = nil
showList(lst, pl, paraCnt) {
if (useTall)
showTallList(lst, pl, paraCnt);
else
inherited(lst, pl, paraCnt);
}
showTallList(lst, pl, paraCnt) {
"<br>\t<<lst.mapAll({ o: listName(o) }).join('<br>\t')>><br><br>";
}
;
/**
* Customize inventoryLister for tall listings.
*/
modify inventoryLister
useTall = (gameMain.useTallInventory)
showListPrefix(lst, pl, paraCnt) {
if (!useTall)
inherited(lst, pl, paraCnt);
else if (paraCnt == 0)
"{I} {am} carrying ";
else
"and carrying ";
}
showListSuffix(lst, pl, paraCnt) {
if (!useTall)
inherited(lst, pl, paraCnt);
}
;
/**
* Customize wornLister for tall listings.
*/
modify wornLister
useTall = (gameMain.useTallInventory)
;
…then, in your game’s gameMain
, set useTallInventory = true
.
Note that this doesn’t perform a tall listing within a tall listing. In other words, if the player is carrying a container with items in it, the top-level inventory is tall but the sub-contents are not:
You are wearing
a T-shirt
and carrying
a stick of gum
a rubber ball
a lunch box (in which are a sandwich and a Thermos)
Embedded tall listings could be done, but it would require adding tabs depending on how deep the listing has gone. I’m happy with the above presentation, though, especially since my game doesn’t have deep containers in the player’s inventory.
The formatting could be tweaked in other ways too, depending on what you’re looking for, but the above is a start.