From 987ae17bcd46b7a7248453e968aee03202555f3e Mon Sep 17 00:00:00 2001 From: cooolbros Date: Wed, 20 Dec 2023 14:24:04 +1100 Subject: [PATCH] Fix Dependencies JSON parse --- src/HUDMerger/Models/Dependencies.cs | 18 +++++++++--------- src/HUDMerger/Models/SchemeDependencies.cs | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/HUDMerger/Models/Dependencies.cs b/src/HUDMerger/Models/Dependencies.cs index a04ba66..9bdf35b 100644 --- a/src/HUDMerger/Models/Dependencies.cs +++ b/src/HUDMerger/Models/Dependencies.cs @@ -14,14 +14,14 @@ public class Dependencies { private static readonly Dependencies PropertyNames = JsonSerializer.Deserialize(File.ReadAllText("Resources\\Dependencies.json"))!; - public SchemeDependencies ClientScheme { get; } = new(); - public SchemeDependencies SourceScheme { get; } = new(); - public HashSet HUDLayout { get; } = new(StringComparer.OrdinalIgnoreCase); - public HashSet Events { get; } = new(StringComparer.OrdinalIgnoreCase); - public HashSet LanguageTokens { get; } = new(StringComparer.OrdinalIgnoreCase); - public FilesHashSet Images { get; } = []; - public FilesHashSet Audio { get; } = []; - public FilesHashSet Files { get; } = []; + public SchemeDependencies ClientScheme { get; init; } = new(); + public SchemeDependencies SourceScheme { get; init; } = new(); + public HashSet HUDLayout { get; init; } = new(StringComparer.OrdinalIgnoreCase); + public HashSet Events { get; init; } = new(StringComparer.OrdinalIgnoreCase); + public HashSet LanguageTokens { get; init; } = new(StringComparer.OrdinalIgnoreCase); + public FilesHashSet Images { get; init; } = []; + public FilesHashSet Audio { get; init; } = []; + public FilesHashSet Files { get; init; } = []; public Dependencies() { @@ -131,7 +131,7 @@ public void Add(KeyValues keyValues) { if (keyValue.Key.Contains(audioProperty, StringComparison.OrdinalIgnoreCase)) { - Images.Add($"sound\\{keyValue.Value}"); + Audio.Add($"sound\\{keyValue.Value}"); } } }); diff --git a/src/HUDMerger/Models/SchemeDependencies.cs b/src/HUDMerger/Models/SchemeDependencies.cs index 39978dc..ab9a10a 100644 --- a/src/HUDMerger/Models/SchemeDependencies.cs +++ b/src/HUDMerger/Models/SchemeDependencies.cs @@ -5,9 +5,9 @@ namespace HUDMerger.Models; public class SchemeDependencies { - public HashSet Colours { get; } = new(StringComparer.OrdinalIgnoreCase); - public HashSet Borders { get; } = new(StringComparer.OrdinalIgnoreCase); - public HashSet Fonts { get; } = new(StringComparer.OrdinalIgnoreCase); + public HashSet Colours { get; init; } = new(StringComparer.OrdinalIgnoreCase); + public HashSet Borders { get; init; } = new(StringComparer.OrdinalIgnoreCase); + public HashSet Fonts { get; init; } = new(StringComparer.OrdinalIgnoreCase); public void UnionWith(SchemeDependencies other) {