From c2b3727b730f67808542fe59c9744ec2b1c7e309 Mon Sep 17 00:00:00 2001 From: Katrin Bratland <115959+katpet@users.noreply.github.com> Date: Tue, 17 Dec 2024 19:02:17 -0800 Subject: [PATCH] Fix penalty timer to cause box trip to show as ended in plt UI when timer ends In the newest version of CRG, need to also set the IS_CURRENT value of the BoxTrip to be false when a penalty timer ends, otherwise the box in the plt UI stays red. --- .../scoreboard/core/game/BoxSeatImpl.java | 2 +- .../scoreboard/core/game/BoxTripImpl.java | 5 +++++ .../scoreboard/core/interfaces/BoxTrip.java | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/com/carolinarollergirls/scoreboard/core/game/BoxSeatImpl.java b/src/com/carolinarollergirls/scoreboard/core/game/BoxSeatImpl.java index d1f7b398..ff5a41aa 100644 --- a/src/com/carolinarollergirls/scoreboard/core/game/BoxSeatImpl.java +++ b/src/com/carolinarollergirls/scoreboard/core/game/BoxSeatImpl.java @@ -293,7 +293,7 @@ public void endBox() { numPenalties = 1; if(f.getCurrentBoxTrip() != null) { f.getCurrentBoxTrip().end(); - f.getCurrentBoxTrip().delete(); + f.getCurrentBoxTrip().setIsCurrent(false); } } } diff --git a/src/com/carolinarollergirls/scoreboard/core/game/BoxTripImpl.java b/src/com/carolinarollergirls/scoreboard/core/game/BoxTripImpl.java index 4b090e37..9ea712db 100644 --- a/src/com/carolinarollergirls/scoreboard/core/game/BoxTripImpl.java +++ b/src/com/carolinarollergirls/scoreboard/core/game/BoxTripImpl.java @@ -385,6 +385,7 @@ public void execute(Command prop, Source source) { public void restart() { set(WALLTIME_START, ScoreBoardClock.getInstance().getCurrentWalltime()); set(PERIOD_NUMBER, game.getCurrentPeriodNumber()); + set(IS_CURRENT, true); } @Override @@ -534,6 +535,10 @@ public int getPenaltyCount() { public void setPenaltyCount(int count) { set(PENALTY_COUNT, count); } + @Override + public void setIsCurrent(Boolean isCurrent) { + set(IS_CURRENT, isCurrent); + } private Game game; private Clock storedClock = null; diff --git a/src/com/carolinarollergirls/scoreboard/core/interfaces/BoxTrip.java b/src/com/carolinarollergirls/scoreboard/core/interfaces/BoxTrip.java index 29ec459b..3ce37a8a 100644 --- a/src/com/carolinarollergirls/scoreboard/core/interfaces/BoxTrip.java +++ b/src/com/carolinarollergirls/scoreboard/core/interfaces/BoxTrip.java @@ -36,6 +36,7 @@ public interface BoxTrip extends ScoreBoardEventProvider { public int getPeriodNumber(); public int getPenaltyCount(); public void setPenaltyCount(int count); + public void setIsCurrent(Boolean isCurrent); public static Collection> props = new ArrayList<>();