diff --git a/PCK-Studio/Forms/Editor/AnimationEditor.cs b/PCK-Studio/Forms/Editor/AnimationEditor.cs index 02b39507..3947ceb9 100644 --- a/PCK-Studio/Forms/Editor/AnimationEditor.cs +++ b/PCK-Studio/Forms/Editor/AnimationEditor.cs @@ -251,14 +251,15 @@ namespace PckStudio.Forms.Editor public AnimationEditor(PCKFile.FileData file) { InitializeComponent(); - isItem = file.filepath.Split('/').Contains("items"); + + isItem = file.filepath.Split('/').Contains("items"); TileName = Path.GetFileNameWithoutExtension(file.filepath); animationFile = file; using MemoryStream textureMem = new MemoryStream(animationFile.data); var texture = new Bitmap(textureMem); currentAnimation = animationFile.properties.HasProperty("ANIM") - ? new Animation(texture, animationFile.properties.GetProperty("ANIM").Item2) + ? new Animation(texture, animationFile.properties.GetPropertyValue("ANIM")) : new Animation(texture); player = new AnimationPlayer(pictureBoxWithInterpolationMode1); @@ -281,7 +282,7 @@ namespace PckStudio.Forms.Editor // $"Frame: {i}, Frame Time: {Animation.MinimumFrameTime}" TextureIcons.Images.Clear(); TextureIcons.Images.AddRange(currentAnimation.GetFrameTextures().ToArray()); - currentAnimation.GetFrames().ForEach(f => frameTreeView.Nodes.Add("", $"for {f.Ticks} frame" + (f.Ticks > 1 ? "s" : "" ), currentAnimation.GetFrameIndex(f.Texture), currentAnimation.GetFrameIndex(f.Texture))); + currentAnimation.GetFrames().ForEach(f => frameTreeView.Nodes.Add("", $"for {f.Ticks} frames", currentAnimation.GetFrameIndex(f.Texture), currentAnimation.GetFrameIndex(f.Texture))); player.SelectFrame(currentAnimation, 0); } diff --git a/PCK-Studio/MainForm.cs b/PCK-Studio/MainForm.cs index 4b2a3b28..1deac7af 100644 --- a/PCK-Studio/MainForm.cs +++ b/PCK-Studio/MainForm.cs @@ -340,9 +340,7 @@ namespace PckStudio private void HandleTextureFile(PCKFile.FileData file) { - if (file.filepath.StartsWith("res/textures/blocks/") || file.filepath.StartsWith("res/textures/items/") && - !file.filepath.EndsWith("clock.png") && !file.filepath.EndsWith("compass.png")) - { + if (IsFilePathMipMapped(file.filepath) && currentPCK.Files.Find(pckfile => // todo write cleaner ? @@ -353,6 +351,7 @@ namespace PckStudio { file = originalAnimationFile; } + using (AnimationEditor animationEditor = new AnimationEditor(file)) { if (animationEditor.ShowDialog(this) == DialogResult.OK) @@ -362,7 +361,6 @@ namespace PckStudio } } } - } private void HandleGameRuleFile(PCKFile.FileData file) {