Cataclysm-BN
Cataclysm-BN copied to clipboard
feat(UI): More info about items dropped with bags
Summary
SUMMARY: Interface "More info about items dropped with bags"
Purpose of change
Inform the player about which items are being dropped when dropping containers and getting volume capacity below used volume. Add a time cost display to dropping.
Describe the solution
At the moment:
- Drop UI requires a special caching preset rather than a generic one. I'll unhack it when I find a way to untangle it.
- When dropping anything, the function for rearranging drops (for better drop time) is called on the dropped items
- The new preset uses the result of this to calculate time taken for drop and note which items will need to be dropped to match capacity
- Items which will be dropped are marked (color)
TODO:
- [ ] Untangle preset vs selector - here they need to communicate and the preset must have access to all dropped items, so keeping separate is a problem
- [ ] Allow other presets to be used - presets aren't modular at all, so replacing them has to be done all in one go, but here we want filtering from one preset and coloring+amount from another
- [ ] Improve cache dropping, so that only the changed entries need to be rebuilt
- [ ] Show amounts next to item (in different color if implied)
- [ ] Show implied drops in selection column
- [ ] More tests
Describe alternatives you've considered
Giving up on notpockets and embracing the recursive boxes. Having notpockets lack proper display.
Testing
- Spawn some wearable containers and stuff to fill them with
- Wear containers and pick stuff up
- Try to drop container
- Note items being added to drop list
- Note time taken on UI
- Confirm drop
- Check if the dropped items match the ones shown on UI and time taken matches time shown on UI
Additional context
Almost close to being pretty near to being done.
At the moment, it has everything debug-colored:
- Items/stacks to be dropped fully (blue)
- Items/stacks to be dropped partially (magenta?)
- Items that aren't bugged (green)
On the right, you can see 2 categories: things you want to drop and things you'll drop because you have to.
Plus, you can see it will take 2 seconds. Volume is shown post-drop, but I'm thinking of making it show only wanted-to-drop items, so that it shows you how much you have to add to keep it under the limit.
If you try to manually drop more stuff, implied items will be recalculated because some items will not be under the limit and thus you can keep them.