mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-05-28 20:15:05 +00:00
51 lines
1.3 KiB
C#
51 lines
1.3 KiB
C#
using System;
|
|
using System.Diagnostics;
|
|
using System.Drawing;
|
|
using System.Windows.Forms;
|
|
using PckStudio.ToolboxItems;
|
|
|
|
namespace PckStudio.Forms.Additional_Popups.Animation
|
|
{
|
|
public partial class FrameEditor : ThemeForm
|
|
{
|
|
public int FrameTextureIndex => FrameList.SelectedNode.Index;
|
|
public int FrameTime => (int)FrameTimeUpDown.Value;
|
|
|
|
public FrameEditor(ImageList texList)
|
|
{
|
|
InitializeComponent();
|
|
FrameList.ImageList = texList;
|
|
for (int index = 0; index < texList.Images.Count; index++)
|
|
{
|
|
TreeNode frame = new TreeNode($"Frame {index}", index, index);
|
|
FrameList.Nodes.Add(frame);
|
|
Debug.WriteLine(index);
|
|
}
|
|
}
|
|
|
|
public FrameEditor(int frameTime, int frameTextureIndex, ImageList texList) : this(texList)
|
|
{
|
|
FrameList.SelectedNode = FrameList.Nodes[frameTextureIndex];
|
|
FrameList.SelectedNode.EnsureVisible();
|
|
FrameTimeUpDown.Value = frameTime;
|
|
}
|
|
|
|
private void FrameEditor_Load(object sender, EventArgs e)
|
|
{
|
|
|
|
}
|
|
|
|
private void SaveButton_Click(object sender, EventArgs e)
|
|
{
|
|
DialogResult = DialogResult.OK;
|
|
Close();
|
|
}
|
|
|
|
private void CancelButton_Click(object sender, EventArgs e)
|
|
{
|
|
DialogResult = DialogResult.Cancel;
|
|
Close();
|
|
}
|
|
}
|
|
}
|