|
|
@ -650,22 +650,35 @@ namespace DotNetCTFDumper.GUI
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private bool breakAnim;
|
|
|
|
|
|
|
|
private bool isAnimRunning;
|
|
|
|
private void advancedPlayAnimation_Click(object sender, EventArgs e)
|
|
|
|
private void advancedPlayAnimation_Click(object sender, EventArgs e)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (((ChunkNode) advancedTreeView.SelectedNode).loader is Animation anim)
|
|
|
|
if (((ChunkNode) advancedTreeView.SelectedNode).loader is Animation anim)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var animThread = new Thread(PlayAnimation);
|
|
|
|
if (isAnimRunning)
|
|
|
|
List<Bitmap> frames = new List<Bitmap>();
|
|
|
|
{
|
|
|
|
foreach (var dir in anim.DirectionDict)
|
|
|
|
breakAnim = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
foreach (var frame in dir.Value.Frames)
|
|
|
|
isAnimRunning = true;
|
|
|
|
|
|
|
|
var animThread = new Thread(PlayAnimation);
|
|
|
|
|
|
|
|
List<Bitmap> frames = new List<Bitmap>();
|
|
|
|
|
|
|
|
foreach (var dir in anim.DirectionDict)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
frames.Add(Exe.Instance.GameData.GameChunks.GetChunk<ImageBank>().Images[frame].Bitmap);
|
|
|
|
foreach (var frame in dir.Value.Frames)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
frames.Add(Exe.Instance.GameData.GameChunks.GetChunk<ImageBank>().Images[frame].Bitmap);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
animThread.Start(new Tuple<List<Bitmap>,AnimationDirection>(frames,dir.Value));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
animThread.Start(new Tuple<List<Bitmap>,AnimationDirection>(frames,dir.Value));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -674,13 +687,43 @@ namespace DotNetCTFDumper.GUI
|
|
|
|
var (frames,anim) = (Tuple<List<Bitmap>,AnimationDirection>) o;
|
|
|
|
var (frames,anim) = (Tuple<List<Bitmap>,AnimationDirection>) o;
|
|
|
|
var fps = (float)anim.MaxSpeed;
|
|
|
|
var fps = (float)anim.MaxSpeed;
|
|
|
|
float delay = 1f/fps;
|
|
|
|
float delay = 1f/fps;
|
|
|
|
Console.WriteLine((int) (delay*1200));
|
|
|
|
int i = 0;
|
|
|
|
foreach (Bitmap frame in frames)
|
|
|
|
if (anim.Repeat > 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
foreach (Bitmap frame in frames)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
advancedPictureBox.Image = frame;
|
|
|
|
|
|
|
|
advancedInfoLabel.Text = $"Current frame: {frames.IndexOf(frame)}\nAnimation Speed: {fps}";
|
|
|
|
|
|
|
|
Thread.Sleep((int) (delay*1500));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
isAnimRunning = false;
|
|
|
|
|
|
|
|
Thread.CurrentThread.Abort();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
advancedPictureBox.Image = frame;
|
|
|
|
while (true)
|
|
|
|
advancedInfoLabel.Text = $"Current frame: {frames.IndexOf(frame)}\nAnimation Speed: {fps}";
|
|
|
|
{
|
|
|
|
Thread.Sleep((int) (delay*1500));
|
|
|
|
var frame = frames[i];
|
|
|
|
|
|
|
|
advancedPictureBox.Image = frame;
|
|
|
|
|
|
|
|
advancedInfoLabel.Text = $"Current frame: {i.ToString()}\nAnimation Speed: {fps}";
|
|
|
|
|
|
|
|
Thread.Sleep((int) (delay*1500));
|
|
|
|
|
|
|
|
i++;
|
|
|
|
|
|
|
|
if (i == frames.Count) i = 0;
|
|
|
|
|
|
|
|
if (breakAnim)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
isAnimRunning = false;
|
|
|
|
|
|
|
|
breakAnim = false;
|
|
|
|
|
|
|
|
Thread.CurrentThread.Abort();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Limited
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|