Skip to content

New sort mode Perishable - #7

Open
LukasKanta wants to merge 3 commits into
dizzyd:mainfrom
LukasKanta:main
Open

LukasKanta wants to merge 3 commits into
dizzyd:mainfrom
LukasKanta:main

Conversation

@LukasKanta

Copy link
Copy Markdown

Summary

Adds a new sorting method that orders items from next-to-perish to last-to-perish. Unperishable items are listed at the end in alphabetical order.

Changes

  • Added new sort mode Perishable to the dropdown
  • Added new sort mode ByPerishable to the SortMode enum
  • Changed the signature of GetSortKey to take ItemSlot instead of ItemStack
    • This is needed to access the transition state
  • Moved logic for Alphabetical order into new method GetAlphabeticalKey
  • Added a new method GetRealFreshHoursLeft to determine hours remaining until a perish transition

Motivation / Context

I wanted an easy way to quickly find items in my cellar that are about to spoil.

Testing

  • Tested in single-player mode
  • Multiplayer testing is still pending, but differences are not expected compared to single-player mode

Breaking Changes

  • None

Additional Notes

I’m not fully sure about the naming in the dropdown and am open to better suggestions.

Kankro added a commit to Kankro/packrat that referenced this pull request May 15, 2026
Adds a new sorting method that orders items from next-to-perish to last-to-perish. Unperishable items are listed at the end in alphabetical order.

- Added new sort mode Perishable to the dropdown
- Added new sort mode ByPerishable to the SortMode enum
- Changed the signature of GetSortKey to take ItemSlot instead of ItemStack. This is needed to access the transition state
- Moved logic for Alphabetical order into new method GetAlphabeticalKey
- Added a new method GetRealFreshHoursLeft to determine hours remaining until a perish transition
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.

1 participant