mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-05-28 15:04:59 +00:00
Animation - Removed implicit frame to image operator
This commit is contained in:
@@ -41,8 +41,6 @@ namespace PckStudio.Forms.Editor
|
||||
public readonly Image Texture;
|
||||
public int Ticks;
|
||||
|
||||
public static implicit operator Image(Frame f) => f.Texture;
|
||||
|
||||
public Frame(Image texture) : this(texture, MinimumFrameTime)
|
||||
{ }
|
||||
|
||||
@@ -131,7 +129,7 @@ namespace PckStudio.Forms.Editor
|
||||
{
|
||||
StringBuilder stringBuilder = new StringBuilder(Interpolate ? "#" : string.Empty);
|
||||
foreach (var frame in frames)
|
||||
stringBuilder.Append($"{GetTextureIndex(frame)}*{frame.Ticks},");
|
||||
stringBuilder.Append($"{GetTextureIndex(frame.Texture)}*{frame.Ticks},");
|
||||
return stringBuilder.ToString(0, stringBuilder.Length - 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -265,14 +265,9 @@ namespace PckStudio.Forms.Editor
|
||||
private void bulkAnimationSpeedToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
SetBulkSpeed diag = new SetBulkSpeed(frameTreeView);
|
||||
if(diag.ShowDialog(this) == DialogResult.OK)
|
||||
if (diag.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
var list = currentAnimation.GetFrames();
|
||||
for (int i = 0; i < list.Count; i++)
|
||||
{
|
||||
Animation.Frame f = list[i];
|
||||
currentAnimation.SetFrame(f, currentAnimation.GetTextureIndex(f), diag.time);
|
||||
}
|
||||
currentAnimation.GetFrames().ForEach(frame => frame.Ticks = diag.time);
|
||||
LoadAnimationTreeView();
|
||||
}
|
||||
diag.Dispose();
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace PckStudio.Forms.Editor
|
||||
{
|
||||
Monitor.Enter(_animation);
|
||||
Animation.Frame frame = _animation[frameIndex];
|
||||
display.Image = frame;
|
||||
display.Image = frame.Texture;
|
||||
Monitor.Exit(_animation);
|
||||
return frame;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user