mirror of
https://github.com/Team254/cheesy-arena-lite.git
synced 2026-03-09 13:46:44 -04:00
Updated announcer display for 2015 game.
This commit is contained in:
@@ -144,9 +144,12 @@ func AnnouncerDisplayWebsocketHandler(w http.ResponseWriter, r *http.Request) {
|
||||
BlueScoreSummary *ScoreSummary
|
||||
RedFouls []Foul
|
||||
BlueFouls []Foul
|
||||
RedCards map[string]string
|
||||
BlueCards map[string]string
|
||||
}{mainArena.savedMatch.CapitalizedType(), mainArena.savedMatch.DisplayName,
|
||||
mainArena.savedMatchResult.RedScoreSummary(), mainArena.savedMatchResult.BlueScoreSummary(),
|
||||
mainArena.savedMatchResult.RedScore.Fouls, mainArena.savedMatchResult.BlueScore.Fouls}
|
||||
mainArena.savedMatchResult.RedScore.Fouls, mainArena.savedMatchResult.BlueScore.Fouls,
|
||||
mainArena.savedMatchResult.RedCards, mainArena.savedMatchResult.BlueCards}
|
||||
case _, ok := <-audienceDisplayListener:
|
||||
if !ok {
|
||||
return
|
||||
|
||||
@@ -6,6 +6,14 @@
|
||||
var websocket;
|
||||
var teamTemplate = Handlebars.compile($("#teamTemplate").html());
|
||||
var matchResultTemplate = Handlebars.compile($("#matchResultTemplate").html());
|
||||
Handlebars.registerHelper("eachMapEntry", function(context, options) {
|
||||
var ret = "";
|
||||
$.each(context, function(key, value) {
|
||||
var entry = {"key": key, "value": value};
|
||||
ret = ret + options.fn(entry);
|
||||
});
|
||||
return ret;
|
||||
});
|
||||
|
||||
// Handles a websocket message to hide the score dialog once the next match is being introduced.
|
||||
var handleSetAudienceDisplay = function(targetScreen) {
|
||||
@@ -42,10 +50,11 @@ var handleRealtimeScore = function(data) {
|
||||
|
||||
// Handles a websocket message to populate the final score data.
|
||||
var handleSetFinalScore = function(data) {
|
||||
console.log(data);
|
||||
$("#scoreMatchName").text(data.MatchType + " Match " + data.MatchDisplayName);
|
||||
$("#redScoreDetails").html(matchResultTemplate({score: data.RedScoreSummary, fouls: data.RedFouls}));
|
||||
$("#blueScoreDetails").html(matchResultTemplate({score: data.BlueScoreSummary, fouls: data.BlueFouls}));
|
||||
$("#redScoreDetails").html(matchResultTemplate({score: data.RedScoreSummary, fouls: data.RedFouls,
|
||||
cards: data.RedCards}));
|
||||
$("#blueScoreDetails").html(matchResultTemplate({score: data.BlueScoreSummary, fouls: data.BlueFouls,
|
||||
cards: data.BlueCards}));
|
||||
$("#matchResult").modal("show");
|
||||
};
|
||||
|
||||
|
||||
@@ -66,20 +66,20 @@
|
||||
<div class="col-lg-2">{{"{{score.AutoPoints}}"}}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-7 col-lg-offset-1 control-label">Teleop Points</div>
|
||||
<div class="col-lg-2">{{"{{score.TeleopPoints}}"}}</div>
|
||||
<div class="col-lg-7 col-lg-offset-1 control-label">Container Points</div>
|
||||
<div class="col-lg-2">{{"{{score.ContainerPoints}}"}}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-lg-offset-2 control-label">Assist Points</div>
|
||||
<div class="col-lg-2">{{"{{score.AssistPoints}}"}}</div>
|
||||
<div class="col-lg-7 col-lg-offset-1 control-label">Tote Points</div>
|
||||
<div class="col-lg-2">{{"{{score.TotePoints}}"}}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-lg-offset-2 control-label">Truss/Catch Points</div>
|
||||
<div class="col-lg-2">{{"{{score.TrussCatchPoints}}"}}</div>
|
||||
<div class="col-lg-7 col-lg-offset-1 control-label">Litter Points</div>
|
||||
<div class="col-lg-2">{{"{{score.LitterPoints}}"}}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-lg-offset-2 control-label">Goal Points</div>
|
||||
<div class="col-lg-2">{{"{{score.GoalPoints}}"}}</div>
|
||||
<div class="col-lg-7 col-lg-offset-1 control-label">Coopertition Points</div>
|
||||
<div class="col-lg-2">{{"{{score.CoopertitionPoints}}"}}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-7 col-lg-offset-1 control-label">Foul Points</div>
|
||||
@@ -92,11 +92,19 @@
|
||||
<h4>Fouls</h4>
|
||||
{{"{{#each fouls}}"}}
|
||||
<div class="row">
|
||||
<div class="col-lg-4 col-lg-offset-1">{{"{{#if IsTechnical}}"}}Tech {{"{{/if}}"}}Foul</div>
|
||||
<div class="col-lg-3">{{"{{TeamId}}"}}</div>
|
||||
<div class="col-lg-3">{{"{{Rule}}"}}</div>
|
||||
<div class="col-lg-3 col-lg-offset-1">Team {{"{{TeamId}}"}}</div>
|
||||
<div class="col-lg-3 col-lg-offset-1">{{"{{Rule}}"}}</div>
|
||||
</div>
|
||||
{{"{{/each}}"}}
|
||||
<h4>Cards</h4>
|
||||
{{"{{#eachMapEntry cards}}"}}
|
||||
{{"{{#if this.value}}"}}
|
||||
<div class="row">
|
||||
<div class="col-lg-3 col-lg-offset-1">Team {{"{{this.key}}"}}</div>
|
||||
<div class="col-lg-3 col-lg-offset-1" style="text-transform: capitalize;">{{"{{this.value}}"}}</div>
|
||||
</div>
|
||||
{{"{{/if}}"}}
|
||||
{{"{{/eachMapEntry}}"}}
|
||||
</script>
|
||||
{{end}}
|
||||
{{define "script"}}
|
||||
|
||||
Reference in New Issue
Block a user