From 3172d051a475956f9ef9eff40016596025741018 Mon Sep 17 00:00:00 2001 From: GeckoEidechse Date: Thu, 6 Oct 2022 01:26:33 +0200 Subject: feat: Initial logic to disable all but core mods In the future, this button should be moved to a "Repair" view. For now I'm putting it into Dev view for testing. --- src-vue/src/views/DeveloperView.vue | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'src-vue') diff --git a/src-vue/src/views/DeveloperView.vue b/src-vue/src/views/DeveloperView.vue index ccf0e732..72a3f4d1 100644 --- a/src-vue/src/views/DeveloperView.vue +++ b/src-vue/src/views/DeveloperView.vue @@ -11,6 +11,13 @@ Toggle Release Candidate + +

Repair:

+ + + Disable all but core mods + + @@ -19,6 +26,7 @@ import {defineComponent} from "vue"; import { invoke } from "@tauri-apps/api"; import { ElNotification } from "element-plus"; import { ReleaseCanal } from "../utils/ReleaseCanal"; +import { GameInstall } from "../utils/GameInstall"; export default defineComponent({ name: "DeveloperView", @@ -53,6 +61,30 @@ export default defineComponent({ type: 'success', position: 'bottom-right' }); + }, + async disableAllModsButCore() { + let game_install = { + game_path: this.$store.state.game_path, + install_type: this.$store.state.install_type + } as GameInstall; + await invoke("disable_all_but_core_caller", { gameInstall: game_install }).then((message) => { + console.log(message); + ElNotification({ + title: 'Success', + message: "Disabled all mods but core", + type: 'success', + position: 'bottom-right' + }); + }) + .catch((error) => { + console.error(error); + ElNotification({ + title: 'Error', + message: `${error}`, + type: 'error', + position: 'bottom-right' + }); + }); } } }); @@ -61,5 +93,6 @@ export default defineComponent({ -- cgit v1.2.3 From 3359b95eb3defa968ee391bc9ca7426754e5e78f Mon Sep 17 00:00:00 2001 From: GeckoEidechse Date: Thu, 6 Oct 2022 15:07:34 +0200 Subject: fix: Remove console logs As requested in review --- src-vue/src/views/DeveloperView.vue | 2 -- 1 file changed, 2 deletions(-) (limited to 'src-vue') diff --git a/src-vue/src/views/DeveloperView.vue b/src-vue/src/views/DeveloperView.vue index 72a3f4d1..7ffc7d40 100644 --- a/src-vue/src/views/DeveloperView.vue +++ b/src-vue/src/views/DeveloperView.vue @@ -68,7 +68,6 @@ export default defineComponent({ install_type: this.$store.state.install_type } as GameInstall; await invoke("disable_all_but_core_caller", { gameInstall: game_install }).then((message) => { - console.log(message); ElNotification({ title: 'Success', message: "Disabled all mods but core", @@ -77,7 +76,6 @@ export default defineComponent({ }); }) .catch((error) => { - console.error(error); ElNotification({ title: 'Error', message: `${error}`, -- cgit v1.2.3 From 0f1325f52a5eb254ec4af7d51802459f0605c972 Mon Sep 17 00:00:00 2001 From: GeckoEidechse Date: Thu, 6 Oct 2022 15:09:20 +0200 Subject: refactor: Use string variable value directly instead of encapsulating in template literal --- src-vue/src/views/DeveloperView.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src-vue') diff --git a/src-vue/src/views/DeveloperView.vue b/src-vue/src/views/DeveloperView.vue index 7ffc7d40..f08908a6 100644 --- a/src-vue/src/views/DeveloperView.vue +++ b/src-vue/src/views/DeveloperView.vue @@ -78,7 +78,7 @@ export default defineComponent({ .catch((error) => { ElNotification({ title: 'Error', - message: `${error}`, + message: error, type: 'error', position: 'bottom-right' }); -- cgit v1.2.3