aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com>2023-02-07 23:39:59 +0100
committerGitHub <noreply@github.com>2023-02-07 23:39:59 +0100
commit83b6b454bf88cb80aea478f8b46f95bec4d9ea00 (patch)
treeaec6bae7c7cbb7726499501cf6b89aae26bfe5b7
parent28b1b6b9fbf1f50ff1241643ed6da09e043eb3e5 (diff)
downloadFlightCore-83b6b454bf88cb80aea478f8b46f95bec4d9ea00.tar.gz
FlightCore-83b6b454bf88cb80aea478f8b46f95bec4d9ea00.zip
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
-rw-r--r--src-tauri/bindings/NorthstarMod.ts2
-rw-r--r--src-tauri/src/lib.rs1
-rw-r--r--src-tauri/src/mod_management/mod.rs3
-rw-r--r--src-vue/src/views/mods/LocalModsView.vue1
4 files changed, 6 insertions, 1 deletions
diff --git a/src-tauri/bindings/NorthstarMod.ts b/src-tauri/bindings/NorthstarMod.ts
index ed9d9297..3686485b 100644
--- a/src-tauri/bindings/NorthstarMod.ts
+++ b/src-tauri/bindings/NorthstarMod.ts
@@ -1,3 +1,3 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
-export interface NorthstarMod { name: string, thunderstore_mod_string: string | null, enabled: boolean, directory: string, } \ No newline at end of file
+export interface NorthstarMod { name: string, version: string | null, thunderstore_mod_string: string | null, enabled: boolean, directory: string, } \ No newline at end of file
diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs
index 1ae55a6f..5688512c 100644
--- a/src-tauri/src/lib.rs
+++ b/src-tauri/src/lib.rs
@@ -36,6 +36,7 @@ pub struct GameInstall {
#[ts(export)]
pub struct NorthstarMod {
pub name: String,
+ pub version: Option<String>,
pub thunderstore_mod_string: Option<String>,
pub enabled: bool,
pub directory: String,
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<String>,
+ #[serde(rename = "Version")]
+ version: Option<String>,
}
/// Gets all currently installed and enabled/disabled mods to rebuild `enabledmods.json`
@@ -212,6 +214,7 @@ fn parse_installed_mods(game_install: GameInstall) -> Result<Vec<NorthstarMod>,
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,
diff --git a/src-vue/src/views/mods/LocalModsView.vue b/src-vue/src/views/mods/LocalModsView.vue
index 59b51936..ed801b7a 100644
--- a/src-vue/src/views/mods/LocalModsView.vue
+++ b/src-vue/src/views/mods/LocalModsView.vue
@@ -14,6 +14,7 @@
</template>
</el-popconfirm>
{{ mod.name }}
+ <span v-if="mod.version != null">(v{{ mod.version }})</span>
<img
v-if="mod.thunderstore_mod_string != null"
title="This Northstar mod is part of a Thunderstore mod"