From 7dcaa68ed811c9db3193b1c57c55041f0aadf9f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antti=20M=C3=A4ki?= Date: Tue, 30 Jan 2024 16:07:23 +0200 Subject: [PATCH] Clean up code related to ordering local mod list As far as I can tell none of the code removed in this commit is actually needed, or even used. Both the UI and mods.yml file seem to update just fine without them. --- src/components/ExpandableCard.vue | 4 --- src/components/views/LocalModList.vue | 24 ++------------- src/r2mm/mods/ProfileModList.ts | 42 --------------------------- 3 files changed, 2 insertions(+), 68 deletions(-) diff --git a/src/components/ExpandableCard.vue b/src/components/ExpandableCard.vue index 354a67abc..4792af1f6 100644 --- a/src/components/ExpandableCard.vue +++ b/src/components/ExpandableCard.vue @@ -79,10 +79,6 @@ this.visible = !this.visible; } - emitMove(direction: string) { - this.$emit("move" + direction); - } - async created() { this.visible = this.expandedByDefault; } diff --git a/src/components/views/LocalModList.vue b/src/components/views/LocalModList.vue index 108ba89c0..88e68796b 100644 --- a/src/components/views/LocalModList.vue +++ b/src/components/views/LocalModList.vue @@ -68,8 +68,8 @@ { diff --git a/src/r2mm/mods/ProfileModList.ts b/src/r2mm/mods/ProfileModList.ts index d42e2ccff..fe8f20bf1 100644 --- a/src/r2mm/mods/ProfileModList.ts +++ b/src/r2mm/mods/ProfileModList.ts @@ -262,48 +262,6 @@ export default class ProfileModList { } } - public static async shiftModEntryUp(mod: ManifestV2, profile: Profile): Promise { - let list: ManifestV2[] | R2Error = await this.getModList(profile); - if (list instanceof R2Error) { - return list; - } - const index = list.findIndex((stored: ManifestV2) => stored.getName() === mod.getName()) - if (index === 0) { - return list; - } else { - list = list.filter((stored: ManifestV2) => stored.getName() !== mod.getName()); - const start = list.slice(0, index - 1); - const end = list.slice(index - 1); - list = [...start, mod, ...end]; - } - const saveErr = await this.saveModList(profile, list); - if (saveErr instanceof R2Error) { - return saveErr; - } - return this.getModList(profile); - } - - public static async shiftModEntryDown(mod: ManifestV2, profile: Profile): Promise { - let list: ManifestV2[] | R2Error = await this.getModList(profile); - if (list instanceof R2Error) { - return list; - } - const index = list.findIndex((stored: ManifestV2) => stored.getName() === mod.getName()) - if (index === list.length) { - return list; - } else { - list = list.filter((stored: ManifestV2) => stored.getName() !== mod.getName()); - const start = list.slice(0, index + 1); - const end = list.slice(index + 1); - list = [...start, mod, ...end]; - } - const saveErr = await this.saveModList(profile, list); - if (saveErr instanceof R2Error) { - return saveErr; - } - return this.getModList(profile); - } - public static getDisabledModCount(modList: ManifestV2[]): number { return modList.filter(value => !value.isEnabled()).length; }