Skip to content

Commit 8a309f0

Browse files
committed
Remove update timeout
Also fix some css
1 parent 73aa8b6 commit 8a309f0

File tree

7 files changed

+42
-60
lines changed

7 files changed

+42
-60
lines changed

src/dashboard/checklist/main.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<v-btn
44
class="mt-1"
55
@click="sendUncheckAll">
6-
Uncheck all
6+
Reset
77
</v-btn>
88
<h2 class="mt-2">Checklist</h2>
99
<!-- <div class="multiselect with-transition" :class="{-->

src/extension/tracker/index.ts

+8
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,14 @@ async function setup(): Promise<void> {
290290
require('./bids').setup();
291291
require('./prizes').setup();
292292
require('./donations').setup();
293+
294+
// Update the donation total to a random number while testing
295+
if (useTestData) {
296+
setInterval(() => {
297+
donationTotal.value += Math.random() * 1000;
298+
nodecg().sendMessage('donationTotalUpdated', { total: donationTotal.value });
299+
}, 10 * 1000);
300+
}
293301
/* eslint-enable */
294302
} catch (err) {
295303
nodecg().log.warn('[Tracker] Error setting up');

src/graphics/omnibar/components/Ticker/Bid/Goal.vue

+2-11
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,6 @@
77
'align-items': 'center',
88
}"
99
>
10-
<!-- <div
11-
:style="{
12-
'font-size': '20px',
13-
'text-align': 'right',
14-
'margin-left': '15px',
15-
'line-height': '150%',
16-
}"
17-
>
18-
Upcoming<br>Goal
19-
</div>-->
2010
<div
2111
:style="{
2212
position: 'relative',
@@ -47,7 +37,7 @@
4737
'box-sizing': 'border-box',
4838
}"
4939
>
50-
<div :style="{ width: '30%' }">
40+
<div :style="{ width: '30%', 'font-size': '0px', }">
5141
<span class="BarText" :style="{ 'font-size': '20px' }">
5242
<span
5343
v-if="bid.goal <= bid.total"
@@ -74,6 +64,7 @@
7464
:style="{
7565
width: '30%',
7666
'text-align': 'right',
67+
'font-size': '0px',
7768
}"
7869
>
7970
<span class="BarText" :style="{ 'font-size': '25px' }">

src/graphics/omnibar/components/Ticker/Bid/War-1v1.vue

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
padding: '0 10px',
6161
'box-sizing': 'border-box',
6262
'z-index': 1,
63+
'font-size': '0px',
6364
}"
6465
>
6566
<div>

src/graphics/omnibar/components/Ticker/Bid/War-Other.vue

-13
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,6 @@
77
'align-items': 'center',
88
}"
99
>
10-
<!-- <div
11-
:style="{
12-
'font-size': '20px',
13-
'text-align': 'right',
14-
'margin-left': '15px',
15-
'line-height': '150%',
16-
}"
17-
>
18-
Upcoming<br>Bid War
19-
</div>-->
2010
<div
2111
:style="{
2212
'flex-grow': 1,
@@ -34,7 +24,6 @@
3424
'flex-direction': 'column',
3525
'font-size': '20px',
3626
'text-align': 'center',
37-
'background-color': 'rgba(0, 0, 0, 0.3)',
3827
padding: '0 10px',
3928
'white-space': 'nowrap',
4029
'line-height': '150%',
@@ -59,8 +48,6 @@
5948
overflow: 'hidden',
6049
display: 'flex',
6150
'align-items': 'center',
62-
'background-color': 'rgba(0, 0, 0, 0.3)',
63-
'font-size': '20px',
6451
}"
6552
>
6653
<div

src/graphics/omnibar/components/Total.vue

