Skip to content

feat: Write current strength to strength.txt with configurable format#18

Merged
JRemitz merged 2 commits intomainfrom
feat/strength-display
Apr 17, 2026
Merged

feat: Write current strength to strength.txt with configurable format#18
JRemitz merged 2 commits intomainfrom
feat/strength-display

Conversation

@JRemitz
Copy link
Copy Markdown
Contributor

@JRemitz JRemitz commented Apr 17, 2026

Summary

  • Adds sport-aware strength tracking that writes players-per-side to strength.txt (e.g., 5-4, 4v5)
  • Penalty sports (hockey/lacrosse/rugby): strength = base - running penalties, clamped to min
  • Soccer: strength = base - red cards via existing fouls2 counter
  • Configurable "Players per side" in Game Settings (supports 5v5, 4v4, 3v3, 7v7, etc.)
  • Template format for strength display with {{ home }}, {{ away }}, {{ if_pp }}...{{ end_if }} and live preview
  • Game Settings dialog wrapped in QScrollArea for resizability

Sport defaults: Hockey 5/3, Soccer 11/7, Lacrosse 5/3, Rugby 15/13, others disabled.

Test plan

  • 37 new tests in test-scoreboard-core-strength.c
  • 100% line coverage maintained on scoreboard-core.c
  • All 8 test binaries pass
  • Install plugin, open OBS, verify strength.txt output
  • Change sport in Game Settings, verify Players per side updates
  • Customize strength label format, verify preview and file output
  • Verify Game Settings dialog scrolls and resizes cleanly

Closes #11

🤖 Generated with Claude Code

…#11)

Add sport-aware strength tracking that calculates players per side based
on active penalties (hockey/lacrosse/rugby) or red cards (soccer) and
writes the result to strength.txt using a configurable template format.

- Add base_strength and min_strength to sport presets (hockey=5/3,
  soccer=11/7, lacrosse=5/3, rugby=15/13)
- Configurable players-per-side via Game Settings UI
- Strength label format with {{ home }}, {{ away }}, {{ if_pp }}
  template variables and live preview
- Wrap Game Settings dialog in QScrollArea for resizability
- JSON save/load persistence for base_strength and format
- 37 tests in new test-scoreboard-core-strength.c
- 100% line coverage maintained

Closes #11

Co-Authored-By: Claude <noreply@anthropic.com>
@JRemitz JRemitz self-assigned this Apr 17, 2026
Co-Authored-By: Claude <noreply@anthropic.com>
@JRemitz JRemitz merged commit 2fd57b5 into main Apr 17, 2026
7 checks passed
@JRemitz JRemitz deleted the feat/strength-display branch April 17, 2026 15:24
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.

Write current strength (5-5, 5-4, etc.) to strength.txt

1 participant