Skip to content

Commit f4d16d8

Browse files
committed
[feature] Add buttons to switch between main and field view
1 parent cd6bc02 commit f4d16d8

File tree

4 files changed

+30
-6
lines changed

4 files changed

+30
-6
lines changed

src/App.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,20 @@
88
<router-view></router-view>
99

1010
<ControlFlowBar id="match-controls"/>
11+
<SwitchWindowBar/>
1112
</div>
1213
</template>
1314

1415
<script>
1516
import MatchSettingsBar from "./components/control/MatchSettingsBar";
1617
import GameStateBar from './components/GameStateBar.vue'
1718
import ControlFlowBar from "./components/control/ControlFlowBar";
19+
import SwitchWindowBar from "./components/control/SwitchWindowBar";
1820
1921
export default {
2022
name: 'app',
2123
components: {
24+
SwitchWindowBar,
2225
MatchSettingsBar,
2326
GameStateBar,
2427
ControlFlowBar,

src/components/AutonomousControl.vue renamed to src/components/Main.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import GameEventsView from "./game-events/GameEventsView";
1515
1616
export default {
17-
name: "AutonomousControl",
17+
name: "Main",
1818
components: {
1919
ManualControlView,
2020
TeamOverviewView,
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<template>
2+
<div class="switch-window-bar">
3+
<b-button @click="$router.push('/')">Main</b-button>
4+
<b-button @click="$router.push('/field')">Field</b-button>
5+
</div>
6+
</template>
7+
8+
<script>
9+
export default {
10+
name: "SwitchWindowBar"
11+
}
12+
</script>
13+
14+
<style scoped>
15+
16+
.switch-window-bar {
17+
position: fixed;
18+
bottom: 0;
19+
text-align: left;
20+
display: flex;
21+
justify-content: left;
22+
}
23+
24+
</style>

src/main.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ import {FontAwesomeIcon} from '@fortawesome/vue-fontawesome'
3838
import VueNativeSock from 'vue-native-websocket'
3939

4040
import './assets/css/style.css'
41-
import AutonomousControl from "./components/AutonomousControl";
42-
import ManualControlView from "./components/manual-control/ManualControlView";
41+
import Main from "./components/Main";
4342
import Field from "./components/Field";
4443

4544
Vue.use(TimestampFormatter);
@@ -92,10 +91,8 @@ Vue.use(VueNativeSock, wsAddress, {
9291
});
9392

9493
const routes = [
95-
{path: '/autonomous', component: AutonomousControl},
9694
{path: '/field', component: Field},
97-
{path: '/manual', component: ManualControlView},
98-
{path: '/', component: AutonomousControl},
95+
{path: '/', component: Main},
9996
];
10097
const router = new VueRouter({
10198
routes

0 commit comments

Comments
 (0)