46 lines
855 B
Vue
46 lines
855 B
Vue
<template>
|
|
<nav v-if="isGamemaster" class="gamecontrols">
|
|
<button @click="startGame">Start</button>
|
|
<button @click="resetGame">Reset</button>
|
|
<button @click="continueGame">Continue</button>
|
|
</nav>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
computed: {
|
|
user() {
|
|
return this.$store.state.engine.user || {}
|
|
},
|
|
isGamemaster() {
|
|
const user = this.$store.state.engine.user
|
|
return user && user.role === 'gamemaster'
|
|
},
|
|
},
|
|
methods: {
|
|
startGame() {
|
|
this.$engine.startGame()
|
|
},
|
|
resetGame() {
|
|
this.$engine.resetGame()
|
|
},
|
|
continueGame() {
|
|
this.$engine.continueGame()
|
|
},
|
|
},
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
.gamecontrols {
|
|
padding: 8px 1em;
|
|
border-bottom: 1px solid #808080;
|
|
|
|
button {
|
|
font-family: Dosis;
|
|
padding: 0 1rem;
|
|
font-size: 18px;
|
|
}
|
|
}
|
|
</style>
|