Add a SpireLens sort menu to the deck view's sort row #325
No reviewers
Labels
No labels
4-29
bug
documentation
duplicate
enhancement
flow improvement
good first issue
help wanted
invalid
investigating
issue-agent
issue-agent-blocked
issue-agent-complete
issue-agent-pr-open
issue-agent-runner-nelsonlaptop
issue-agent-runner-nelsonpc
issue-agent-runner-nelsonpc-user
issue-agent-running
needs-verification
next to do
question
queue
recon
relics-stats-onboarding
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
romaine-life/spirelens!325
Loading…
Reference in a new issue
No description provided.
Delete branch "claude/deck-filter-menu-damage-473e2f"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
The deck screen's four sort buttons (Obtained / Type / Cost / Alphabetical) are the game's own, and none of them can reach a SpireLens-tracked number. This adds a fifth entry to that row: a dropdown of SpireLens metrics, starting with Total damage — the same effective-damage figure the card tooltip prints under that name (HP this physical card actually removed across the run).
Picking the active metric again flips the direction. "Off" hands sorting back to the game.
How it reaches the grid
NCardGrid.SetCardsonly runs its own comparator whensortingPriority[0]is something other thanAscending/Descending— withAscendingat the head it renders the supplied list verbatim. So a SpireLens ordering is just "reorder_cards, then pinAscending", applied from theDisplayCardsprefix that already decides which cards are on screen. No new Harmony target, and no patch on the shared card grid.Handing ordering back to the stock sorters
The four stock handlers mutate
_sortingPriorityand their own direction flag.OnObtainedSort's ascending result is byte-identical to the head we pin, so the priority list cannot tell us a stock sorter ran — the direction flags can, and they flip on release for mouse and controller alike. We snapshot all four each time we order and stand down as soon as one moves. The clear happens before we reorder, so the render that noticed already honours the player's choice: no stale frame, no secondDisplayCardspass.Notes
NDeckViewScreenbut its pile is a historical reconstruction, so ordering it by the live run's aggregates would be quietly wrong.Buttonrather than a clonedNCardViewSortButton: the game's sort buttons resolve%ButtonImage/%Label/%Imagethrough scene-unique names and share aShaderMaterialwith their duplication source, so a clone that gets either wrong drives the original button's visuals — the trap already documented on the tickbox clone. The deck view already carries a plain injectedButton.DeckViewSpireLensSort.Metrics; rows, ordering, and the stock-sorter handoff are all metric-agnostic.Verification
Not run — per the repo's user-owned verification policy. Built, deployed, and hot-reloaded into the running game (reload 3):
--- HOT RELOAD DONE ---,Core.Initialize complete,Patch install: 432 classes patched, 0 failed/skipped— the same count as before the reload, as expected for a change that adds no patch classes.No restart needed. Both hooks this rides on (
NCardsViewScreen.ConnectSignalspostfix,NDeckViewScreen.DisplayCardsprefix) were already installed in this process before the reload; no Harmony target is new.🤖 Generated with Claude Code