From b37eb4dc9beb886d3355087102635847222027e8 Mon Sep 17 00:00:00 2001 From: neomoth <69372252+neomoth@users.noreply.github.com> Date: Thu, 31 Oct 2024 00:21:19 -0400 Subject: [PATCH] update to use manifest.json metadata tag --- NeoQOLPack/Mod.cs | 8 ++++---- NeoQOLPack/NeoQOLPack.csproj | 1 - NeoQOLPack/manifest.json | 9 ++++++++- NeoQOLPack/mod.json | 6 ------ 4 files changed, 12 insertions(+), 12 deletions(-) delete mode 100644 NeoQOLPack/mod.json diff --git a/NeoQOLPack/Mod.cs b/NeoQOLPack/Mod.cs index f88d4ac..5705eaf 100644 --- a/NeoQOLPack/Mod.cs +++ b/NeoQOLPack/Mod.cs @@ -52,17 +52,17 @@ private async Task GetVersion() if (currentDir is null) throw new NullReferenceException( "if this gets thrown i have no fucking idea how you managed to do that."); - string jsonPath = Path.Combine(currentDir, "mod.json"); + string jsonPath = Path.Combine(currentDir, "manifest.json"); if (!File.Exists(jsonPath)) - throw new FileNotFoundException("mod.json was not found in the mod's directory."); + throw new FileNotFoundException("manifest.json was not found in the mod's directory."); string jsonContent = File.ReadAllText(jsonPath); JsonDocument document = JsonDocument.Parse(jsonContent); - if (document.RootElement.TryGetProperty("version", out JsonElement version)) + if (document.RootElement.GetProperty("Metadata").TryGetProperty("Version", out JsonElement version)) { string? versionAsString = version.GetString(); if (versionAsString is not null) versionTag = $"v{versionAsString}"; } - else throw new Exception("'version' property not found in mod.json."); + else throw new Exception("'version' property not found in manifest.json."); } catch (Exception e) { diff --git a/NeoQOLPack/NeoQOLPack.csproj b/NeoQOLPack/NeoQOLPack.csproj index 0a7be03..048bd3f 100644 --- a/NeoQOLPack/NeoQOLPack.csproj +++ b/NeoQOLPack/NeoQOLPack.csproj @@ -13,7 +13,6 @@ - diff --git a/NeoQOLPack/manifest.json b/NeoQOLPack/manifest.json index 0ff873a..7618f52 100644 --- a/NeoQOLPack/manifest.json +++ b/NeoQOLPack/manifest.json @@ -5,5 +5,12 @@ "Dependencies": [ "Sulayre.Lure" - ] + ], + "Metadata": + { + "Name": "NeoOQLPack", + "Description": "Collection of Quality of Life patches such as inventory stacking, a sell all button, etcetera.", + "Version": "1.0.6", + "Author": "neomoth" + } } \ No newline at end of file diff --git a/NeoQOLPack/mod.json b/NeoQOLPack/mod.json deleted file mode 100644 index 828f854..0000000 --- a/NeoQOLPack/mod.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "NeoQOLPack", - "version": "1.0.5", - "description": "A collection of Quality of Life patches", - "author": "neomoth" -} \ No newline at end of file