diff --git a/TODO b/TODO index 9196b3c548..c9dcb9ea27 100644 --- a/TODO +++ b/TODO @@ -11,6 +11,9 @@ FBGM show field during game - different colors for positive and negative plays - some minimum height of field, but expand dynamically for long drives - draw vertical lines for scrimmage and togo + - not when awaitingKickoff + - would be nice to show the kickoff as a drive - kick and return as 2 bars + - fumbles too - light mode - how to update numPlays - accepted penalties only count as a play if they are added on to the end of the play. this means we sometimes need to decrease numPlays when a penalty gets accepted, but not always diff --git a/src/ui/util/processLiveGameEvents.football.ts b/src/ui/util/processLiveGameEvents.football.ts index 8bddb0b4ff..98b6a7daf2 100644 --- a/src/ui/util/processLiveGameEvents.football.ts +++ b/src/ui/util/processLiveGameEvents.football.ts @@ -2,6 +2,7 @@ import { getPeriodName } from "../../common"; import { helpers } from "../../ui/util"; export type SportState = { + awaitingKickoff: boolean; t: 0 | 1; numPlays: number; initialScrimmage: number; @@ -11,6 +12,7 @@ export type SportState = { }; export const DEFAULT_SPORT_STATE: SportState = { + awaitingKickoff: true, t: 0, numPlays: 0, initialScrimmage: 0, @@ -107,7 +109,8 @@ const processLiveGameEvents = ({ stop = true; } else if (e.type === "clock") { let textWithoutTime; - if (e.awaitingKickoff !== undefined) { + const awaitingKickoff = e.awaitingKickoff !== undefined; + if (awaitingKickoff) { textWithoutTime = `${boxScore.teams[actualT].abbrev} kicking off`; } else { let fieldPos = ""; @@ -132,13 +135,11 @@ const processLiveGameEvents = ({ sportState.t = actualT; sportState.numPlays = 0; sportState.initialScrimmage = e.scrimmage; - sportState.scrimmage = e.scrimmage; sportState.plays = []; - sportState.text = textWithoutTime; - } else { - sportState.text = textWithoutTime; - sportState.scrimmage = e.scrimmage; } + sportState.awaitingKickoff = awaitingKickoff; + sportState.text = textWithoutTime; + sportState.scrimmage = e.scrimmage; } else if (e.type === "stat") { // Quarter-by-quarter score if (e.s === "pts") {