Skip to content

Commit 0772344

Browse files
committed
[bugfix] Add missing new game event to UI
1 parent 4b641ac commit 0772344

File tree

4 files changed

+60
-0
lines changed

4 files changed

+60
-0
lines changed

src/components/create-event/EventAccordion.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import AttackerTouchedBallInDefenseArea from "./inputs/AttackerTouchedBallInDefenseArea"
2121
import AttackerTooCloseToDefenseArea from "./inputs/AttackerTooCloseToDefenseArea"
2222
import AttackerTouchedOpponentInDefenseArea from "./inputs/AttackerTouchedOpponentInDefenseArea"
23+
import AttackerTouchedOpponentInDefenseAreaSkipped from "./inputs/AttackerTouchedOpponentInDefenseAreaSkipped"
2324
import BallLeftFieldGoalLine from "./inputs/BallLeftFieldGoalLine"
2425
import BallLeftFieldTouchLine from "./inputs/BallLeftFieldTouchLine"
2526
import BotCrashDrawn from "./inputs/BotCrashDrawn"
@@ -61,6 +62,7 @@
6162
AttackerTouchedBallInDefenseArea,
6263
AttackerTooCloseToDefenseArea,
6364
AttackerTouchedOpponentInDefenseArea,
65+
AttackerTouchedOpponentInDefenseAreaSkipped,
6466
BallLeftFieldGoalLine,
6567
BallLeftFieldTouchLine,
6668
BotCrashDrawn,
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<template>
2+
<div>
3+
<TeamSelection :model="model" label="By: "/>
4+
<BotSelection :model="model" label="By Bot: "/>
5+
<LocationSelection :model="model.location" label="Location [m]: "/>
6+
<b-button variant="primary"
7+
@click="sendEvent()"
8+
:disabled="model.team === null">
9+
Add
10+
</b-button>
11+
</div>
12+
</template>
13+
14+
<script>
15+
import TeamSelection from "@/components/common/TeamSelection";
16+
import BotSelection from "@/components/common/BotSelection";
17+
import LocationSelection from "@/components/common/LocationSelection";
18+
import {convertStringLocation} from "@/refereeState";
19+
20+
export default {
21+
name: "AttackerTouchedOpponentInDefenseAreaSkipped",
22+
components: {BotSelection, TeamSelection, LocationSelection},
23+
data() {
24+
return {
25+
model: {
26+
team: null,
27+
id: null,
28+
location: {x: null, y: null}
29+
}
30+
}
31+
},
32+
methods: {
33+
sendEvent: function () {
34+
this.$socket.sendObj({
35+
gameEvent: {
36+
type: 'attackerTouchedOpponentInDefenseAreaSkipped',
37+
details: {
38+
['attackerTouchedOpponentInDefenseAreaSkipped']: {
39+
by_team: this.model.team.toLocaleUpperCase(),
40+
by_bot: parseInt(this.model.id),
41+
location: convertStringLocation(this.model.location)
42+
}
43+
}
44+
}
45+
});
46+
this.$root.$emit('bv::hide::modal', 'new-event-modal');
47+
}
48+
},
49+
}
50+
</script>
51+
52+
<style scoped>
53+
54+
</style>

src/components/protocol/ProtocolTable.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@
103103
return 'exclamation-triangle';
104104
case 'ignoredGameEvent':
105105
return 'exclamation';
106+
case 'gameEventQueued':
107+
return 'recycle';
106108
case 'modify':
107109
return 'edit';
108110
case 'teamAction':

src/main.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import {
3232
faUsers,
3333
faBullhorn,
3434
faChessBoard,
35+
faRecycle,
3536
} from '@fortawesome/free-solid-svg-icons'
3637
import {FontAwesomeIcon} from '@fortawesome/vue-fontawesome'
3738
// Connect to the backend with a single websocket that communicates with JSON format and is attached to the store
@@ -68,6 +69,7 @@ library.add(faClock);
6869
library.add(faExclamation);
6970
library.add(faUsers);
7071
library.add(faBullhorn);
72+
library.add(faRecycle);
7173
Vue.component('font-awesome-icon', FontAwesomeIcon);
7274

7375

0 commit comments

Comments
 (0)