Skip to content

Release v0.7.0 — Period length file and game-finished reset - #15

Merged
JRemitz merged 10 commits into
mainfrom
release/v0.7.0
Apr 16, 2026
Merged

Release v0.7.0 — Period length file and game-finished reset#15
JRemitz merged 10 commits into
mainfrom
release/v0.7.0

Conversation

@JRemitz

@JRemitz JRemitz commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

Summary

New Features

  • Cumulative game clock (Add cumulative game clock (counts up across periods) #12) — opt-in toggle in Game Settings that counts up from 0:00 across all periods, displayed as (MM:SS) under the period clock, written to cumulative_clock.txt. Configurable format (MM:SS or H:MM:SS). Event log timestamps use game clock time when enabled. Resets on New Game.
  • Custom penalty labels (Penalty label #14) — home_penalty_labels.txt and away_penalty_labels.txt combine player number and time per active penalty into one line. Configurable format template with {{ number }}, {{ time }}, {{ phase2 }}, and {{ if_phase2 }}...{{ end_if }} conditional for compound penalties. Live preview in Game Settings updates as you type.
  • period_length.txt — scoreboard-core reads/writes period length for external tool integration. File watcher picks up external changes.

Bug Fixes

  • Penalty chapter markers (Chapter marker for penalty names the wrong team #13) — now correctly name the penalized team and use "Penalty:" instead of "Power Play:" label
  • Compound penalty clock adjust — leftover time from phase 1 now carries into phase 2 (e.g. subtracting 60s with 30s left on a 2+5 starts phase 2 at 4:30, not 5:00)
  • Game Settings clock reset — no longer resets the clock when saving non-clock settings (penalty format, CLI path, etc.)
  • Game Finished checkbox — resets on New Game

Documentation

  • CLAUDE.md, README, and CHANGELOG updated for all v0.7.0 changes

Closes

Test plan

  • make build — compiles cleanly
  • make test — all 7 test binaries pass
  • make coverage — 100% line coverage on scoreboard-core
  • Manual: enable game clock, play through 2+ periods, verify display and cumulative_clock.txt
  • Manual: add penalties (regular + compound), verify home_penalty_labels.txt output
  • Manual: customize penalty label format in settings, verify live preview and output
  • Manual: add a Home penalty, verify chapter says "Penalty: Home #X"
  • Manual: subtract time past phase 1 of compound penalty, verify leftover carries to phase 2
  • Manual: change penalty format in settings mid-game, verify clock is not reset

🤖 Generated with Claude Code

JRemitz and others added 10 commits April 15, 2026 18:40
Add period_length.txt to scoreboard-core write/read cycle so external
tools (reeln-cli) can set a custom period length that persists across
New Game and period advance. The dock file watcher picks up external
changes automatically.

Fix "Game Finished" checkbox carrying over from the prior game, which
caused the highlights button to show the wrong label after New Game.

Co-Authored-By: Claude <noreply@anthropic.com>
The penalty event logged the opposing team's name (the one gaining the
power play) next to the penalized player's number, producing entries
like "Power Play: Away #10" when Home #10 took the penalty.

Fix: use the penalized team's name and change the label from
"Power Play:" to "Penalty:" which is accurate regardless of strength.

Closes #13

Co-Authored-By: Claude <noreply@anthropic.com>
Add an opt-in cumulative game clock that counts up from 0:00 across
all periods. Enable via "Show cumulative game clock" in Game Settings.

- Core: game_clock_accumulated_tenths tracks completed periods,
  game_clock_get_tenths() computes total elapsed on the fly
- Dock: displays (MM:SS) under the period clock, writes game_clock.txt
- Events: timestamps use game clock time instead of stream time when
  enabled, so chapter markers reflect actual game time
- Resets on New Game; persists across save/load and profile config

Closes #12

Co-Authored-By: Claude <noreply@anthropic.com>
Rename game_clock.txt to cumulative_clock.txt for clarity. Add a
display format setting (MM:SS vs H:MM:SS) in Game Settings — the
H:MM:SS format shows hours when the game exceeds 60 minutes, while
MM:SS lets minutes exceed 59.

Co-Authored-By: Claude <noreply@anthropic.com>
Add home_penalty_labels.txt and away_penalty_labels.txt that combine
player number and time remaining into a single line per penalty. This
lets OBS users point one Text source at the file with a background,
avoiding the gap between separate number/time sources.

The per-line format is configurable in Game Settings via a template
string with {{ number }} and {{ time }} placeholders. Default format
is "#{{ number }}  {{ time }}" producing output like "#88  2:00".

Closes #14

Co-Authored-By: Claude <noreply@anthropic.com>
Add {{ phase2 }} template variable for compound penalties (2+2, 2+10)
so users can format labels like "#88  2:00+10:00". Resolves to empty
string for regular penalties.

Organize Game Settings dialog with section headers:
- "Custom Penalty Labels" header for the penalty format controls
- "Game Clock" header for cumulative clock controls

Co-Authored-By: Claude <noreply@anthropic.com>
When a clock adjustment (e.g. -60s) exceeds a compound penalty's
remaining phase 1 time (e.g. 30s left), the leftover 30s now carries
into phase 2, reducing it from 5:00 to 4:30. Previously phase 2
started at its full duration, ignoring the excess.

If the leftover also exceeds phase 2, the penalty clears entirely.

Also fix: Game Settings dialog no longer resets the clock on every
save — only resets when period length or clock direction actually
changed.

Co-Authored-By: Claude <noreply@anthropic.com>
Enables clean compound penalty formatting by conditionally rendering
content only when a penalty has a phase 2 component.

Example format:
  #{{ number }} {{ time }}{{ if_phase2 }} (+{{ phase2 }}){{ end_if }}

Renders as:
  Compound 2+5: #23 1:57 (+5:00)
  Regular:      #23 1:57

Co-Authored-By: Claude <noreply@anthropic.com>
Change default penalty label format to include the compound penalty
conditional:
  #{{ number }}  {{ time }}{{ if_phase2 }} (+{{ phase2 }}){{ end_if }}

Add scoreboard_preview_penalty_label() that renders sample penalties
(regular #23 1:30 + compound #88 0:45 +5:00) with any given format
string, without modifying global state.

Add a live preview label in Game Settings that updates as the user
types, showing exactly what the template produces.

Co-Authored-By: Claude <noreply@anthropic.com>
- CLAUDE.md: document cumulative game clock, penalty label format
  with template variables and conditionals, updated file count and
  test descriptions
- README: add cumulative clock and custom penalty labels to features,
  expand text files table with all new files
- CHANGELOG: update penalty labels entry with if_phase2 conditional
  and live preview details

Co-Authored-By: Claude <noreply@anthropic.com>
@JRemitz JRemitz self-assigned this Apr 16, 2026
@JRemitz
JRemitz merged commit d29a023 into main Apr 16, 2026
7 checks passed
@JRemitz
JRemitz deleted the release/v0.7.0 branch April 16, 2026 17:23
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.

Penalty label Chapter marker for penalty names the wrong team Add cumulative game clock (counts up across periods)

1 participant