From 83b6b454bf88cb80aea478f8b46f95bec4d9ea00 Mon Sep 17 00:00:00 2001 From: GeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com> Date: Tue, 7 Feb 2023 23:39:59 +0100 Subject: feat: Show mod version in LocalMods View (#159) * refactor: Parse using serde deserialisation * refactor: Parse using serde deserial. (TS mod str) Reduce code by making use of serde deserialisation. Still supports legacy method * chore: Remove commented out fields While useful, it just made the code messy... * feat: Show mod version in LocalMods view * refactor: Move mod version to new line in source code Makes diffing in git easier * fix: Hide version number if not available --- src-tauri/src/mod_management/mod.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src-tauri/src/mod_management/mod.rs') diff --git a/src-tauri/src/mod_management/mod.rs b/src-tauri/src/mod_management/mod.rs index 90dc85da..75d63972 100644 --- a/src-tauri/src/mod_management/mod.rs +++ b/src-tauri/src/mod_management/mod.rs @@ -57,6 +57,8 @@ pub struct ModJson { name: String, #[serde(rename = "ThunderstoreModString")] thunderstore_mod_string: Option, + #[serde(rename = "Version")] + version: Option, } /// Gets all currently installed and enabled/disabled mods to rebuild `enabledmods.json` @@ -212,6 +214,7 @@ fn parse_installed_mods(game_install: GameInstall) -> Result, let ns_mod = NorthstarMod { name: parsed_mod_json.name, + version: parsed_mod_json.version, thunderstore_mod_string: thunderstore_mod_string, enabled: false, // Placeholder directory: mod_directory, -- cgit v1.2.3