mirror of
https://github.com/Team254/cheesy-arena-lite.git
synced 2026-03-09 21:56:50 -04:00
Fix alliance selection and lower third overlays to work across a refresh.
This commit is contained in:
@@ -66,6 +66,8 @@ type Arena struct {
|
||||
SavedMatch *model.Match
|
||||
SavedMatchResult *model.MatchResult
|
||||
AllianceStationDisplayMode string
|
||||
AllianceSelectionAlliances [][]model.AllianceTeam
|
||||
LowerThird *model.LowerThird
|
||||
MuteMatchSounds bool
|
||||
matchAborted bool
|
||||
Scale *game.Seesaw
|
||||
|
||||
@@ -60,7 +60,7 @@ type audienceAllianceScoreFields struct {
|
||||
|
||||
// Instantiates notifiers and configures their message producing methods.
|
||||
func (arena *Arena) configureNotifiers() {
|
||||
arena.AllianceSelectionNotifier = websocket.NewNotifier("allianceSelection", nil)
|
||||
arena.AllianceSelectionNotifier = websocket.NewNotifier("allianceSelection", arena.generateAllianceSelectionMessage)
|
||||
arena.AllianceStationDisplayModeNotifier = websocket.NewNotifier("allianceStationDisplayMode",
|
||||
arena.generateAllianceStationDisplayModeMessage)
|
||||
arena.ArenaStatusNotifier = websocket.NewNotifier("arenaStatus", arena.generateArenaStatusMessage)
|
||||
@@ -69,7 +69,7 @@ func (arena *Arena) configureNotifiers() {
|
||||
arena.DisplayConfigurationNotifier = websocket.NewNotifier("displayConfiguration",
|
||||
arena.generateDisplayConfigurationMessage)
|
||||
arena.LedModeNotifier = websocket.NewNotifier("ledMode", arena.generateLedModeMessage)
|
||||
arena.LowerThirdNotifier = websocket.NewNotifier("lowerThird", nil)
|
||||
arena.LowerThirdNotifier = websocket.NewNotifier("lowerThird", arena.generateLowerThirdMessage)
|
||||
arena.MatchLoadNotifier = websocket.NewNotifier("matchLoad", arena.generateMatchLoadMessage)
|
||||
arena.MatchTimeNotifier = websocket.NewNotifier("matchTime", arena.generateMatchTimeMessage)
|
||||
arena.MatchTimingNotifier = websocket.NewNotifier("matchTiming", arena.generateMatchTimingMessage)
|
||||
@@ -80,6 +80,10 @@ func (arena *Arena) configureNotifiers() {
|
||||
arena.ScoringStatusNotifier = websocket.NewNotifier("scoringStatus", arena.generateScoringStatusMessage)
|
||||
}
|
||||
|
||||
func (arena *Arena) generateAllianceSelectionMessage() interface{} {
|
||||
return &arena.AllianceSelectionAlliances
|
||||
}
|
||||
|
||||
func (arena *Arena) generateAllianceStationDisplayModeMessage() interface{} {
|
||||
return arena.AllianceStationDisplayMode
|
||||
}
|
||||
@@ -112,6 +116,10 @@ func (arena *Arena) generateLedModeMessage() interface{} {
|
||||
return &LedModeMessage{arena.ScaleLeds.GetCurrentMode(), arena.RedVaultLeds.CurrentForceMode}
|
||||
}
|
||||
|
||||
func (arena *Arena) generateLowerThirdMessage() interface{} {
|
||||
return arena.LowerThird
|
||||
}
|
||||
|
||||
func (arena *Arena) generateMatchLoadMessage() interface{} {
|
||||
teams := make(map[string]*model.Team)
|
||||
for station, allianceStation := range arena.AllianceStations {
|
||||
|
||||
Reference in New Issue
Block a user