aboutsummaryrefslogtreecommitdiff
path: root/src-vue
diff options
context:
space:
mode:
Diffstat (limited to 'src-vue')
-rw-r--r--src-vue/src/plugins/store.ts16
-rw-r--r--src-vue/src/views/PlayView.vue6
2 files changed, 21 insertions, 1 deletions
diff --git a/src-vue/src/plugins/store.ts b/src-vue/src/plugins/store.ts
index 2d4b5684..14b96415 100644
--- a/src-vue/src/plugins/store.ts
+++ b/src-vue/src/plugins/store.ts
@@ -4,6 +4,7 @@ import {Tabs} from "../utils/Tabs";
import {invoke} from "@tauri-apps/api";
import {GameInstall} from "../utils/GameInstall";
import {ReleaseCanal} from "../utils/ReleaseCanal";
+import { ElNotification } from 'element-plus';
export const store = createStore({
state () {
@@ -34,6 +35,21 @@ export const store = createStore({
},
updateCurrentTab(state: any, newTab: Tabs) {
state.current_tab = newTab;
+ },
+ launchGame(state: any) {
+ // TODO update installation if release track was switched
+ // TODO install northstar if it wasn't detected
+ // Show an error message if Origin is not running.
+ if (!state.origin_is_running) {
+ ElNotification({
+ title: 'Origin is not running',
+ message: "Northstar cannot launch while you're not authenticated with Origin.",
+ type: 'warning',
+ position: 'bottom-right'
+ });
+ }
+
+ // TODO launch game
}
}
});
diff --git a/src-vue/src/views/PlayView.vue b/src-vue/src/views/PlayView.vue
index d6633f53..af891b5c 100644
--- a/src-vue/src/views/PlayView.vue
+++ b/src-vue/src/views/PlayView.vue
@@ -30,6 +30,10 @@ export default {
showChangelogPage() {
this.$store.commit('updateCurrentTab', Tabs.CHANGELOG);
+ },
+
+ launchGame() {
+ this.$store.commit('launchGame');
}
}
};
@@ -47,7 +51,7 @@ export default {
</div>
</div>
<div>
- <el-button :disabled="northstarIsRunning" type="primary" size="large" class="fc_launch__button">
+ <el-button :disabled="northstarIsRunning" type="primary" size="large" @click="launchGame" class="fc_launch__button">
{{ northstarIsRunning ? "Game is running" : "Launch game" }}
</el-button>
<div v-if="$store.state.developer_mode" id="fc_services__status">