Skip to content

Refactor ElementalBarsView: 3-zone color system & overtake recovery#419

Open
Shombith03 wants to merge 4 commits into
developmentfrom
claude/fix-elemental-ui-bar-DQk6H
Open

Refactor ElementalBarsView: 3-zone color system & overtake recovery#419
Shombith03 wants to merge 4 commits into
developmentfrom
claude/fix-elemental-ui-bar-DQk6H

Conversation

@Shombith03

Copy link
Copy Markdown
Contributor

Summary

Redesigned the elemental bar pip system to use a 3-zone color progression (normal, domain, super) and implemented proper overtake recovery mechanics with red-colored recovery pips that animate out before resuming normal fill.

Key Changes

  • 3-Zone Color System: Replaced single fill color with zone-based coloring:

    • Normal zone (pips 0-4): normalZoneColor
    • Domain zone (pips 5-9): _barDomainColors[idx] (customizable per element)
    • Super zone (pips 10-14): superZoneColor
  • Sprite Management: Added inactiveSprite and activeSprites[] to ElementBarBinding for per-zone sprite cycling, replacing hardcoded color-only approach

  • Overtake Recovery Flow:

    • Negative levels now show red recovery pips that shrink out with staggered delay
    • EndOvertake() clears remaining recovery pips and resets to normal fill
    • Recovery pips use debuffColor and inactiveSprite during overtake
  • Simplified Level System:

    • Removed zeroLineIndex baseline concept; all pips now start inactive
    • Levels 0-15 directly map to pip count (no offset)
    • Overtake allows negative levels (-5 to 0) for recovery visualization
  • Animation Refinements:

    • Debuff animation changed from shake+flash to shrink-out with reverse stagger
    • Replaced debuffShakeDuration/debuffShakeStrength with debuffShrinkDuration/debuffStaggerDelay
    • Removed pip flash logic from JuiceOvertakePenalty() (label shake only)
  • New Public API:

    • SetDomainColor(): Update domain zone color without changing level
    • SetLevel(element, level): Preserve current domain color when setting level
  • Helper Methods:

    • CalculateEnabledCount(): Unified pip count logic for normal vs. recovery modes
    • GetZoneColor(): Centralized zone color lookup

Implementation Details

The refactor maintains backward compatibility for the public SetLevel() API while enabling richer visual feedback during overtake penalties. Recovery pips are now visually distinct (red, inactive sprite) and animate out smoothly rather than shaking, improving clarity of the overtake mechanic.

https://claude.ai/code/session_01PaZzNVqGf4s457mREemNcY

claude and others added 4 commits March 9, 2026 19:08
…ence

- All pips start inactive (removed always-on baseline)
- 3 configurable color zones: normal (0.0-0.5), domain (0.5-1.0), super (1.0-1.5)
- 6 sprites per element: 1 inactive + 5 active fill stages, cycled per zone
- Debuff: reverse stagger deactivation with red tint instead of instant removal
- Overtake recovery: pips fill with red color, then swap to inactive at baseline
- Added SetDomainColor() for per-element domain zone color control
- Preserved all juice methods (drift, joust, crystal, overtake haptics)

https://claude.ai/code/session_01PaZzNVqGf4s457mREemNcY
SilhouetteController now resolves the vessel's domain palette color
and calls SetDomainColor() for each element before setting initial
levels, ensuring the domain zone (pips 5-9) renders with the correct
palette color instead of defaulting to white.

https://claude.ai/code/session_01PaZzNVqGf4s457mREemNcY
The ref local 'bar' cannot be captured inside the OnComplete lambda.
Copy bar.inactiveSprite to a plain local variable before the closure.

https://claude.ai/code/session_01PaZzNVqGf4s457mREemNcY
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