Template packs now include pack comparison and icon images

This commit is contained in:
MattNL
2022-11-28 21:04:05 -05:00
parent 9575e2439c
commit cb7ae80a9c

View File

@@ -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);
}