From fbff8346eb6f5e6c43fe270f77b2febad8944c07 Mon Sep 17 00:00:00 2001 From: PhoenixARC <46140834+PhoenixARC@users.noreply.github.com> Date: Sat, 26 Apr 2025 13:05:46 -0400 Subject: [PATCH] Fix two bugs involving packs crashing texturepacks now use the proper 'languages.loc' instead of 'localisation.loc' PACKIDs now use the uint24 limit instead of the max int32 limit --- PCK-Studio/MainForm.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/PCK-Studio/MainForm.cs b/PCK-Studio/MainForm.cs index 6ca438c2..687dd1d8 100644 --- a/PCK-Studio/MainForm.cs +++ b/PCK-Studio/MainForm.cs @@ -1512,6 +1512,8 @@ namespace PckStudio PckFile infoPCK = new PckFile(3); + pack.GetAsset("localisation.loc", PckAssetType.LocalisationFile).Filename = "languages.loc"; + PckAsset iconAsset = infoPCK.CreateNewAsset("icon.png", PckAssetType.TextureFile); iconAsset.SetTexture(Resources.TexturePackIcon); @@ -1559,7 +1561,7 @@ namespace PckStudio namePrompt.OKButtonText = "Ok"; if (namePrompt.ShowDialog(this) == DialogResult.OK) { - currentPCK = InitializePack(new Random().Next(8000, int.MaxValue), 0, namePrompt.NewText, false); + currentPCK = InitializePack(new Random().Next(8000, 16777215), 0, namePrompt.NewText, false); // 16777215 being the uint24 max value MarkTemplateFile(); LoadEditorTab(); } @@ -1571,7 +1573,7 @@ namespace PckStudio CreateTexturePackPrompt packPrompt = new CreateTexturePackPrompt(); if (packPrompt.ShowDialog(this) == DialogResult.OK) { - currentPCK = InitializeTexturePack(new Random().Next(8000, int.MaxValue), 0, packPrompt.PackName, packPrompt.PackRes, packPrompt.CreateSkinsPck); + currentPCK = InitializeTexturePack(new Random().Next(8000, 16777215), 0, packPrompt.PackName, packPrompt.PackRes, packPrompt.CreateSkinsPck); // 16777215 being the uint24 max value MarkTemplateFile(); LoadEditorTab(); } @@ -1583,7 +1585,7 @@ namespace PckStudio CreateTexturePackPrompt packPrompt = new CreateTexturePackPrompt(); if (packPrompt.ShowDialog(this) == DialogResult.OK) { - currentPCK = InitializeMashUpPack(new Random().Next(8000, int.MaxValue), 0, packPrompt.PackName, packPrompt.PackRes); + currentPCK = InitializeMashUpPack(new Random().Next(8000, 16777215), 0, packPrompt.PackName, packPrompt.PackRes); // 16777215 being the uint24 max value MarkTemplateFile(); LoadEditorTab(); }