mirror of
https://github.com/Team254/cheesy-arena-lite.git
synced 2026-03-09 13:46:44 -04:00
Add field reset screen to alliance station display.
This commit is contained in:
1
arena.go
1
arena.go
@@ -51,7 +51,6 @@ type RealtimeScore struct {
|
||||
AutoCommitted bool
|
||||
TeleopCommitted bool
|
||||
FoulsCommitted bool
|
||||
FieldReset bool
|
||||
undoScores []Score
|
||||
}
|
||||
|
||||
|
||||
@@ -209,8 +209,8 @@ func RefereeDisplayWebsocketHandler(w http.ResponseWriter, r *http.Request) {
|
||||
// Don't allow clearing the field until the match is over.
|
||||
continue
|
||||
}
|
||||
mainArena.redRealtimeScore.FieldReset = true
|
||||
mainArena.blueRealtimeScore.FieldReset = true
|
||||
mainArena.allianceStationDisplayScreen = "fieldReset"
|
||||
mainArena.allianceStationDisplayNotifier.Notify(nil)
|
||||
continue // Don't reload.
|
||||
case "commitMatch":
|
||||
if mainArena.MatchState != POST_MATCH {
|
||||
@@ -219,8 +219,8 @@ func RefereeDisplayWebsocketHandler(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
mainArena.redRealtimeScore.FoulsCommitted = true
|
||||
mainArena.blueRealtimeScore.FoulsCommitted = true
|
||||
mainArena.redRealtimeScore.FieldReset = true
|
||||
mainArena.blueRealtimeScore.FieldReset = true
|
||||
mainArena.allianceStationDisplayScreen = "fieldReset"
|
||||
mainArena.allianceStationDisplayNotifier.Notify(nil)
|
||||
mainArena.scoringStatusNotifier.Notify(nil)
|
||||
default:
|
||||
websocket.WriteError(fmt.Sprintf("Invalid message type '%s'.", messageType))
|
||||
|
||||
@@ -16,7 +16,9 @@ body {
|
||||
body[data-mode=logo] {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
body[data-mode=fieldReset] {
|
||||
background-color: #0a3;
|
||||
}
|
||||
|
||||
/* Switching Modes */
|
||||
.mode {
|
||||
@@ -31,7 +33,9 @@ body[data-mode=logo] .mode#logo {
|
||||
body[data-mode=match] .mode#match {
|
||||
display: block;
|
||||
}
|
||||
|
||||
body[data-mode=fieldReset] .mode#fieldReset {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* Logo Mode */
|
||||
#logo #logoImg {
|
||||
@@ -59,6 +63,21 @@ body[data-mode=match] .mode#match {
|
||||
font-size: 500px;
|
||||
}
|
||||
|
||||
/* Field Reset Mode */
|
||||
#fieldReset {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 65%;
|
||||
line-height: 300px;
|
||||
margin: auto auto;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
font-size: 300px;
|
||||
}
|
||||
|
||||
/* Match Mode */
|
||||
#match {
|
||||
position: absolute;
|
||||
@@ -152,3 +171,4 @@ body[data-position=right] #inMatch #blueScore {
|
||||
[data-alliance-bg=B], [data-status=B] {
|
||||
background-color: #00c;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<div id="logo" class="mode">
|
||||
<img id="logoImg" src="/static/img/alliance-station-logo.png" alt="logo" />
|
||||
</div>
|
||||
<div id="fieldReset" class="mode">FIELD<br />RESET</div>
|
||||
<script>
|
||||
// A unique id to differentiate this station's display from its peers.
|
||||
var displayId = "{{.DisplayId}}";
|
||||
|
||||
Reference in New Issue
Block a user