Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Change repair window to tab #982

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src-vue/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -70,6 +70,7 @@ export default {
<el-menu-item index="/mods">{{ $t('menu.mods') }}</el-menu-item>
<el-menu-item index="/changelog">{{ $t('menu.changelog') }}</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>

Expand Down
6 changes: 3 additions & 3 deletions src-vue/src/i18n/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"changelog": "Changelog",
"mods": "Mods",
"settings": "Settings",
"repair": "Repair",
"dev": "Dev"
},

Expand Down Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions src-vue/src/plugins/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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: [],
Expand Down
16 changes: 7 additions & 9 deletions src-vue/src/views/SettingsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand Down
Loading