mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 18:27:24 +01:00
Improve delayed individual collection loading.
This commit is contained in:
parent
23e553c88e
commit
1ccf3a4256
3 changed files with 10 additions and 7 deletions
2
OtterGui
2
OtterGui
|
|
@ -1 +1 @@
|
||||||
Subproject commit 99bd0a889806f0560109686ca3b29a4edfa48f76
|
Subproject commit 4ef03980803cdf5a253c041d6ed1ef26d9a9b938
|
||||||
|
|
@ -296,8 +296,8 @@ public class CollectionCacheManager : IDisposable
|
||||||
.Prepend(_active.Current)
|
.Prepend(_active.Current)
|
||||||
.Prepend(_active.Default)
|
.Prepend(_active.Default)
|
||||||
.Prepend(_active.Interface)
|
.Prepend(_active.Interface)
|
||||||
.Distinct()
|
.Where(CreateCache)
|
||||||
.Select(c => CreateCache(c) ? Task.Run(() => CalculateEffectiveFileListInternal(c)) : Task.CompletedTask)
|
.Select(c => Task.Run(() => CalculateEffectiveFileListInternal(c)))
|
||||||
.ToArray();
|
.ToArray();
|
||||||
|
|
||||||
Task.WaitAll(tasks);
|
Task.WaitAll(tasks);
|
||||||
|
|
|
||||||
|
|
@ -33,10 +33,13 @@ public partial class IndividualCollections
|
||||||
return ReadJObjectInternal(obj, storage);
|
return ReadJObjectInternal(obj, storage);
|
||||||
void Func()
|
void Func()
|
||||||
{
|
{
|
||||||
if (ReadJObjectInternal(obj, storage))
|
saver.DalamudFramework.RunOnFrameworkThread(() =>
|
||||||
saver.ImmediateSave(parent);
|
{
|
||||||
saver.DalamudFramework.RunOnFrameworkThread(() => Loaded.Invoke());
|
if (ReadJObjectInternal(obj, storage))
|
||||||
_actorService.FinishedCreation -= Func;
|
saver.ImmediateSave(parent);
|
||||||
|
Loaded.Invoke();
|
||||||
|
_actorService.FinishedCreation -= Func;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
_actorService.FinishedCreation += Func;
|
_actorService.FinishedCreation += Func;
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue