mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-06-26 11:05:48 +00:00
Core - Refactor stuff
This commit is contained in:
@@ -63,7 +63,9 @@ namespace PckStudio.Forms.Additional_Popups.Animation
|
||||
};
|
||||
TreeView view = filterPrompt.AddFilterPage(name, null, filterPredicate);
|
||||
view.ImageList = images.ToImageList();
|
||||
foreach ((int i, JsonTileInfo tileData) in textureInfos?.Enumerate())
|
||||
|
||||
int i = 0;
|
||||
foreach (JsonTileInfo tileData in textureInfos)
|
||||
{
|
||||
if (string.IsNullOrEmpty(tileData.InternalName) || view.Nodes.ContainsKey(tileData.InternalName))
|
||||
continue;
|
||||
@@ -73,6 +75,7 @@ namespace PckStudio.Forms.Additional_Popups.Animation
|
||||
Tag = tileData
|
||||
};
|
||||
view.Nodes.Add(tileNode);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -91,6 +91,14 @@ namespace PckStudio.Forms.Additional_Popups.Animation
|
||||
_selectedItem = e.Node.Tag;
|
||||
Events[nameof(OnSelectedItemChanged)]?.DynamicInvoke(this, EventArgs.Empty);
|
||||
};
|
||||
pageView.KeyPress += (s, e) =>
|
||||
{
|
||||
if ((e.KeyChar == '\n' || e.KeyChar == '\r') && Parent is Form f)
|
||||
{
|
||||
f.DialogResult = DialogResult.OK;
|
||||
e.Handled = true;
|
||||
}
|
||||
};
|
||||
var backingView = new TreeView()
|
||||
{
|
||||
Dock = DockStyle.Fill,
|
||||
|
||||
@@ -35,6 +35,7 @@ using PckStudio.Core.Serializer;
|
||||
using PckStudio.Core;
|
||||
using PckStudio.Interfaces;
|
||||
using PckStudio.Controls;
|
||||
using PckStudio.Core.IO.Java;
|
||||
|
||||
namespace PckStudio.Forms.Editor
|
||||
{
|
||||
@@ -328,7 +329,7 @@ namespace PckStudio.Forms.Editor
|
||||
try
|
||||
{
|
||||
Image img = Image.FromFile(textureFile).ReleaseFromFile();
|
||||
JObject mcmeta = JObject.Parse(File.ReadAllText(fileDialog.FileName));
|
||||
McMeta mcmeta = McMeta.LoadMcMeta(File.ReadAllText(fileDialog.FileName));
|
||||
Animation javaAnimation = AnimationDeserializer.DefaultDeserializer.DeserializeJavaAnimation(mcmeta, img);
|
||||
EditorValue = javaAnimation;
|
||||
LoadAnimationTreeView();
|
||||
|
||||
Reference in New Issue
Block a user