Skip to content

Commit 9ee553e

Browse files
committed
feat: Change repair window to tab
1 parent 3ce94cd commit 9ee553e

File tree

4 files changed

+16
-13
lines changed

4 files changed

+16
-13
lines changed

src-vue/src/App.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export default {
5757
<div class="app-inner">
5858
<div id="fc_bg__container" :style="bgStyle"/>
5959

60-
<nav id="fc_menu-bar" v-if="$route.path !== '/repair'"><!-- Hide menu bar in repair view -->
60+
<nav id="fc_menu-bar">
6161
<!-- Navigation items -->
6262
<el-menu
6363
:default-active="$route.path"
@@ -70,6 +70,7 @@ export default {
7070
<el-menu-item index="/changelog">{{ $t('menu.changelog') }}</el-menu-item>
7171
<el-menu-item index="/mods">{{ $t('menu.mods') }}</el-menu-item>
7272
<el-menu-item index="/settings">{{ $t('menu.settings') }}</el-menu-item>
73+
<el-menu-item index="/repair" v-if="$store.state.repair_view_visible">{{ $t('menu.repair') }}</el-menu-item>
7374
<el-menu-item index="/dev" v-if="$store.state.developer_mode">{{ $t('menu.dev') }}</el-menu-item>
7475
</el-menu>
7576

src-vue/src/i18n/lang/en.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"changelog": "Changelog",
55
"mods": "Mods",
66
"settings": "Settings",
7+
"repair": "Repair",
78
"dev": "Dev"
89
},
910

@@ -128,11 +129,10 @@
128129

129130
"repair": {
130131
"title": "Repair",
131-
"open_window": "Open repair window",
132+
"open_view": "Open repair view",
132133

133134
"window": {
134-
"title": "FlightCore repair window",
135-
"warning": "This window contains various functionality to repair common issues with Northstar and FlightCore.",
135+
"warning": "This view contains various functionality to repair common issues with Northstar and FlightCore.",
136136
"disable_all_but_core": "Disable all but core mods",
137137
"disable_all_but_core_success": "Disabled all mods but core",
138138
"disable_modsettings": "Disable ModSettings mod",

src-vue/src/plugins/store.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ const persistentStore = new Store('flight-core-settings.json');
2727

2828
export interface FlightCoreStore {
2929
developer_mode: boolean,
30+
repair_view_visible: boolean,
31+
3032
game_install: GameInstall,
3133

3234
flightcore_version: string,
@@ -64,6 +66,8 @@ export const store = createStore<FlightCoreStore>({
6466
state(): FlightCoreStore {
6567
return {
6668
developer_mode: false,
69+
repair_view_visible: false,
70+
6771
game_install: {game_path: undefined, profile: undefined, install_type: "UNKNOWN"} as unknown as GameInstall,
6872

6973
available_profiles: [],

src-vue/src/views/SettingsView.vue

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,11 @@
104104
<language-selector/>
105105
</div>
106106

107-
<!-- Repair window -->
107+
<!-- Repair view -->
108108
<div class="fc_parameter__panel">
109109
<h3>{{ $t('settings.repair.title') }}</h3>
110-
<el-button type="primary" @click="openRepairWindow">
111-
{{ $t('settings.repair.open_window') }}
110+
<el-button type="primary" @click="openRepairView">
111+
{{ $t('settings.repair.open_view') }}
112112
</el-button>
113113
</div>
114114

@@ -152,6 +152,7 @@ const persistentStore = new Store('flight-core-settings.json');
152152
import { open } from '@tauri-apps/api/shell';
153153
import { i18n } from '../main';
154154
import { ElMessageBox } from 'element-plus'
155+
import { Tabs } from "../utils/Tabs";
155156
156157
export default defineComponent({
157158
name: "SettingsView",
@@ -241,12 +242,9 @@ export default defineComponent({
241242
async updateGamePath() {
242243
this.$store.commit('updateGamePath');
243244
},
244-
async openRepairWindow() {
245-
await invoke("open_repair_window")
246-
.then((message) => { })
247-
.catch((error) => {
248-
showErrorNotification(error);
249-
});
245+
async openRepairView() {
246+
this.$store.state.repair_view_visible = true;
247+
this.$store.commit('updateCurrentTab', Tabs.REPAIR);
250248
},
251249
async openGameInstallFolder() {
252250
// Verify the game path is actually set

0 commit comments

Comments
 (0)