M4: In-game UI — "View Stats" checkbox #8

Closed
opened 2026-04-19 17:00:06 -07:00 by nelsong6 · 1 comment
nelsong6 commented 2026-04-19 17:00:06 -07:00 (Migrated from github.com)

Goal

Surface collected stats in-game via a checkbox sibling to the existing "View Upgrades" checkbox on deck-view screens.

Behavior

  • Mutually exclusive with View Upgrades. Checking one unchecks the other. Rationale: showing stats for an upgraded card whose upgraded form hasn't been played is nonsensical.
  • Only on screens listing the player's actual deck — in-run deck view and Run History past-run deck view. Hidden on generic Compendium until #2 (cross-run aggregation) lands.
  • When checked: hover tooltip replaces the card's normal description with the attribution numbers for that run.

Implementation sketch

  1. Find the deck-view screen in decompiled code; locate the "View Upgrades" checkbox node.
  2. Harmony-patch the screen's _Ready to add a sibling checkbox (pattern similar to STS2MCP's Fast Mode tickboxes).
  3. Track state in a static property.
  4. Harmony-patch the card-hover/tooltip renderer. When ViewStats == true, override description text.
  5. Wire the mutual-exclusion via event handlers.

Context

Stats come from whichever run the deck belongs to:

  • Current run → RunTracker.Current
  • Historical → load <run-id>.json from disk

Risk

  • Other mods modifying same screens (SlayTheStats, BetterSpire2) may collide
  • Godot scene introspection is more work than pure C# patching
  • Multiplayer deferred
## Goal Surface collected stats in-game via a checkbox sibling to the existing "View Upgrades" checkbox on deck-view screens. ## Behavior - **Mutually exclusive with View Upgrades.** Checking one unchecks the other. Rationale: showing stats for an upgraded card whose upgraded form hasn't been played is nonsensical. - **Only on screens listing the player's actual deck** — in-run deck view and Run History past-run deck view. Hidden on generic Compendium until #2 (cross-run aggregation) lands. - When checked: hover tooltip replaces the card's normal description with the attribution numbers for that run. ## Implementation sketch 1. Find the deck-view screen in decompiled code; locate the "View Upgrades" checkbox node. 2. Harmony-patch the screen's `_Ready` to add a sibling checkbox (pattern similar to STS2MCP's Fast Mode tickboxes). 3. Track state in a static property. 4. Harmony-patch the card-hover/tooltip renderer. When `ViewStats == true`, override description text. 5. Wire the mutual-exclusion via event handlers. ## Context Stats come from whichever run the deck belongs to: - Current run → `RunTracker.Current` - Historical → load `<run-id>.json` from disk ## Risk - Other mods modifying same screens (SlayTheStats, BetterSpire2) may collide - Godot scene introspection is more work than pure C# patching - Multiplayer deferred
nelsong6 commented 2026-04-20 18:21:31 -07:00 (Migrated from github.com)

Closing this as effectively completed, but with a different UI shape than the original sketch.

Root cause: the original issue assumed the right solution was a deck-view-only "View Stats" checkbox that was mutually exclusive with View Upgrades and replaced the card description text inline. In practice, the more useful in-game surface turned out to be two-layered: (1) a deck-view Card Utility toggle for inspection mode, and (2) a compact mid-combat hand-hover view so the player can tell which specific instance they're about to play without opening deck view.

Shipped implementation in 9a4a44e:

Deliberate non-changes versus the original issue text:

  • We did not make the toggle mutually exclusive with View Upgrades.
  • We did not replace the card's normal description text inline; stats render in a sibling side-panel tooltip instead.
  • We did not implement Run History deck-view support here; this remains separate in #9.

So the original M4 goal (surface stats in-game) is satisfied, but the exact interaction model in this issue is superseded by the compact in-hand view and side-panel tooltip approach.

Closing this as effectively completed, but with a different UI shape than the original sketch. Root cause: the original issue assumed the right solution was a deck-view-only "View Stats" checkbox that was mutually exclusive with View Upgrades and replaced the card description text inline. In practice, the more useful in-game surface turned out to be two-layered: (1) a deck-view Card Utility toggle for inspection mode, and (2) a compact mid-combat hand-hover view so the player can tell which specific instance they're about to play without opening deck view. Shipped implementation in [9a4a44e](https://github.com/nelsong6/card-utility-stats/commit/9a4a44e3f5ae5583083f3821ff4e4ca5b2b3dd35): - Deck-view toggle injection: [Core/Patches/ViewStatsInjectorPatch.cs#L12-L31](https://github.com/nelsong6/card-utility-stats/blob/9a4a44e3f5ae5583083f3821ff4e4ca5b2b3dd35/Core/Patches/ViewStatsInjectorPatch.cs#L12-L31), [Core/Patches/ViewStatsInjectorPatch.cs#L166-L185](https://github.com/nelsong6/card-utility-stats/blob/9a4a44e3f5ae5583083f3821ff4e4ca5b2b3dd35/Core/Patches/ViewStatsInjectorPatch.cs#L166-L185), and [Core/Patches/ViewStatsInjectorPatch.cs#L261-L278](https://github.com/nelsong6/card-utility-stats/blob/9a4a44e3f5ae5583083f3821ff4e4ca5b2b3dd35/Core/Patches/ViewStatsInjectorPatch.cs#L261-L278). This ships the in-run deck-view toggle and wires live rerender behavior. - Compact in-hand view: [Core/Patches/CardHoverTooltipPatch.cs#L79-L85](https://github.com/nelsong6/card-utility-stats/blob/9a4a44e3f5ae5583083f3821ff4e4ca5b2b3dd35/Core/Patches/CardHoverTooltipPatch.cs#L79-L85), [Core/Patches/CardHoverTooltipPatch.cs#L104-L112](https://github.com/nelsong6/card-utility-stats/blob/9a4a44e3f5ae5583083f3821ff4e4ca5b2b3dd35/Core/Patches/CardHoverTooltipPatch.cs#L104-L112), [Core/Patches/CardHoverTooltipPatch.cs#L130-L136](https://github.com/nelsong6/card-utility-stats/blob/9a4a44e3f5ae5583083f3821ff4e4ca5b2b3dd35/Core/Patches/CardHoverTooltipPatch.cs#L130-L136), and [Core/Patches/CardHoverTooltipPatch.cs#L327-L346](https://github.com/nelsong6/card-utility-stats/blob/9a4a44e3f5ae5583083f3821ff4e4ca5b2b3dd35/Core/Patches/CardHoverTooltipPatch.cs#L327-L346). This is the part that makes the separate "deck view only" framing unnecessary. Deliberate non-changes versus the original issue text: - We did not make the toggle mutually exclusive with View Upgrades. - We did not replace the card's normal description text inline; stats render in a sibling side-panel tooltip instead. - We did not implement Run History deck-view support here; this remains separate in [#9](https://github.com/nelsong6/card-utility-stats/issues/9). So the original M4 goal (surface stats in-game) is satisfied, but the exact interaction model in this issue is superseded by the compact in-hand view and side-panel tooltip approach.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
romaine-life/spirelens#8
No description provided.