diff --git a/src/Bannerlord.LauncherManager.Models/ModuleInfoExtendedWithMetadata.cs b/src/Bannerlord.LauncherManager.Models/ModuleInfoExtendedWithMetadata.cs index 504097a..652b86f 100644 --- a/src/Bannerlord.LauncherManager.Models/ModuleInfoExtendedWithMetadata.cs +++ b/src/Bannerlord.LauncherManager.Models/ModuleInfoExtendedWithMetadata.cs @@ -4,10 +4,9 @@ namespace Bannerlord.LauncherManager.Models; -public record ModuleInfoExtendedWithMetadata : ModuleInfoExtended +public record ModuleInfoExtendedWithMetadata : ModuleInfoExtendedWithPath { public ModuleProviderType ModuleProviderType { get; set; } - public string Path { get; set; } = string.Empty; public ModuleInfoExtendedWithMetadata() { } public ModuleInfoExtendedWithMetadata(ModuleProviderType moduleProviderType, string path, string id, string name, bool isOfficial, ApplicationVersion version, bool isSingleplayerModule, bool isMultiplayerModule, @@ -29,9 +28,8 @@ public ModuleInfoExtendedWithMetadata(ModuleProviderType moduleProviderType, str DependentModuleMetadatas = dependentModuleMetadatas; Url = url; } - public ModuleInfoExtendedWithMetadata(ModuleInfoExtended module, ModuleProviderType moduleProviderType, string path) : base(module) + public ModuleInfoExtendedWithMetadata(ModuleInfoExtended module, ModuleProviderType moduleProviderType, string path) : base(module, path) { ModuleProviderType = moduleProviderType; - Path = path; } } \ No newline at end of file diff --git a/src/Bannerlord.LauncherManager.Models/ModuleInfoExtendedWithPath.cs b/src/Bannerlord.LauncherManager.Models/ModuleInfoExtendedWithPath.cs new file mode 100644 index 0000000..d7adae8 --- /dev/null +++ b/src/Bannerlord.LauncherManager.Models/ModuleInfoExtendedWithPath.cs @@ -0,0 +1,33 @@ +using System.Collections.Generic; +using Bannerlord.ModuleManager; + +namespace Bannerlord.LauncherManager.Models; + +public record ModuleInfoExtendedWithPath : ModuleInfoExtended +{ + public string Path { get; set; } = string.Empty; + + public ModuleInfoExtendedWithPath() { } + public ModuleInfoExtendedWithPath(string path, string id, string name, bool isOfficial, ApplicationVersion version, bool isSingleplayerModule, bool isMultiplayerModule, + IReadOnlyList subModules, IReadOnlyList dependentModules, IReadOnlyList modulesToLoadAfterThis, + IReadOnlyList incompatibleModules, IReadOnlyList dependentModuleMetadatas, string url) + { + Path = path; + Id = id; + Name = name; + IsOfficial = isOfficial; + Version = version; + IsSingleplayerModule = isSingleplayerModule; + IsMultiplayerModule = isMultiplayerModule; + SubModules = subModules; + DependentModules = dependentModules; + ModulesToLoadAfterThis = modulesToLoadAfterThis; + IncompatibleModules = incompatibleModules; + DependentModuleMetadatas = dependentModuleMetadatas; + Url = url; + } + public ModuleInfoExtendedWithPath(ModuleInfoExtended module, string path) : base(module) + { + Path = path; + } +} \ No newline at end of file diff --git a/src/Bannerlord.LauncherManager.Native/Bindings.ModuleManager.cs b/src/Bannerlord.LauncherManager.Native/Bindings.ModuleManager.cs index 95986a9..2ca37fa 100644 --- a/src/Bannerlord.LauncherManager.Native/Bindings.ModuleManager.cs +++ b/src/Bannerlord.LauncherManager.Native/Bindings.ModuleManager.cs @@ -385,7 +385,7 @@ public static unsafe partial class Bindings doc.LoadXml(new string(param_string.ToSpan(p_xml_content))); var module = ModuleInfoExtended.FromXml(doc); - var result = new ModuleInfoExtendedWithMetadata(module, ModuleProviderType.Default, new string(param_string.ToSpan(p_path))); + var result = new ModuleInfoExtendedWithPath(module, new string(param_string.ToSpan(p_path))); Logger.LogOutput(result); return return_value_json.AsValue(result, CustomSourceGenerationContext.ModuleInfoExtended, false);