From 27fe79fd43e0b4892c49a3f7e6fa71215f9df936 Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Sat, 22 Feb 2025 11:32:21 +0100 Subject: [PATCH] MainForm - [HandleTextureFile] Add Debug message when animation has no frames to save --- PCK-Studio/MainForm.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/PCK-Studio/MainForm.cs b/PCK-Studio/MainForm.cs index b9023394..e416fe6c 100644 --- a/PCK-Studio/MainForm.cs +++ b/PCK-Studio/MainForm.cs @@ -659,7 +659,8 @@ namespace PckStudio return false; }); - ITryGet> tryGetAnimationSaveContext = TryGet>.FromDelegate((string key, out ISaveContext animationSaveContext) => + ITryGet> tryGetAnimationSaveContext = TryGet> + .FromDelegate((string key, out ISaveContext animationSaveContext) => { bool found = currentPCK.TryGetAsset(key + ".png", PckAssetType.TextureFile, out PckAsset foundAsset) || currentPCK.TryGetAsset(key + ".tga", PckAssetType.TextureFile, out foundAsset); @@ -675,7 +676,10 @@ namespace PckStudio animationSaveContext = new DelegatedSaveContext(Settings.Default.AutoSaveChanges, (animation) => { if (animation.FrameCount == 0) + { + Debug.WriteLine("New animation has 0 frames. Aborting saving."); return; + } PckAsset newAnimationAsset = currentPCK.CreateNewAsset(key + ".png", PckAssetType.TextureFile); newAnimationAsset.SetSerializedData(animation, AnimationSerializer.DefaultSerializer); BuildMainTreeView();