diff --git a/src/i18n/de-DE/gameMode/viewingRate.ts b/src/i18n/de-DE/gameMode/viewingRate.ts index c368748..d793284 100644 --- a/src/i18n/de-DE/gameMode/viewingRate.ts +++ b/src/i18n/de-DE/gameMode/viewingRate.ts @@ -1,6 +1,7 @@ export default { title: 'Einschaltquote', + controllersReady: '{count} Controller bereit!', currentlyViewing: 'Aktuell eingeschaltet', totalWatchRate: 'Totale Einschaltquote', @@ -24,5 +25,12 @@ export default { action: { ok: 'Ok', }, + + error: { + newController: { + message: 'Neue Controller sind vom diesem Spiel ausgeschlossen!.', + caption: 'Controller: ', + }, + }, }, }; diff --git a/src/i18n/en-US/gameMode/viewingRate.ts b/src/i18n/en-US/gameMode/viewingRate.ts index a65b6f2..5c491f1 100644 --- a/src/i18n/en-US/gameMode/viewingRate.ts +++ b/src/i18n/en-US/gameMode/viewingRate.ts @@ -1,6 +1,7 @@ export default { title: 'Viewing Rate', + controllersReady: '{count} controllers ready!', currentlyViewing: 'Currently viewing', totalWatchRate: 'Total viewing rate', @@ -25,4 +26,11 @@ export default { ok: 'Ok', }, }, + + error: { + newController: { + message: 'New controllers are excluded from this game.', + caption: 'Controller: ', + }, + }, }; diff --git a/src/pages/gameModes/ViewingRateGamePage.vue b/src/pages/gameModes/ViewingRateGamePage.vue index bcff6fb..5ddbbee 100644 --- a/src/pages/gameModes/ViewingRateGamePage.vue +++ b/src/pages/gameModes/ViewingRateGamePage.vue @@ -25,7 +25,7 @@ > {{ - t('gameMode.stopwatch.controllersReady', { + t('gameMode.viewingRate.controllersReady', { count: settings.readyCheck ? gameState.controllersReady.length : controllers.length, @@ -433,10 +433,21 @@ const runningListener = transition('running', (state, event: ButtonEvent) => { } const controllerId = event.controller.id; - const changes = { ...state.changeTimes }; - if (!(controllerId in changes)) { - changes[controllerId] = []; + + // Ignore controllers that connected after the start. + // This is to ensure correct calculation. + if (!(controllerId in state.changeTimes)) { + quasar.notify({ + message: t('gameMode.viewingRate.error.newController.message'), + caption: + t('gameMode.viewingRate.error.newController.caption') + + event.controller.name, + color: 'negative', + }); + return; } + + const changes = { ...state.changeTimes }; changes[controllerId].push(time.value); event.controller.setLight(isControllerViewing(state, event.controller.id));