Skip to content

Add Inventory quality list#34

Draft
Speed126 wants to merge 6 commits intoNightdawg:masterfrom
Speed126:master
Draft

Add Inventory quality list#34
Speed126 wants to merge 6 commits intoNightdawg:masterfrom
Speed126:master

Conversation

@Speed126
Copy link

@Speed126 Speed126 commented Mar 13, 2026

Summary

This draft PR adds a quality list to the inventory UI.

The main goal of this change is to make it easier to interact with inventory items by quality. The inventory now has a toggleable quality list panel that groups matching items together and supports quality row-based actions.

Included changes

  • Added ExtInventory to provide the quality list panel
  • Added a top-bar button to expand/collapse the panel
  • Kept Hurricane's existing Stack All / Unstack All buttons working alongside it
  • Added grouping modes for:
    • Type
    • Q
    • Q1
    • Q5
    • Q10
  • Added quality row-based interactions:
    • Shift-click transfers matching items
    • Ctrl-click drops matching items

Stack and transfer handling

A large part of this work was making grouped transfers behave correctly with stacked items.

This includes:

  • handling unresolved stack children while item data is still settling
  • making grouped transfers more reliable after items are moved out and then back into inventory
  • separating full-stack transfers from mixed-stack transfers so matching quality rows behave more consistently

To address that, this version includes stack-aware transfer handling and retry logic for cases where stack children are not fully resolved on the first pass.

Changes to existing files

src/haven/GameUI.java

This change replaces the direct inventory window attachment with an ExtInventory wrapper. That allows the quality list panel to live alongside the inventory while still treating the inventory window as the main interaction point. It also adds a maininvext reference so the window controls can toggle the panel.

src/haven/Window.java

This change adds the quality list toggle button to the inventory top bar and updates the existing inventory-window button handling so Stack All / Unstack All continue to work when the inventory is wrapped by ExtInventory. It also adjusts button anchoring so the controls remain aligned when the panel expands.

src/haven/GItem.java

This change invalidates cached item quality / tooltip-derived state when item resource, tooltip, or contents data changes. Without this, the quality list could hold onto stale or incomplete item quality data, particularly in stacked-item cases.

Additional changes

  • Fixed inventory relayout so the window updates properly when inventory size changes
    • example: equipping or unequipping a Wanderer's Bindle
  • Added tempoary compiled button resources for the quality list button

Notes

This is mainly being opened as a draft because the current quality list button art is temporary.

The feature itself is working, but the button graphics should still be replaced with art that better matches the style of the existing inventory top-bar controls before this is treated as final.

Testing performed

  • Builds successfully
  • Verified client launch
  • Verified quality list button appears in the inventory top bar
  • Verified quality list panel opens and closes correctly
  • Verified Stack All / Unstack All still work
  • Verified grouped quality rows populate correctly
  • Verified Shift-click transfer into stockpiles and cupboards
  • Verified inventory relayout updates correctly after bindle equip/unequip
  • Verified grouped transfers continue to work after items are moved out and then back into inventory

Remaining polish

  • Replace the temporary quality list button art with final themed button resources
  • Enable ExtInventory functionality on all container inventories, such as chests and cupboards.

Added a button at the top of the inventory that opens an expanded window which lists all of the quality groups for the items in your inventory.
@onefuncman
Copy link

clicking items out of the quality list doesnt correctly put the top q item on the cursor and likewise the onhover doesnt show the top q item as expected from other client implementations.

the ability to interact with the extInventory for lowest quality seems completely absent (think its on right click)

and somehow you've managed to port this over and make it longer than the original https://github.com/EnderWiggin/hafen-client/blob/master/src/haven/ExtInventory.java

@Speed126
Copy link
Author

Speed126 commented Mar 15, 2026

clicking items out of the quality list doesnt correctly put the top q item on the cursor and likewise the onhover doesnt show the top q item as expected from other client implementations.

the ability to interact with the extInventory for lowest quality seems completely absent (think its on right click)

and somehow you've managed to port this over and make it longer than the original https://github.com/EnderWiggin/hafen-client/blob/master/src/haven/ExtInventory.java

Thank you for your feedback, those first two points are fair.
The current row interaction uses the first collected item in the row as the representative item, not an explicit highest-q or lowest-q representative, so top-q click/hover behavior and lowest-q right-click behavior are not correct yet. I will change that now so rows track both highest and lowest quality items and route left/right click accordingly.

In regards to the length, fair enough. A lot of the extra code came from Hurricane-specific stack handling and retry logic for unresolved stack children so grouped transfers behave reliably. But you're right, a cleanup pass would be worthwhile once I finish the row click/hover behavior, mostly to reduce duped helper logic and separate some of the transfer logic from the UI code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants