Files
LlamaCasty/Models/ScoreboardSample.cs
gramps e6abc13461 feat(scoreboard): a DEBUG-only "Simulate" switch, so the strip is provable in the preview
Creator (2026-10-30): pre-1.0, use DEBUG — add a toggle that simulates the ticker so the strip can
be SEEN and its compositing verified before a real stream.

The sample travels the REAL ScoreboardRecorder a stream uses (one new member, a gift of three, a
milestone, a $12.34 Super Chat), so what the preview shows is exactly what live events produce — a
fake renderer would prove nothing. Toggling off clears to an empty session, so the empty state is
visible too.

Debug-gated at COMPILE time: `DevelopmentBuild` is a const true in DEBUG / false in Release, and the
checkbox binds its Visibility to it. A shipped Release build therefore has no dev control at all,
rather than one hidden by a runtime flag.

Guard: ScoreboardSimulationTests — the sample lands all four tallies through the recorder, off clears,
and the panel + const pair exist in the Dual (DEBUG/Release) form.
2026-10-30 14:58:56 -07:00

30 lines
1.3 KiB
C#

namespace ytLive.Models;
/// <summary>Development-only sample data for the scoreboard.
///
/// <para>Creator (2026-10-30): the strip must be provable in the PREVIEW before a real stream —
/// "simulate the ticker so we can see it and ensure it's getting composited". Synthetic events go
/// through the same <see cref="ScoreboardRecorder"/> a live stream uses, so what the preview shows
/// is exactly what real events would produce; nothing here fakes the renderer.</para>
///
/// <para>Kept in the model (not the view-model) so the sample is testable without a window.</para></summary>
public static class ScoreboardSample
{
public static void Inject(ScoreboardRecorder recorder)
{
if (!recorder.IsRunning) recorder.StartSession();
recorder.Record(new ChatMessage { Kind = ChatEventKind.NewMember, AuthorName = "newviewer" });
recorder.Record(new ChatMessage
{
Kind = ChatEventKind.MemberGift, AuthorName = "giftgiver", GiftNewMembersCount = 3,
});
recorder.Record(new ChatMessage { Kind = ChatEventKind.MemberMilestone, AuthorName = "longtimer" });
recorder.Record(new ChatMessage
{
Kind = ChatEventKind.SuperChat, AuthorName = "tipper",
SuperChatAmount = 12.34, SuperChatCurrency = "USD", SuperChatDisplayString = "$12.34",
});
}
}