-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Rework inventory capacity summary #83953
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Add pocket_constraint and some supporting utility Fix various compiler errors due to missing args Clean up hoarder morale Remove previously commented code Remove volume-related _with_tweaks
Adjust displayed pockets when only restricted pockets free
Fix capacity displayed in insert & container menu when target has flexible top-level pockets Improve coloring again
Change weight label for containers, insert menu
|
For future PRs, please consider splitting it into multiple smaller PRs, it makes it many times easier to review than when all renaming, refactors and bugfixes are crammed into a single, dense PR I read the PR, and didn't spot any obvious issues other than what was reported by CI, but i am notably not a good code reader |
|
This seem to make the interface very busy and hard to parse, you should probably cut this PR into smaller parts. First PRs for the bug fixes, and then another one that contains just the change in UI so that it can be discussed separatly. |
|
Yes, it's larger than the guidelines recommend, sorry about that, it's like that because the desire to change the UI ended up driving the lower-level changes and it was like pulling a loose thread in a sweater, I thought I was nearly done the whole time. As it is, I'd have to turn the PR inside-out to break it up.
|
|
Hi @GabrielSibley, welcome to CleverRaven! We see that this is your first time commenting here. Check out how development works and be sure to follow the code of conduct! We hope to see you around! |
|
I like the direction this is going in, but I agree having this on screen at all time makes the screen very busy Maybe move this to a separate screen, something like a help menu, press I for more info? |
Further appease clang
|
Hi @GabrielSibley, welcome to CleverRaven! We see that this is your first time commenting here. Check out how development works and be sure to follow the code of conduct! We hope to see you around! |
|
I think this is really cool. I do wonder if the "Other" pockets should ever be displayed on the first menu. I think Zireal is correct that that should be a note with a button that pushes out to a different menu showing all the pockets. That would possibly be a good spot to break up some of this PR into multiple? I also would suggest if doing that separate menu maybe considering only showing the largest pocket and longest pocket detail So longest pocket: 65 cm Largest pocket: 4 L without showing the total space of the longest pocket and length available to the largest pocket. Their full details could then be visible on the full pocket menu. Both of these actions would improve readability on the first page but provide that appendix level detail on a deeper more focused menu. The reason for these suggestions in my view is that ideally we want the pockets system to "just work" that ideally the item goes in the correct pocket most of the time and the Player doesn't need to think about it. Hopefully that makes sense. |
I'm OK with making the default option being to hide it. To the degree UI like the sidebar is customizable, it seemed like the design pattern was "show everything to start and let users hide stuff if they want". Most of my motivation for doing this change was being repeatedly frustrated by the old header not showing the volume of my longest pocket (only the length) and the length of my largest pocket (only the volume). These were shown as "Longest Length" and "Free Volume" respectively. I would try to pick up a stick or a gun and be unable to, because my large pockets are too short and my long pockets aren't big enough, or only take clip-on items, or have other things in them, and have to "debug" why I can't pick up the item. The pocket system does just work for collections of smaller items but starts to require more intervention (and more information) when you have Particularly Large or Particularly Long items. There's already a "show information about all your pockets" menu accessible from the inventory screen ( |
|
Hi @GabrielSibley, welcome to CleverRaven! We see that this is your first time commenting here. Check out how development works and be sure to follow the code of conduct! We hope to see you around! |




Summary
Interface "Rework inventory capacity summary"
Purpose of change
Improve the inventory capacity summary displayed in the top right of many inventory screens. I want to increase readability for new-comers, expose more information at a glance for experienced players, and remove information that seems unimportant or inaccurate.
In pursuing this I tried to make some volume-related functions clearer in purpose.
Additionally, this fixes at least a few minor bugs, of which I've confirmed:
Total Capacity displayed when 'e'xamining an item from the inventory screen is affected by the player disabling pockets, when it most likely should describe the physical state of the item.
Original Bug Repro: Disable some of an items pockets, then 'e'xamine the item from the inventory screen. "Total Capacity" is now no longer the sum of all pocket's capacities. Disabling all pockets removes the "total capacity" section entirely.
When using the insert menu, if the target item has holster pockets with contents, the weight of those contents is double-counted.
Original Bug Repro: hold or wear an item with holster and non-holster pockets, and put another item into one of the holsters. Open the 'insert' menu for the item. Note that reported weight capacity is (2X) / Y instead of X / Y.
When using the insert menu, selecting items which count by charges and have more than one charge report an incorrect adjustment to the volume carried post-insert.
Original Bug Repro: Spawn scrap metal (50). Using the insert menu, select the entire stack of scrap metal as the item to be inserted. Note that the volume display now reads 62.50 L / X, rather than the actual volume of the stack, 1.25 L.
When using the insert menu, the target item's volume capacity is reported with disabled pockets deducted. However, the disabled state of pockets is ignored when manually inserting into an item with this menu, so this is not accurate or useful.
Original Bug Repro: Disable all the pockets of an item and then open the insert menu for the item. Volume is reported as 0/0 L.
I strongly suspect but have not confirmed that this fixes an issue where disabling an item's pockets would make it more likely to burst when thrown.
Describe the solution
Interface changes
This replaces the right-hand text block fed in to the header drawn for most inventory_selectors. Inventory selectors which had custom draw code (e.g. scanning books) are passed through an adapter and are displayed the same as before.
The header stats block can now consist of more than 3 lines. Each line can contain "tab stops". Adjacent lines which contain the same number of tab stops will be padded to align those tab stops.
In the main inventory screen, pickup screen, and drop screen, the character's volume capacity is now summarized as "Bulk Volume", which is basically the volume of packing peanuts they can pick up -- it includes spaces inside rigid pockets, and ignores 'holster' pockets and pockets with most kinds of restrictions on what can be put in them . If you are going around looting lots of regular-sized items, this is a roughly accurate measurement of your overall capacity.
In the insert and open screens, the capacity shown accounts for only pockets on that item. The spaces listed on this screen are only those on the item. If the item is nested and has flexible pockets, the capacities are diminished if the outer pocket cannot expand sufficiently.
In screens where you select multiple items, a sum of the weight and volume of the selected items is displayed instead of trying to emulate, and show, the post-action state.
Additionally, in these screens, the largest and longest free space present is displayed, along with the size of the largest / longest pocket. This is followed by a summary of up to three other large free spaces. This replaces the "Free Volume" and "Longest Length" parts of the old status display. Pockets which are not restricted (e.g. to a sheathe or clip-on item) are prioritized for these displays.
Minor gameplay change
The hoarder morale penalty no longer applies the "small pocket allowance" to the overall volume carried, rather it is per-pocket, i.e. you do not get extra penalty reduction for having a small pocket that is more than 75% full, you just stop getting penalized for that pocket once it is 75% full.
About code changes
I've tried to improve or streamline several parts of the code related to querying for pockets and volumes. Notably, this changes almost nothing about the logic for actually picking up items.
_with_tweaks()and co) related to emulating the character's inventory state after a drop action, which was only used in the drop menu.Describe alternatives you've considered
Trying to make the inventory stats display better without changing how it's formatted at a base level or how information is gathered for it.
Testing
Additional context
New interface samples:




Wearing a hiking bag. Note the alignment of values and the display of the minimum length restriction for several of the pockets.
Wearing a leather belt with a holster clipped to it. Note that bulk volume is 0 because holster-pockets do not contribute to that, as they only hold one item. Note that pockets without flag restrictions (the holster) are prioritized over pockets with restrictions (belt loops), as they're more generally applicable. Pockets with restrictions are flagged with a
*.Carrying a bag of jars and bottles. Note that bulk volume is much less than the volume of the items, as they are almost entirely hollow, rigid pockets, so you still have plenty of space. Note also the selected items summary.
Inserting into a pair of jeans which are contained in a 3L jar. Note that the capacity of the pockets is constrained by the volume left in the jar. Note that the summary shows "total volume" and "content weight" instead of "bulk volume" and "total weight".
Author note:
I'm aware this is kind of a major change for a first contribution but I hope it's well received and am open to feedback.