File tree Expand file tree Collapse file tree 7 files changed +52
-23
lines changed Expand file tree Collapse file tree 7 files changed +52
-23
lines changed Original file line number Diff line number Diff line change 9
9
{{state.stage}}
10
10
</span >
11
11
|
12
+ <span v-b-tooltip.hover title =" Current command" >
13
+ {{state.command}} <span v-if =" state.commandForTeam !== ''" >for {{state.commandForTeam}}</span >
14
+ </span >
15
+ |
12
16
<span v-format-ns-duration =" state.stageTimeElapsed"
13
17
v-b-tooltip.hover
14
18
title =" Total time elapsed in the current stage" >
23
27
v-b-tooltip.hover
24
28
title =" Total real time elapsed since the match has been started" >
25
29
</span >
26
- |
27
- <span v-b-tooltip.hover title =" Current command" >
28
- {{state.command}} <span v-if =" state.commandForTeam !== ''" >for {{state.commandForTeam}}</span >
29
- </span >
30
30
</div >
31
31
</template >
32
32
Original file line number Diff line number Diff line change 12
12
:title =" 'Robots have to keep distance to the ball (' + Object.keys(keymapStop)[0] + ')'" >
13
13
<b-button v-hotkey =" keymapStop"
14
14
v-on:click =" send('stop')"
15
- v-bind:disabled =" stopped || !inNormalHalf " >
15
+ v-bind:disabled =" stopped || !stopAllowed " >
16
16
Stop
17
17
</b-button >
18
18
</span >
19
19
<span v-b-tooltip.hover
20
20
:title =" 'Restart the game in draw situations (' + Object.keys(keymapForceStart)[0] + ')'" >
21
21
<b-button v-hotkey =" keymapForceStart"
22
22
v-on:click =" send('forceStart')"
23
- v-bind:disabled =" !stopped || !inNormalHalf " >
23
+ v-bind:disabled =" !stopped || !forceStartAllowed " >
24
24
Force Start
25
25
</b-button >
26
26
</span >
27
27
<span v-b-tooltip.hover
28
28
:title =" 'Continue game after a prepare state (' + Object.keys(keymapNormalStart)[0] + ')'" >
29
29
<b-button v-hotkey =" keymapNormalStart"
30
30
v-on:click =" send('normalStart')"
31
- v-bind:disabled =" !prepareSth || !inNormalHalf " >
31
+ v-bind:disabled =" !prepareSth || !normalStartAllowed " >
32
32
Normal Start
33
33
</b-button >
34
34
</span >
44
44
</template >
45
45
46
46
<script >
47
- import {isInNormalHalf } from " ../../main " ;
47
+ import {isNonPausedStage , isPreStage } from " ../../refereeState " ;
48
48
49
49
export default {
50
50
name: " ControlGeneral" ,
84
84
prepareSth () {
85
85
return this .state .command === ' kickoff' || this .state .command === ' penalty' ;
86
86
},
87
- inNormalHalf () {
88
- return isInNormalHalf (this .state );
87
+ forceStartAllowed () {
88
+ return isNonPausedStage (this .state );
89
+ },
90
+ normalStartAllowed () {
91
+ return isNonPausedStage (this .state ) || this .state .command === ' kickoff' ;
92
+ },
93
+ stopAllowed () {
94
+ return isNonPausedStage (this .$store .state .refBoxState )
95
+ || isPreStage (this .$store .state .refBoxState );
89
96
},
90
97
gameEventPresent () {
91
98
return this .state .gameEvent !== ' none' ;
Original file line number Diff line number Diff line change 21
21
</b-button >
22
22
<b-button v-b-tooltip.hover title =" Change back to the previous stage (if something went wrong)"
23
23
v-on:click =" previousStage"
24
- :disabled =" forbidMatchControls" >
24
+ :disabled =" forbidMatchControls || noPreviousStage " >
25
25
Previous Stage
26
26
</b-button >
27
27
<b-button v-b-tooltip.hover title =" Proceed to the next stage"
28
28
v-on:click =" nextStage"
29
- :disabled =" forbidMatchControls" >
29
+ :disabled =" forbidMatchControls || noNextStage " >
30
30
Next Stage
31
31
</b-button >
32
32
</div >
79
79
},
80
80
forbidMatchControls () {
81
81
return ! this .stopped && ! this .halted ;
82
+ },
83
+ noPreviousStage () {
84
+ return this .state .stage === ' Pre-First Half' ;
85
+ },
86
+ noNextStage () {
87
+ return this .state .stage === ' End of Game' ;
82
88
}
83
89
}
84
90
}
Original file line number Diff line number Diff line change 12
12
:title =" 'Perform direct kick (corner and goal kicks) (' + Object.keys(keymapDirect)[0] + ')'" >
13
13
<b-button v-hotkey =" keymapDirect"
14
14
v-on:click =" send('direct')"
15
- v-bind:disabled =" halted || running || preparing" >
15
+ v-bind:disabled =" halted || running || preparing || !nonPausedStage " >
16
16
Direct
17
17
</b-button >
18
18
</span >
19
19
<span v-b-tooltip.hover
20
20
:title =" 'Perform indirect kick (throw-in) (' + Object.keys(keymapIndirect)[0] + ')'" >
21
21
<b-button v-hotkey =" keymapIndirect"
22
22
v-on:click =" send('indirect')"
23
- v-bind:disabled =" halted || running || preparing" >
23
+ v-bind:disabled =" halted || running || preparing || !nonPausedStage " >
24
24
Indirect
25
25
</b-button >
26
26
</span >
27
27
<span v-b-tooltip.hover
28
28
title =" Prepare for a penalty kick" >
29
29
<b-button v-on:click =" send('penalty')"
30
- v-bind:disabled =" halted || running || preparing" >
30
+ v-bind:disabled =" halted || running || preparing || !nonPausedStage " >
31
31
Penalty
32
32
</b-button >
33
33
</span >
54
54
55
55
<script >
56
56
import ControlTeamTimeout from " ./ControlTeamTimeout" ;
57
+ import {isNonPausedStage } from " ../../refereeState" ;
57
58
58
59
export default {
59
60
name: " ControlTeam" ,
125
126
preparing () {
126
127
return this .state .command === ' kickoff' || this .state .command === ' penalty' ;
127
128
},
129
+ nonPausedStage () {
130
+ return isNonPausedStage (this .state );
131
+ },
128
132
}
129
133
}
130
134
</script >
Original file line number Diff line number Diff line change 2
2
<span >
3
3
<b-button v-show =" !timeoutRunning"
4
4
v-on:click =" startTimeout"
5
- v-bind:disabled =" !inNormalHalf " >
5
+ v-bind:disabled =" disableTimeoutButton " >
6
6
Start Timeout
7
7
</b-button >
8
8
<b-button v-show =" timeoutRunning"
13
13
</template >
14
14
15
15
<script >
16
- import {isInNormalHalf } from " ../../main " ;
16
+ import {isNonPausedStage , isPreStage } from " ../../refereeState " ;
17
17
18
18
export default {
19
19
name: " ControlTeamTimeout" ,
27
27
timeoutRunning : function () {
28
28
return this .command === " timeout" && this .$store .state .refBoxState .commandForTeam === this .teamColor
29
29
},
30
- inNormalHalf () {
31
- return isInNormalHalf (this .$store .state .refBoxState );
30
+ disableTimeoutButton () {
31
+ return ! isNonPausedStage (this .$store .state .refBoxState )
32
+ && ! isPreStage (this .$store .state .refBoxState );
32
33
},
33
34
},
34
35
methods: {
Original file line number Diff line number Diff line change @@ -27,10 +27,6 @@ library.add(faCaretSquareDown);
27
27
library . add ( faCaretSquareUp ) ;
28
28
Vue . component ( 'font-awesome-icon' , FontAwesomeIcon ) ;
29
29
30
- export let isInNormalHalf = function ( state ) {
31
- return state . stage === 'First Half' ;
32
- } ;
33
-
34
30
let wsAddress ;
35
31
if ( process . env . NODE_ENV === 'development' ) {
36
32
// use the default backend port
Original file line number Diff line number Diff line change
1
+ export let isNonPausedStage = function ( state ) {
2
+ return state . stage === 'First Half'
3
+ || state . stage === 'Second Half'
4
+ || state . stage === 'Overtime First Half'
5
+ || state . stage === 'Overtime Second Half'
6
+ || state . stage === 'Shootout' ;
7
+ } ;
8
+
9
+ export let isPreStage = function ( state ) {
10
+ return state . stage === 'Pre-First Half'
11
+ || state . stage === 'Pre-Second Half'
12
+ || state . stage === 'Pre-Overtime First Half'
13
+ || state . stage === 'Pre-Overtime Second Half'
14
+ || state . stage === 'Shootout' ;
15
+ } ;
You can’t perform that action at this time.
0 commit comments