From cb7ae80a9cb4f17e45e015f63d2f8409a2bc2d1e Mon Sep 17 00:00:00 2001 From: MattNL Date: Mon, 28 Nov 2022 21:04:05 -0500 Subject: [PATCH] Template packs now include pack comparison and icon images --- PCK-Studio/MainForm.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/PCK-Studio/MainForm.cs b/PCK-Studio/MainForm.cs index 814fa3a6..6dd8619b 100644 --- a/PCK-Studio/MainForm.cs +++ b/PCK-Studio/MainForm.cs @@ -1204,6 +1204,26 @@ namespace PckStudio var texturepackInfo = new PCKFile.FileData($"{res}/{res}Info.pck", PCKFile.FileData.FileType.TexturePackInfoFile); texturepackInfo.properties.Add(("PACKID", "0")); texturepackInfo.properties.Add(("DATAPATH", $"{res}Data.pck")); + + PCKFile infoPCK = new PCKFile(3); + + var ms = new MemoryStream(); + var ms2 = new MemoryStream(); + var ms3 = new MemoryStream(); + + var comparison = new PCKFile.FileData("comparison.png", PCKFile.FileData.FileType.TextureFile); + Resources.Comparison.Save(ms, ImageFormat.Png); + comparison.SetData(ms.ToArray()); + + var icon = new PCKFile.FileData("icon.png", PCKFile.FileData.FileType.TextureFile); + Resources.TexturePackIcon.Save(ms2, ImageFormat.Png); + icon.SetData(ms2.ToArray()); + + infoPCK.Files.Add(icon); + infoPCK.Files.Add(comparison); + + PCKFileWriter.Write(ms3, infoPCK, LittleEndianCheckBox.Checked); + texturepackInfo.SetData(ms3.ToArray()); currentPCK.Files.Add(texturepackInfo); }