diff options
Diffstat (limited to 'src-vue')
-rw-r--r-- | src-vue/src/views/mods/LocalModsView.vue | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src-vue/src/views/mods/LocalModsView.vue b/src-vue/src/views/mods/LocalModsView.vue index 38f7a914..3979ca14 100644 --- a/src-vue/src/views/mods/LocalModsView.vue +++ b/src-vue/src/views/mods/LocalModsView.vue @@ -5,14 +5,19 @@ </div> <el-scrollbar v-else> + <el-button class="disableModsBtn" type="primary" @click="disableAllModsButCore"> + {{ $t('settings.repair.window.disable_all_but_core') }} + </el-button> <local-mod-card v-for="mod of mods" v-bind:key="mod.name" :mod="mod" /> </el-scrollbar> </template> <script lang="ts"> import { defineComponent } from 'vue'; +import { invoke } from "@tauri-apps/api"; import { NorthstarMod } from "../../../../src-tauri/bindings/NorthstarMod"; import { fuzzy_filter } from "../../utils/filter"; +import { showErrorNotification, showNotification } from "../../utils/ui"; import LocalModCard from "../../components/LocalModCard.vue"; export default defineComponent({ @@ -41,6 +46,16 @@ export default defineComponent({ }; }, methods: { + async disableAllModsButCore() { + await invoke("disable_all_but_core", { gameInstall: this.$store.state.game_install }) + .then((message) => { + showNotification(this.$t('generic.success'), this.$t('settings.repair.window.disable_all_but_core_success')); + this.$store.commit('loadInstalledMods'); + }) + .catch((error) => { + showErrorNotification(error); + }); + }, }, mounted() { this.$store.commit('loadInstalledMods'); @@ -49,5 +64,9 @@ export default defineComponent({ </script> <style scoped> - +.disableModsBtn { + margin-bottom: 10px; + top: 10px; + position: sticky; +} </style> |