Skip to content

Commit

Permalink
Merge pull request #498 from frank-weinberg/feature/overlay-lineups
Browse files Browse the repository at this point in the history
Support showing lineups & penalties in overlay
  • Loading branch information
frank-weinberg authored Dec 30, 2021
2 parents cc38e31 + 6ac23ec commit 1dffaf4
Show file tree
Hide file tree
Showing 25 changed files with 444 additions and 121 deletions.
12 changes: 6 additions & 6 deletions html/components/rulesets-tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ function createRulesetsTab(tab, id, isGame) {
// If the definitions change, we'll have to redraw the rulesets too.
var rereadProperties = ['ScoreBoard.Rulesets.RuleDefinition', 'ScoreBoard.Rulesets.Ruleset'];
if (isGame) {
rereadProperties.concat('ScoreBoard.Game(' + id + ').Rule(*)');
rereadProperties = rereadProperties.concat('ScoreBoard.Game(' + id + ').Rule(*)');
}
WS.Register(rereadProperties, {
triggerBatchFunc: function () {
Expand Down Expand Up @@ -253,7 +253,7 @@ function createRulesetsTab(tab, id, isGame) {

function displayRuleset() {
var activeId = isGame ? WS.state['ScoreBoard.Game(' + id + ').Ruleset'] || '' : id;
activeRuleset = rulesets[activeId];
activeRuleset = rulesets[activeId] || rulesets[''];
if (!activeRuleset) {
return;
}
Expand All @@ -273,19 +273,19 @@ function createRulesetsTab(tab, id, isGame) {
});

if (isTrue(activeRuleset.Readonly)) {
tab.find('#name').prop('disabled', true);
tab.find('#name, #parent').prop('disabled', true);
definitionsDiv.find('.definition *').prop('disabled', true);
definitionsDiv.find('.Update, .EditNote').hide();
} else if (activeRuleset.Effective) {
tab.find('#name').prop('disabled', false);
tab.find('#name, #parent').prop('disabled', false);
definitionsDiv.find('.Update, .EditNote').show();
} else if (activeRuleset.Id === '') {
tab.find('#name').prop('disabled', true);
tab.find('#name, #parent').prop('disabled', true);
definitionsDiv.find('.definition .Selector').prop('disabled', true);
definitionsDiv.find('.Update').show();
definitionsDiv.find('.EditNote').hide();
} else {
tab.find('#name').prop('disabled', false);
tab.find('#name, #parent').prop('disabled', false);
definitionsDiv.find('.Update').show();
definitionsDiv.find('.EditNote').hide();
}
Expand Down
2 changes: 1 addition & 1 deletion html/nso/plt/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<script type="text/javascript" src="/json/core.js"></script>
<script type="text/javascript" src="/javascript/windowfunctions.js"></script>
<script type="text/javascript" src="/components/plt-input.js"></script>
<script type="text/javascript" src="/components//lt-sheet.js"></script>
<script type="text/javascript" src="/components/lt-sheet.js"></script>
<link rel="stylesheet" href="/components/plt-input.css" type="text/css" />
<link rel="stylesheet" href="/components/lt-sheet.css" type="text/css" />
</head>
Expand Down
2 changes: 1 addition & 1 deletion html/nso/sbo/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions html/views/common.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
function jammer(k, v, ov) {
function jammer(k, v) {
'use strict';
var id = getTeamId(k);
var prefix = 'ScoreBoard.CurrentGame.Team(' + id + ').';
var jammerName = WS.state[prefix + 'Position(Jammer).Name'];
var pivotName = WS.state[prefix + 'Position(Pivot).Name'];
var leadJammer = isTrue(WS.state[prefix + 'DisplayLead']);
var starPass = isTrue(WS.state[prefix + 'StarPass']);
var inJam = isTrue(WS.state['ScoreBoard.InJam']);
var inJam = isTrue(WS.state['ScoreBoard.CurrentGame.InJam']);

if (jammerName == null || jammerName === '') {
jammerName = leadJammer && !ov ? 'Lead' : '';
if (pivotName == null) {
pivotName = '';
}
jammerName = leadJammer ? 'Lead' : '';
}
if (pivotName == null) {
pivotName = '';
}

var jn = !starPass ? jammerName : pivotName;
Expand Down
5 changes: 5 additions & 0 deletions html/views/overlay/admin/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ label { font-variant: small-caps; }
#Controls { float: left; width: 10%; }
#Preview { float: left; width: 89%; height: 98%; }

#Preview > iframe { border: 3px solid black; margin: 10px; width: 1080px; height: 720px; }
#Preview.Wide > iframe { width: 1100px; }
#Preview.XWide > iframe { width: 1440px; }

h2 { margin: 0 0 10px 0; padding: 4px 4px; display: block; border-radius: 6px; text-align: center; }

Expand All @@ -28,6 +31,8 @@ button.ToggleSwitch { cursor: pointer; outline: none; width: 100%; transition: a
button.ToggleSwitch { border: 0px solid; border-color: #999 #999 #999 #FF0000; background: #666; border-left-width: 20px; border-right-width: 0px; text-decoration: none; }
button.ToggleSwitch.current { border: 0px solid; border-color: #999 #00FF00 #999 #999; background: #666; border-right-width: 20px; border-left-width: 0px; text-decoration: none; }

button.ToggleSwitch.disabled { border-left-color: #ff8888; border-right-color: #ffff33; background: #aaa; }

button.Reverse { border-color: #999 #999 #999 #FF0000; border-left-width: 20px; border-right-width: 0px; }
button.Reverse.current { border-color: #999 #00FF00 #999 #999; border-right-width: 20px; border-left-width: 0px; }

Expand Down
8 changes: 5 additions & 3 deletions html/views/overlay/admin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
<h2>Elements</h2>
<button data-key="C" data-setting="ScoreBoard.Settings.Setting(Overlay.Interactive.Clock)" class="ToggleSwitch">Clock [C]</button>
<button data-key="S" data-setting="ScoreBoard.Settings.Setting(Overlay.Interactive.Score)" class="ToggleSwitch">Score [S]</button>
<button data-key="J" data-setting="ScoreBoard.Settings.Setting(Overlay.Interactive.ShowJammers)" class="ToggleSwitch">Jammers [J]</button><br/>
<button data-key="J" data-setting="ScoreBoard.Settings.Setting(Overlay.Interactive.ShowJammers)" class="ToggleSwitch">Jammer Names [J]</button><br/>
<button data-key="L" data-setting="ScoreBoard.Settings.Setting(Overlay.Interactive.ShowLineups)" class="ToggleSwitch">Lineups [L]</button><br/>
<button data-key="N" data-setting="ScoreBoard.Settings.Setting(Overlay.Interactive.ShowAllNames)" class="ToggleSwitch">All Names [N]</button><br/>
</p>

<p id="Panel">
Expand All @@ -28,7 +30,7 @@ <h2>Panels</h2>
<option data-key="3" value="PenaltyTeam1">Penalty (T1) [3]</option>
<option data-key="4" value="PenaltyTeam2">Penalty (T2) [4]</option>
<option data-key="9" value="LowerThird" data-form=".ExtraFormLower">Lower Third [9]</option>
<option data-key="N" value="Upcoming">Upcoming [n]</option>
<option data-key="U" value="Upcoming">Upcoming [U]</option>
</select>


Expand Down Expand Up @@ -82,7 +84,7 @@ <h2>Team Display</h2>

</div>
<div id="Preview">
<iframe src="../index.html" style="border: 3px solid black; margin: 10px; width: 1080px; height: 720px; ">
<iframe src="../index.html">
</iframe>
</div>

Expand Down
29 changes: 29 additions & 0 deletions html/views/overlay/admin/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1dffaf4

Please sign in to comment.