Add some tracking of cached collections.

This commit is contained in:
Ottermandias 2023-04-29 16:08:16 +02:00
parent a9ff6135b3
commit ef5cf14b2b
4 changed files with 45 additions and 32 deletions

View file

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Dalamud.Game;
using Dalamud.Game.ClientState.Objects.Enums;
using Dalamud.Interface.Internal.Notifications;
using Newtonsoft.Json.Linq;
@ -34,7 +35,7 @@ public partial class IndividualCollections
{
if (ReadJObjectInternal(obj, storage))
saver.ImmediateSave(parent);
Loaded?.Invoke();
saver.DalamudFramework.RunOnFrameworkThread(() => Loaded.Invoke());
_actorService.FinishedCreation -= Func;
}
_actorService.FinishedCreation += Func;

View file

@ -17,15 +17,16 @@ public sealed partial class IndividualCollections
private readonly List<(string DisplayName, IReadOnlyList<ActorIdentifier> Identifiers, ModCollection Collection)> _assignments = new();
private readonly Dictionary<ActorIdentifier, ModCollection> _individuals = new();
public event Action? Loaded;
public event Action Loaded;
public IReadOnlyList<(string DisplayName, IReadOnlyList<ActorIdentifier> Identifiers, ModCollection Collection)> Assignments
=> _assignments;
public IndividualCollections(ActorService actorService, Configuration config)
{
_config = config;
_actorService = actorService;
_config = config;
_actorService = actorService;
Loaded += () => Penumbra.Log.Information($"{_assignments.Count} Individual Assignments loaded after delay.");
}
public enum AddResult