diff --git a/OtterGui b/OtterGui index c466bd33..934e991f 160000 --- a/OtterGui +++ b/OtterGui @@ -1 +1 @@ -Subproject commit c466bd33442dda3ade26f05c9e8d694443564118 +Subproject commit 934e991f9a39c7d864501532003b9548ef73f896 diff --git a/Penumbra.GameData b/Penumbra.GameData index ac0710e9..54b56ada 160000 --- a/Penumbra.GameData +++ b/Penumbra.GameData @@ -1 +1 @@ -Subproject commit ac0710e9a116bec8633f3dcde2c9b6e38dffaaa9 +Subproject commit 54b56ada57529221d3fc812193ffe65c424c1521 diff --git a/Penumbra/Collections/Manager/ActiveCollections.cs b/Penumbra/Collections/Manager/ActiveCollections.cs index 3da009a3..0814da90 100644 --- a/Penumbra/Collections/Manager/ActiveCollections.cs +++ b/Penumbra/Collections/Manager/ActiveCollections.cs @@ -325,6 +325,7 @@ public class ActiveCollections : ISavable, IDisposable /// private void LoadCollections() { + Penumbra.Log.Debug("[Collections] Reading collection assignments..."); var configChanged = !Load(_saveService.FileNames, out var jObject); // Load the default collection. If the string does not exist take the Default name if no file existed or the Empty name if one existed. @@ -389,6 +390,8 @@ public class ActiveCollections : ISavable, IDisposable } } + Penumbra.Log.Debug("[Collections] Loaded non-individual collection assignments."); + configChanged |= ActiveCollectionMigration.MigrateIndividualCollections(_storage, Individuals, jObject); configChanged |= Individuals.ReadJObject(_saveService, this, jObject[nameof(Individuals)] as JArray, _storage); diff --git a/Penumbra/Collections/Manager/CollectionStorage.cs b/Penumbra/Collections/Manager/CollectionStorage.cs index 70b2cd13..7c94d705 100644 --- a/Penumbra/Collections/Manager/CollectionStorage.cs +++ b/Penumbra/Collections/Manager/CollectionStorage.cs @@ -176,6 +176,7 @@ public class CollectionStorage : IReadOnlyList, IDisposable /// private void ReadCollections(out ModCollection defaultNamedCollection) { + Penumbra.Log.Debug("[Collections] Reading saved collections..."); foreach (var file in _saveService.FileNames.CollectionFiles) { if (!ModCollectionSave.LoadFromFile(file, out var name, out var version, out var settings, out var inheritance)) @@ -202,6 +203,7 @@ public class CollectionStorage : IReadOnlyList, IDisposable } defaultNamedCollection = SetDefaultNamedCollection(); + Penumbra.Log.Debug($"[Collections] Found {Count} saved collections."); } /// diff --git a/Penumbra/Collections/Manager/IndividualCollections.Files.cs b/Penumbra/Collections/Manager/IndividualCollections.Files.cs index fa6019c6..45a1d98c 100644 --- a/Penumbra/Collections/Manager/IndividualCollections.Files.cs +++ b/Penumbra/Collections/Manager/IndividualCollections.Files.cs @@ -27,7 +27,10 @@ public partial class IndividualCollections public bool ReadJObject(SaveService saver, ActiveCollections parent, JArray? obj, CollectionStorage storage) { if (_actorService.Valid) - return ReadJObjectInternal(obj, storage); + { + var ret = ReadJObjectInternal(obj, storage); + return ret; + } void Func() { @@ -38,14 +41,19 @@ public partial class IndividualCollections _actorService.FinishedCreation -= Func; } + Penumbra.Log.Debug("[Collections] Delayed reading individual assignments until actor service is ready..."); _actorService.FinishedCreation += Func; return false; } private bool ReadJObjectInternal(JArray? obj, CollectionStorage storage) { + Penumbra.Log.Debug("[Collections] Reading individual assignments..."); if (obj == null) + { + Penumbra.Log.Debug($"[Collections] Finished reading {Count} individual assignments..."); return true; + } var changes = false; foreach (var data in obj) @@ -58,7 +66,7 @@ public partial class IndividualCollections { changes = true; Penumbra.Messager.NotificationMessage("Could not load an unknown individual collection, removed.", - NotificationType.Warning); + NotificationType.Error); continue; } @@ -86,6 +94,8 @@ public partial class IndividualCollections } } + Penumbra.Log.Debug($"Finished reading {Count} individual assignments..."); + return changes; } diff --git a/Penumbra/Import/Structs/StreamDisposer.cs b/Penumbra/Import/Structs/StreamDisposer.cs index 84719331..c38362ce 100644 --- a/Penumbra/Import/Structs/StreamDisposer.cs +++ b/Penumbra/Import/Structs/StreamDisposer.cs @@ -3,7 +3,7 @@ using Penumbra.Util; namespace Penumbra.Import.Structs; // Create an automatically disposing SqPack stream. -public class StreamDisposer : PenumbraSqPackStream, IDisposable +public class StreamDisposer : PenumbraSqPackStream { private readonly FileStream _fileStream; @@ -11,13 +11,10 @@ public class StreamDisposer : PenumbraSqPackStream, IDisposable : base(stream) => _fileStream = stream; - public new void Dispose() + protected override void Dispose(bool _) { var filePath = _fileStream.Name; - - base.Dispose(); _fileStream.Dispose(); - File.Delete(filePath); } } diff --git a/Penumbra/Util/PenumbraSqPackStream.cs b/Penumbra/Util/PenumbraSqPackStream.cs index 562eca91..392730e2 100644 --- a/Penumbra/Util/PenumbraSqPackStream.cs +++ b/Penumbra/Util/PenumbraSqPackStream.cs @@ -327,8 +327,12 @@ public class PenumbraSqPackStream : IDisposable public void Dispose() { Reader.Dispose(); + Dispose(true); } + protected virtual void Dispose(bool _) + { } + public class PenumbraFileInfo { public uint HeaderSize;