Skip to content

Commit deaab25

Browse files
committed
Substitution and timeout through continue button
1 parent 2300c85 commit deaab25

File tree

1 file changed

+28
-6
lines changed

1 file changed

+28
-6
lines changed

src/components/control/ControlFlowBar.vue

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@
1818
v-on:click="triggerContinue"
1919
v-bind:disabled="continueDisabled">
2020
Continue
21-
<span v-if="nextCommand && nextCommand.type">with</span>
22-
<span v-if="nextCommand"
23-
:class="teamColorClass">
24-
{{ nextCommand.type }}
25-
</span>
21+
<template v-if="botSubstitutionRequested && timeoutRequested"> with timeout and bot substitution</template>
22+
<template v-else-if="botSubstitutionRequested"> with bot substitution</template>
23+
<template v-else-if="timeoutRequested"> with timeout</template>
24+
<template v-else-if="nextCommand && nextCommand.type">with
25+
<span :class="teamColorClass">{{ nextCommand.type }}</span>
26+
</template>
2627
<span v-for="issue of continuationIssues" v-bind:key="issue">
2728
<br>
2829
- {{issue}}
@@ -68,11 +69,32 @@ export default {
6869
halted() {
6970
return this.$store.state.matchState.command.type === 'HALT';
7071
},
72+
gameRunning() {
73+
switch (this.$store.state.matchState.command.type) {
74+
case 'FORCE_START':
75+
case 'NORMAL_START':
76+
case 'DIRECT':
77+
case 'INDIRECT':
78+
case 'KICKOFF':
79+
case 'PENALTY':
80+
case 'BALL_PLACEMENT':
81+
return true;
82+
}
83+
return false;
84+
},
7185
timeoutActive() {
7286
return this.$store.state.matchState.command.type === 'TIMEOUT';
7387
},
88+
timeoutRequested() {
89+
return this.$store.state.matchState.teamState[TEAM_YELLOW].requestsTimeoutSince !== null
90+
|| this.$store.state.matchState.teamState[TEAM_BLUE].requestsTimeoutSince !== null;
91+
},
92+
botSubstitutionRequested() {
93+
return this.$store.state.matchState.teamState[TEAM_YELLOW].requestsBotSubstitutionSince !== null
94+
|| this.$store.state.matchState.teamState[TEAM_BLUE].requestsBotSubstitutionSince !== null;
95+
},
7496
continueDisabled() {
75-
return !this.nextCommand;
97+
return this.gameRunning || (!this.nextCommand && !this.timeoutRequested && !this.botSubstitutionRequested);
7698
},
7799
stopAllowed() {
78100
return isNonPausedStage(this.$store.state.matchState)

0 commit comments

Comments
 (0)