aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeckoEidechse <gecko.eidechse+git@pm.me>2024-07-15 16:51:20 +0200
committerGeckoEidechse <gecko.eidechse+git@pm.me>2024-07-15 16:51:20 +0200
commit9ee553ef23cb86b2fcdf7879149c833c81fa8fb5 (patch)
tree9a4cf72784dbfbdccea82d0781c6e0028f63bed8
parent3ce94cde959df602fc2ed9fc42d24edf24efe7a4 (diff)
downloadFlightCore-9ee553ef23cb86b2fcdf7879149c833c81fa8fb5.tar.gz
FlightCore-9ee553ef23cb86b2fcdf7879149c833c81fa8fb5.zip
feat: Change repair window to tab
-rw-r--r--src-vue/src/App.vue3
-rw-r--r--src-vue/src/i18n/lang/en.json6
-rw-r--r--src-vue/src/plugins/store.ts4
-rw-r--r--src-vue/src/views/SettingsView.vue16
4 files changed, 16 insertions, 13 deletions
diff --git a/src-vue/src/App.vue b/src-vue/src/App.vue
index 162b0b34..3a1eec8d 100644
--- a/src-vue/src/App.vue
+++ b/src-vue/src/App.vue
@@ -57,7 +57,7 @@ export default {
<div class="app-inner">
<div id="fc_bg__container" :style="bgStyle"/>
- <nav id="fc_menu-bar" v-if="$route.path !== '/repair'"><!-- Hide menu bar in repair view -->
+ <nav id="fc_menu-bar">
<!-- Navigation items -->
<el-menu
:default-active="$route.path"
@@ -70,6 +70,7 @@ export default {
<el-menu-item index="/changelog">{{ $t('menu.changelog') }}</el-menu-item>
<el-menu-item index="/mods">{{ $t('menu.mods') }}</el-menu-item>
<el-menu-item index="/settings">{{ $t('menu.settings') }}</el-menu-item>
+ <el-menu-item index="/repair" v-if="$store.state.repair_view_visible">{{ $t('menu.repair') }}</el-menu-item>
<el-menu-item index="/dev" v-if="$store.state.developer_mode">{{ $t('menu.dev') }}</el-menu-item>
</el-menu>
diff --git a/src-vue/src/i18n/lang/en.json b/src-vue/src/i18n/lang/en.json
index 4c3da49f..1551e7a4 100644
--- a/src-vue/src/i18n/lang/en.json
+++ b/src-vue/src/i18n/lang/en.json
@@ -4,6 +4,7 @@
"changelog": "Changelog",
"mods": "Mods",
"settings": "Settings",
+ "repair": "Repair",
"dev": "Dev"
},
@@ -128,11 +129,10 @@
"repair": {
"title": "Repair",
- "open_window": "Open repair window",
+ "open_view": "Open repair view",
"window": {
- "title": "FlightCore repair window",
- "warning": "This window contains various functionality to repair common issues with Northstar and FlightCore.",
+ "warning": "This view contains various functionality to repair common issues with Northstar and FlightCore.",
"disable_all_but_core": "Disable all but core mods",
"disable_all_but_core_success": "Disabled all mods but core",
"disable_modsettings": "Disable ModSettings mod",
diff --git a/src-vue/src/plugins/store.ts b/src-vue/src/plugins/store.ts
index b61ac573..68415346 100644
--- a/src-vue/src/plugins/store.ts
+++ b/src-vue/src/plugins/store.ts
@@ -27,6 +27,8 @@ const persistentStore = new Store('flight-core-settings.json');
export interface FlightCoreStore {
developer_mode: boolean,
+ repair_view_visible: boolean,
+
game_install: GameInstall,
flightcore_version: string,
@@ -64,6 +66,8 @@ export const store = createStore<FlightCoreStore>({
state(): FlightCoreStore {
return {
developer_mode: false,
+ repair_view_visible: false,
+
game_install: {game_path: undefined, profile: undefined, install_type: "UNKNOWN"} as unknown as GameInstall,
available_profiles: [],
diff --git a/src-vue/src/views/SettingsView.vue b/src-vue/src/views/SettingsView.vue
index 5ead665b..613c5a26 100644
--- a/src-vue/src/views/SettingsView.vue
+++ b/src-vue/src/views/SettingsView.vue
@@ -104,11 +104,11 @@
<language-selector/>
</div>
- <!-- Repair window -->
+ <!-- Repair view -->
<div class="fc_parameter__panel">
<h3>{{ $t('settings.repair.title') }}</h3>
- <el-button type="primary" @click="openRepairWindow">
- {{ $t('settings.repair.open_window') }}
+ <el-button type="primary" @click="openRepairView">
+ {{ $t('settings.repair.open_view') }}
</el-button>
</div>
@@ -152,6 +152,7 @@ const persistentStore = new Store('flight-core-settings.json');
import { open } from '@tauri-apps/api/shell';
import { i18n } from '../main';
import { ElMessageBox } from 'element-plus'
+import { Tabs } from "../utils/Tabs";
export default defineComponent({
name: "SettingsView",
@@ -241,12 +242,9 @@ export default defineComponent({
async updateGamePath() {
this.$store.commit('updateGamePath');
},
- async openRepairWindow() {
- await invoke("open_repair_window")
- .then((message) => { })
- .catch((error) => {
- showErrorNotification(error);
- });
+ async openRepairView() {
+ this.$store.state.repair_view_visible = true;
+ this.$store.commit('updateCurrentTab', Tabs.REPAIR);
},
async openGameInstallFolder() {
// Verify the game path is actually set