aboutsummaryrefslogtreecommitdiff
path: root/src-vue/src/views
diff options
context:
space:
mode:
authorRémy Raes <contact@remyraes.com>2022-10-19 14:50:20 +0200
committerGitHub <noreply@github.com>2022-10-19 14:50:20 +0200
commit4e55dce30214a426c8621c565f525303b43fbf7f (patch)
tree22a053a9f09b88190086a34c4e8295ef78f0ba53 /src-vue/src/views
parent546d1908b15fc7c21b1b5f0109826fb03a5493fd (diff)
downloadFlightCore-4e55dce30214a426c8621c565f525303b43fbf7f.tar.gz
FlightCore-4e55dce30214a426c8621c565f525303b43fbf7f.zip
feat: Manually find game if needed (#7)
* refactor: move updateGamePath method in store mutations * feat: play button allows game path update If game path was not found automatically and the user clicks the play button, FlightCore will ask him to point out his Titanfall2 installation folder. * refactor: change button text * feat: display a notification on successful game folder selection * feat: close permanent notification on successful game folder selection * fix: allow game launch with UNKNOWN install type on Windows * feat: set install type to UNKNOWN on manual folder pick * refactor: update omni-button text when game folder wasn't found
Diffstat (limited to 'src-vue/src/views')
-rw-r--r--src-vue/src/views/SettingsView.vue36
1 files changed, 1 insertions, 35 deletions
diff --git a/src-vue/src/views/SettingsView.vue b/src-vue/src/views/SettingsView.vue
index 5dd4e2b9..acc1874d 100644
--- a/src-vue/src/views/SettingsView.vue
+++ b/src-vue/src/views/SettingsView.vue
@@ -21,11 +21,7 @@
</template>
<script lang="ts">
-import { open } from '@tauri-apps/api/dialog';
-import { appDir } from '@tauri-apps/api/path';
-import { invoke } from "@tauri-apps/api";
import { defineComponent } from "vue";
-import { ElNotification } from 'element-plus';
export default defineComponent({
name: "SettingsView",
@@ -36,37 +32,7 @@ export default defineComponent({
},
methods: {
async updateGamePath() {
- // Open a selection dialog for directories
- const selected = await open({
- directory: true,
- multiple: false,
- defaultPath: await appDir(),
- });
- if (Array.isArray(selected)) {
- // user selected multiple directories
- alert("Please only select a single directory");
- } else if (selected === null) {
- // user cancelled the selection
- } else {
- // user selected a single directory
-
- // Verify if valid Titanfall2 install location
- let is_valid_titanfall2_install = await invoke("verify_install_location", { gamePath: selected }) as boolean;
- if (is_valid_titanfall2_install) {
- this.$store.state.game_path = selected;
- // Check for Northstar install
- this.$store.commit('checkNorthstarUpdates');
- }
- else {
- // Not valid Titanfall2 install
- ElNotification({
- title: 'Wrong folder',
- message: "Selected folder is not a valid Titanfall2 install.",
- type: 'error',
- position: 'bottom-right'
- });
- }
- }
+ this.$store.commit('updateGamePath');
}
},
mounted() {