diff --git a/TODO.md b/TODO.md index 71b9669..b24597d 100644 --- a/TODO.md +++ b/TODO.md @@ -2,6 +2,7 @@ - Clean up the code ofc. - som error handling for invalid mod folders +- check download hash ## New features diff --git a/bun.lockb b/bun.lockb index 879e331..6c60d78 100644 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 59c739d..b8a6d44 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "dependencies": { "@sveltejs/kit": "^2.5.4", "@tauri-apps/api": "^1", - "bits-ui": "^0.20.0", + "bits-ui": "^0.21.8", "bottleneck": "^2.19.5", "clsx": "^2.1.0", "lucide-svelte": "^0.359.0", diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index d8f512b..3cec6d3 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -7,7 +7,7 @@ }, "package": { "productName": "Pavlov Map Manager", - "version": "1.1.0" + "version": "1.2.0" }, "tauri": { "allowlist": { diff --git a/src/lib/components/modcard.svelte b/src/lib/components/modcard.svelte index e6e44cc..81fd691 100644 --- a/src/lib/components/modcard.svelte +++ b/src/lib/components/modcard.svelte @@ -32,10 +32,12 @@ let theme: string; let deletePopup: boolean; + let showType: boolean; onMount(async () => { theme = await config.get("theme"); - deletePopup = await config.get("deletePopup"); + deletePopup = await config.get("delete_popup"); + showType = await config.get("show_type"); }); export let mod: string; @@ -48,10 +50,14 @@ > + {#if showType} +

{$modsStore[mod].type}

+ {/if}
- {#if $modsStore[mod].currentVersion != $modsStore[mod].latestVersion } + {#if $modsStore[mod].currentVersion != $modsStore[mod].latestVersion}
-
-

New update available

-
+ - {#each Object.keys($modsStore) as mod} - {#if $modsStore[mod].currentVersion != $modsStore[mod].latestVersion} - - {/if} - {/each} -
-
-
-

Up to date

-
New update available + + {#each Object.keys($modsStore) as mod} + {#if $modsStore[mod].currentVersion != $modsStore[mod].latestVersion} + + {/if} + {/each} + + + - {#each Object.keys($modsStore) as mod} - {#if $modsStore[mod].currentVersion == $modsStore[mod].latestVersion} - - {/if} - {/each} -
-
+ Up to date + + {#each Object.keys($modsStore) as mod} + {#if $modsStore[mod].currentVersion == $modsStore[mod].latestVersion} + + {/if} + {/each} + + + {:else}
@@ -291,9 +305,7 @@
diff --git a/src/routes/settings/+page.svelte b/src/routes/settings/+page.svelte index 17869e7..ffeb20b 100644 --- a/src/routes/settings/+page.svelte +++ b/src/routes/settings/+page.svelte @@ -34,13 +34,15 @@ let auto_path: boolean; let theme: string; let delete_popup: boolean; + let show_type: boolean; onMount(async () => { theme = (await config.get("theme")) as string; - oauth_token = await config.get("oauth_token"); - mods_path = await config.get("mods_path"); - auto_path = await config.get("auto_path"); - delete_popup = await config.get("delete_popup"); + oauth_token = await config.get("oauthToken"); + mods_path = await config.get("modsPath"); + auto_path = await config.get("autoPath"); + delete_popup = await config.get("deletePopup"); + show_type = await config.get("show_type"); }); async function setTheme(new_theme: string) { @@ -52,30 +54,40 @@ } async function change_mods_path(input: string) { - await config.set("mods_path", input); + await config.set("modsPath", input); mods_path = input; await config.save(); toast.success("Mods path changed successfully"); } - async function toggle_auto_path() { + async function autoPathSwitch() { if (!auto_path) { await change_mods_path(await getModsPath()); } - await config.get("auto_path"); - await config.set("auto_path", auto_path); + await config.get("autoPath"); + await config.set("autoPath", auto_path); await config.save(); } const delete_popup_switch = async () => { - await config.get("delete_popup"); - await config.set("delete_popup", delete_popup); + await config.get("deletePopup"); + await config.set("deletePopup", delete_popup); + await config.save(); + }; + + const show_type_switch = async () => { + await config.get("show_type"); + await config.set("show_type", show_type); await config.save(); };
+
+ + +
@@ -125,13 +137,8 @@
- - + +