From a427d3a9c6a90d39a74f24942b4f9de7f6d44ce6 Mon Sep 17 00:00:00 2001 From: MattNL Date: Sun, 14 Aug 2022 13:02:34 -0400 Subject: [PATCH 1/3] Fix for Skins.pck not having XMLVERSION property --- PCK-Studio/Classes/IO/PCK/PCKFileWriter.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/PCK-Studio/Classes/IO/PCK/PCKFileWriter.cs b/PCK-Studio/Classes/IO/PCK/PCKFileWriter.cs index e5f4706a..a05ea3f9 100644 --- a/PCK-Studio/Classes/IO/PCK/PCKFileWriter.cs +++ b/PCK-Studio/Classes/IO/PCK/PCKFileWriter.cs @@ -20,6 +20,7 @@ namespace PckStudio.Classes.IO { _pckfile = file; LUT = _pckfile.GatherPropertiesList(); + if (!file.HasFile("localisation.loc", 6) && !LUT.Contains("XMLVERSION")) LUT.Insert(0, "XMLVERSION"); } private void WriteToStream(Stream stream) From 5674d47c67665f9caa6050a9f235b2f48002581a Mon Sep 17 00:00:00 2001 From: MattNL Date: Sun, 14 Aug 2022 22:26:28 -0400 Subject: [PATCH 2/3] ANIM Editor now only fires on Skin files --- PCK-Studio/MainForm.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PCK-Studio/MainForm.cs b/PCK-Studio/MainForm.cs index 27bcbfab..20c0251c 100644 --- a/PCK-Studio/MainForm.cs +++ b/PCK-Studio/MainForm.cs @@ -637,7 +637,7 @@ namespace PckStudio PCKFile.FileData file = (PCKFile.FileData)treeViewMain.SelectedNode.Tag; var property = (ValueTuple)treeMeta.SelectedNode.Tag; int i = file.properties.IndexOf(property); - if (property.Item1 == "ANIM" && i != -1) + if (property.Item1 == "ANIM" && i != -1 && file.type == 0) { using Forms.Utilities.Skins.ANIMEditor diag = new Forms.Utilities.Skins.ANIMEditor(property.Item2); if (diag.ShowDialog(this) == DialogResult.OK && diag.saved) From 45468b5cac7907d939be8957ad11a89b2dbf2ca7 Mon Sep 17 00:00:00 2001 From: MattNL Date: Sun, 14 Aug 2022 22:45:52 -0400 Subject: [PATCH 3/3] ANIM editor now kicks user back to rename prompt when failing --- PCK-Studio/MainForm.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/PCK-Studio/MainForm.cs b/PCK-Studio/MainForm.cs index 20c0251c..40a71f17 100644 --- a/PCK-Studio/MainForm.cs +++ b/PCK-Studio/MainForm.cs @@ -640,13 +640,21 @@ namespace PckStudio if (property.Item1 == "ANIM" && i != -1 && file.type == 0) { using Forms.Utilities.Skins.ANIMEditor diag = new Forms.Utilities.Skins.ANIMEditor(property.Item2); - if (diag.ShowDialog(this) == DialogResult.OK && diag.saved) + try { - file.properties[i] = new ValueTuple("ANIM", diag.outANIM); - ReloadMetaTreeView(); - saved = false; + if (diag.ShowDialog(this) == DialogResult.OK && diag.saved) + { + file.properties[i] = new ValueTuple("ANIM", diag.outANIM); + ReloadMetaTreeView(); + saved = false; + } return; } + catch (Exception ex) + { + Console.WriteLine(ex.Message); + MessageBox.Show("Failed to parse ANIM value, aborting to normal functionality. Please make sure the value only includes hexadecimal characters (0-9,A-F) and has no more than 8 characters. It can have an optional prefix of \"0x\"."); + } } using addMeta add = new addMeta(property.Item1, property.Item2); if (add.ShowDialog() == DialogResult.OK && i != -1)