+24-31
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,15 @@
1818
<div :style="{
1919
position: 'absolute',
2020
top: '10px',
21-
left: '20px',
21+
left: '180px',
2222
'z-index': 99999999999,
2323
}">
2424
<div
2525
v-if="alertList[0]"
2626
:style="{
2727
'z-index': 1,
2828
opacity: showAlert ? 1 : 0,
29+
// opacity: 1,
2930
transition: 'opacity 0.5s',
3031
}"
3132
class="Flex coin-thing"
@@ -61,7 +62,6 @@ import { round } from 'lodash';
6162
6263
@Component
6364
export default class extends Vue {
64-
// @Ref('SFX') sfx!: HTMLAudioElement;
6565
theme = nodecg.bundleConfig.event.theme;
6666
total = 0;
6767
playingAlerts = false;
@@ -109,7 +109,6 @@ export default class extends Vue {
109109
);
110110
if (amount && amount > 0 && showAlert) {
111111
nodecg.sendMessage('omnibarPlaySound', { amount });
112-
// await this.sfx.play();
113112
await new Promise((res) => {
114113
setTimeout(res, 500);
115114
});
@@ -152,25 +151,20 @@ export default class extends Vue {
152151
async created(): Promise<void> {
153152
this.total = this.rawTotal;
154153
nodecg.listenFor('donationTotalUpdated', (data: { total: number }) => {
155-
// If after 10s this hasn't been cleared by a new donation, update the total with it.
156-
this.donationTotalTimeout = window.setTimeout(() => {
157-
nodecg.sendMessage('donationAlertsLogging', 'donationTotalTimeout triggered');
158-
// Double check if the total really needs updating.
159-
// Also, only queue if alerts are not already
160-
// (the play system will check the final total at the end anyway).
161-
const completeTotal = round(data.total + this.additionalDonationsAmount, 2);
162-
if (!this.playingAlerts && completeTotal !== this.total) {
163-
nodecg.sendMessage(
164-
'donationAlertsLogging',
165-
'donationTotalTimeout decided we should push a new total as an alert',
166-
);
167-
this.alertList.push({
168-
total: completeTotal,
169-
showAlert: false,
170-
});
171-
if (!this.playingAlerts) this.playNextAlert(true);
172-
}
173-
}, 10 * 1000);
154+
const completeTotal = round(data.total + this.additionalDonationsAmount, 2);
155+
if (!this.playingAlerts && completeTotal !== this.total) {
156+
nodecg.sendMessage(
157+
'donationAlertsLogging',
158+
'donationTotalTimeout decided we should push a new total as an alert',
159+
);
160+
this.alertList.push({
161+
total: completeTotal,
162+
// @ts-expect-error this works so shrug
163+
amount: (completeTotal - this.total).toFixed(2),
164+
showAlert: true,
165+
});
166+
if (!this.playingAlerts) this.playNextAlert(true);
167+
}
174168
});
175169
nodecg.listenFor('newDonation', (data: { amount: number }) => {
176170
clearTimeout(this.donationTotalTimeout);
@@ -202,17 +196,16 @@ export default class extends Vue {
202196
font-variant-numeric: tabular-nums;
203197
font-size: 40px;
204198
font-weight: 500;
205-
text-align: left;
206-
float: right;
207-
height: 82px;
199+
text-align: center;
200+
//height: 82px;
208201
209-
padding-left: 40px;
210-
padding-right: 40px;
202+
padding-left: 45px;
203+
padding-right: 45px;
211204
212205
background: var(--bsg-color);
213206
214207
--arrow-setting: 50px;
215-
clip-path: polygon(100% 0%, 85% 50%, 100% 100%,
208+
clip-path: polygon(100% 0%, 80% 50%, 100% 100%,
216209
var(--arrow-setting) 100%, 10% 50%, var(--arrow-setting) 0%);
217210
}
218211
@@ -228,14 +221,14 @@ export default class extends Vue {
228221
229222
/* Each character in the total is in a span; setting width so the numbers appear monospaced. */
230223
#Total > span {
231-
font-variant-numeric: tabular-nums;
224+
width: 0.50em;
232225
color: white;
233-
padding-top: 14px;
226+
padding-top: 18px;
234227
display: inline-block;
235228
text-align: center;
236229
background: var(--bsg-color);
230+
//background: cornflowerblue;
237231
position: relative;
238-
font-size: 50px;
239232
}
240233
241234
#Total > .Comma {

src/graphics/omnibar/main.vue

+6-4
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,14 @@ export default class extends Vue {
6565
6666
updateInfoWidth(newTotal: number): void {
6767
if (newTotal < 1000) {
68-
this.infoWidth = '1045px';
68+
// this.infoWidth = '1045px';
69+
this.infoWidth = '1070px';
6970
return;
7071
}
7172
7273
if (newTotal < 10000) {
73-
this.infoWidth = '1015px';
74+
// this.infoWidth = '1015px';
75+
this.infoWidth = '1040px';
7476
return;
7577
}
7678
@@ -248,7 +250,7 @@ html, body {
248250
249251
.dash {
250252
position: absolute;
251-
right: 170px;
253+
right: 160px;
252254
//min-width: 50px;
253255
height: 82px;
254256
top: 0;
@@ -270,7 +272,7 @@ html, body {
270272
.after_right_box {
271273
position: absolute;
272274
--color: var(--dark-arrow-default);
273-
right: 120px;
275+
right: 115px;
274276
}
275277
}
276278
}

0 commit comments

Comments
 (0)