mirror of
https://github.com/Team254/cheesy-arena-lite.git
synced 2026-03-09 21:56:50 -04:00
Made the in-match alliance display stick around for a few seconds post-match.
This commit is contained in:
8
arena.go
8
arena.go
@@ -142,7 +142,7 @@ func (arena *Arena) Setup() {
|
||||
arena.savedMatch = &Match{}
|
||||
arena.savedMatchResult = &MatchResult{}
|
||||
arena.allianceStationDisplays = make(map[string]string)
|
||||
arena.allianceStationDisplayScreen = "blank"
|
||||
arena.allianceStationDisplayScreen = "match"
|
||||
|
||||
arena.lights.Setup()
|
||||
}
|
||||
@@ -230,6 +230,10 @@ func (arena *Arena) LoadMatch(match *Match) error {
|
||||
|
||||
arena.matchLoadTeamsNotifier.Notify(nil)
|
||||
arena.realtimeScoreNotifier.Notify(nil)
|
||||
|
||||
arena.allianceStationDisplayScreen = "match"
|
||||
arena.allianceStationDisplayNotifier.Notify(nil)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -461,6 +465,8 @@ func (arena *Arena) Update() {
|
||||
time.Sleep(time.Second * matchEndScoreDwellSec)
|
||||
arena.audienceDisplayScreen = "blank"
|
||||
arena.audienceDisplayNotifier.Notify(nil)
|
||||
arena.allianceStationDisplayScreen = "logo"
|
||||
arena.allianceStationDisplayNotifier.Notify(nil)
|
||||
}()
|
||||
arena.playSoundNotifier.Notify("match-end")
|
||||
}
|
||||
|
||||
@@ -1028,6 +1028,7 @@ func AllianceStationDisplayWebsocketHandler(w http.ResponseWriter, r *http.Reque
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
websocket.Write("matchTime", MatchTimeMessage{mainArena.MatchState, int(mainArena.lastMatchTimeSec)})
|
||||
messageType = "setAllianceStationDisplay"
|
||||
message = mainArena.allianceStationDisplayScreen
|
||||
case _, ok := <-matchLoadTeamsListener:
|
||||
|
||||
@@ -60,17 +60,20 @@ body[data-mode=match] .mode#match {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
#match[data-state=AUTO_PERIOD], #match[data-state=PAUSE_PERIOD], #match[data-state=TELEOP_PERIOD], #match[data-state=ENDGAME_PERIOD] {
|
||||
#match[data-state=AUTO_PERIOD], #match[data-state=PAUSE_PERIOD], #match[data-state=TELEOP_PERIOD],
|
||||
#match[data-state=ENDGAME_PERIOD], #match[data-state=POST_MATCH] {
|
||||
background-color: #fff;
|
||||
color: #000;
|
||||
}
|
||||
#preMatch, #inMatch {
|
||||
display: none;
|
||||
}
|
||||
#match[data-state=PRE_MATCH] #preMatch, #match[data-state=POST_MATCH] #preMatch {
|
||||
#match[data-state=PRE_MATCH] #preMatch {
|
||||
display: block;
|
||||
}
|
||||
#match[data-state=AUTO_PERIOD] #inMatch, #match[data-state=PAUSE_PERIOD] #inMatch, #match[data-state=TELEOP_PERIOD] #inMatch, #match[data-state=ENDGAME_PERIOD] #inMatch {
|
||||
#match[data-state=AUTO_PERIOD] #inMatch, #match[data-state=PAUSE_PERIOD] #inMatch,
|
||||
#match[data-state=TELEOP_PERIOD] #inMatch, #match[data-state=ENDGAME_PERIOD] #inMatch,
|
||||
#match[data-state=POST_MATCH] #inMatch {
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
||||
@@ -97,7 +97,8 @@ var handleRealtimeScore = function(data) {
|
||||
};
|
||||
|
||||
var handleHotGoalLight = function(side) {
|
||||
if (allianceStation != "" && (side == "left" && allianceStation[1] == "3" || side == "right" && allianceStation[1] == "1")) {
|
||||
if (allianceStation != "" && (side == "left" && allianceStation[1] == "3" ||
|
||||
side == "right" && allianceStation[1] == "1")) {
|
||||
$("#match").attr("data-hotgoal", "active");
|
||||
} else {
|
||||
$("#match").attr("data-hotgoal", "");
|
||||
|
||||
Reference in New Issue
Block a user