mirror of
https://github.com/xivdev/Penumbra.git
synced 2026-02-22 15:57:46 +01:00
Add some logging, fix som bugs
This commit is contained in:
parent
85fb98b557
commit
9037166d92
12 changed files with 58 additions and 41 deletions
|
|
@ -15,16 +15,16 @@ namespace Penumbra.Mods.Manager;
|
|||
public class ModCacheManager : IDisposable, IReadOnlyList<ModCache>
|
||||
{
|
||||
private readonly CommunicatorService _communicator;
|
||||
private readonly IdentifierService _identifier;
|
||||
private readonly IReadOnlyList<Mod> _modManager;
|
||||
private readonly IdentifierService _identifier;
|
||||
private readonly ModStorage _modManager;
|
||||
|
||||
private readonly List<ModCache> _cache = new();
|
||||
|
||||
public ModCacheManager(CommunicatorService communicator, IdentifierService identifier, ModManager modManager)
|
||||
public ModCacheManager(CommunicatorService communicator, IdentifierService identifier, ModStorage modStorage)
|
||||
{
|
||||
_communicator = communicator;
|
||||
_identifier = identifier;
|
||||
_modManager = modManager;
|
||||
_identifier = identifier;
|
||||
_modManager = modStorage;
|
||||
|
||||
_communicator.ModOptionChanged.Subscribe(OnModOptionChange);
|
||||
_communicator.ModPathChanged.Subscribe(OnModPathChange);
|
||||
|
|
@ -232,17 +232,17 @@ public class ModCacheManager : IDisposable, IReadOnlyList<ModCache>
|
|||
|
||||
private static void UpdateCounts(ModCache cache, Mod mod)
|
||||
{
|
||||
cache.TotalFileCount = mod.Default.Files.Count;
|
||||
cache.TotalSwapCount = mod.Default.FileSwaps.Count;
|
||||
cache.TotalFileCount = mod.Default.Files.Count;
|
||||
cache.TotalSwapCount = mod.Default.FileSwaps.Count;
|
||||
cache.TotalManipulations = mod.Default.Manipulations.Count;
|
||||
cache.HasOptions = false;
|
||||
cache.HasOptions = false;
|
||||
foreach (var group in mod.Groups)
|
||||
{
|
||||
cache.HasOptions |= group.IsOption;
|
||||
foreach (var s in group)
|
||||
{
|
||||
cache.TotalFileCount += s.Files.Count;
|
||||
cache.TotalSwapCount += s.FileSwaps.Count;
|
||||
cache.TotalFileCount += s.Files.Count;
|
||||
cache.TotalSwapCount += s.FileSwaps.Count;
|
||||
cache.TotalManipulations += s.Manipulations.Count;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,23 +4,23 @@ namespace Penumbra.Mods;
|
|||
|
||||
public class ModCache
|
||||
{
|
||||
public int TotalFileCount;
|
||||
public int TotalSwapCount;
|
||||
public int TotalManipulations;
|
||||
public int TotalFileCount;
|
||||
public int TotalSwapCount;
|
||||
public int TotalManipulations;
|
||||
public bool HasOptions;
|
||||
|
||||
public SortedList<string, object?> ChangedItems = new();
|
||||
public string LowerChangedItemsString = string.Empty;
|
||||
public string AllTagsLower = string.Empty;
|
||||
public readonly SortedList<string, object?> ChangedItems = new();
|
||||
public string LowerChangedItemsString = string.Empty;
|
||||
public string AllTagsLower = string.Empty;
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
TotalFileCount = 0;
|
||||
TotalSwapCount = 0;
|
||||
TotalFileCount = 0;
|
||||
TotalSwapCount = 0;
|
||||
TotalManipulations = 0;
|
||||
HasOptions = false;
|
||||
HasOptions = false;
|
||||
ChangedItems.Clear();
|
||||
LowerChangedItemsString = string.Empty;
|
||||
AllTagsLower = string.Empty;
|
||||
AllTagsLower = string.Empty;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue