Skip to content

Commit 6e17614

Browse files
committed
[feature] Always continue with stop after halt
1 parent aca32ed commit 6e17614

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

internal/app/controller/engine.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,12 +282,12 @@ func (e *Engine) Continue() {
282282
e.State.TeamState[TeamBlue].BotSubstitutionIntend = false
283283
e.State.TeamState[TeamYellow].BotSubstitutionIntend = false
284284
e.SendCommand(CommandHalt, "")
285-
} else if e.State.NextCommand != CommandUnknown {
286-
log.Printf("Let game continue with next command")
287-
e.SendCommand(e.State.NextCommand, e.State.NextCommandFor)
288285
} else if e.State.Command == CommandHalt {
289286
// continue with a stop after halt to let the robots prepare
290287
e.SendCommand(CommandStop, "")
288+
} else if e.State.NextCommand != CommandUnknown {
289+
log.Printf("Let game continue with next command")
290+
e.SendCommand(e.State.NextCommand, e.State.NextCommandFor)
291291
} else {
292292
if e.State.Command != CommandStop {
293293
// halt the game, if not in STOP.

src/components/control/ControlFlowBar.vue

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
v-on:click="triggerContinue"
1818
v-bind:disabled="!continuePossible">
1919
Continue
20-
<span v-if="state.nextCommand !== ''">with</span>
21-
<span :class="{'team-blue': state.nextCommandFor === 'Blue', 'team-yellow': state.nextCommandFor === 'Yellow'}">
22-
{{state.nextCommand}}
20+
<span v-if="nextCommand !== ''">with</span>
21+
<span :class="{'team-blue': nextCommandFor === 'Blue', 'team-yellow': nextCommandFor === 'Yellow'}">
22+
{{nextCommand}}
2323
</span>
2424
</b-button>
2525
</div>
@@ -51,7 +51,7 @@
5151
},
5252
keymapContinue() {
5353
return {
54-
'ctrl+alt+space': () => {
54+
'ctrl+space': () => {
5555
if (!this.$refs.btnContinue.disabled) {
5656
this.triggerContinue()
5757
}
@@ -65,12 +65,24 @@
6565
return this.state.command === 'halt';
6666
},
6767
continuePossible() {
68-
return this.halted || this.state.nextCommand !== '';
68+
return this.nextCommand !== '';
6969
},
7070
stopAllowed() {
7171
return isNonPausedStage(this.$store.state.refBoxState)
7272
|| isPreStage(this.$store.state.refBoxState);
7373
},
74+
nextCommand() {
75+
if (this.halted) {
76+
return 'stop'
77+
}
78+
return this.state.nextCommand;
79+
},
80+
nextCommandFor() {
81+
if (this.halted) {
82+
return ''
83+
}
84+
return this.state.nextCommandFor;
85+
}
7486
}
7587
}
7688
</script>

0 commit comments

Comments
 (0)