Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Aragas committed Apr 19, 2024
1 parent 433ed7c commit d36f502
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;
}
}
Original file line number Diff line number Diff line change
@@ -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<SubModuleInfoExtended> subModules, IReadOnlyList<DependentModule> dependentModules, IReadOnlyList<DependentModule> modulesToLoadAfterThis,
IReadOnlyList<DependentModule> incompatibleModules, IReadOnlyList<DependentModuleMetadata> 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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d36f502

Please sign in to comment.