diff options
author | Alystrasz <contact@remyraes.com> | 2022-09-27 23:46:40 +0200 |
---|---|---|
committer | Alystrasz <contact@remyraes.com> | 2022-09-27 23:46:40 +0200 |
commit | 5c389c65d00accfb75277e4c91b40899e6f3c79f (patch) | |
tree | c4aa953ded5a7e6259eb890e66bc5d6f5e8272fb /src-vue/src/views/PlayView.vue | |
parent | 3fbff7947f206561d3dde7ad01b8712ee7c59311 (diff) | |
download | FlightCore-5c389c65d00accfb75277e4c91b40899e6f3c79f.tar.gz FlightCore-5c389c65d00accfb75277e4c91b40899e6f3c79f.zip |
refactor: export PlayButton component to dedicated file
Diffstat (limited to 'src-vue/src/views/PlayView.vue')
-rw-r--r-- | src-vue/src/views/PlayView.vue | 31 |
1 files changed, 5 insertions, 26 deletions
diff --git a/src-vue/src/views/PlayView.vue b/src-vue/src/views/PlayView.vue index 03f54936..5042a127 100644 --- a/src-vue/src/views/PlayView.vue +++ b/src-vue/src/views/PlayView.vue @@ -1,7 +1,7 @@ <script lang="ts"> import { ElNotification } from 'element-plus'; -import { NorthstarState } from '../utils/NorthstarState'; import {Tabs} from "../utils/Tabs"; +import PlayButton from '../components/PlayButton.vue'; export default { data() { @@ -9,6 +9,9 @@ export default { developerModeClicks: 0 } }, + components: { + PlayButton + }, computed: { northstarIsRunning(): boolean { return this.$store.state.northstar_is_running; @@ -16,24 +19,6 @@ export default { northstarVersion(): string { return this.$store.state.installed_northstar_version; }, - playButtonLabel(): string { - if (this.$store.state.northstar_is_running) { - return "Game is running"; - } - - switch(this.$store.state.northstar_state) { - case NorthstarState.INSTALL: - return "Install"; - case NorthstarState.INSTALLING: - return "Installing..." - case NorthstarState.MUST_UPDATE: - return "Update"; - case NorthstarState.UPDATING: - return "Updating..."; - case NorthstarState.READY_TO_PLAY: - return "Launch game"; - } - } }, methods: { activateDeveloperMode() { @@ -52,10 +37,6 @@ export default { showChangelogPage() { this.$store.commit('updateCurrentTab', Tabs.CHANGELOG); - }, - - launchGame() { - this.$store.commit('launchGame'); } } }; @@ -73,9 +54,7 @@ export default { </div> </div> <div> - <el-button :disabled="northstarIsRunning" type="primary" size="large" @click="launchGame" class="fc_launch__button"> - {{ playButtonLabel }} - </el-button> + <PlayButton/> <div v-if="$store.state.developer_mode" id="fc_services__status"> <div> <div class="fc_version__line">Northstar is running: </div> |