diff --git a/PCK-Studio/Controls/Editor/PckEditor.cs b/PCK-Studio/Controls/Editor/PckEditor.cs index f1a537d6..e561910e 100644 --- a/PCK-Studio/Controls/Editor/PckEditor.cs +++ b/PCK-Studio/Controls/Editor/PckEditor.cs @@ -502,6 +502,13 @@ namespace PckStudio.Controls asset.SetSkin(customSkin, locFile); }); + if (skin.Model.AdditionalBoxes.FindAll(box => box.Scale != 0).Count > 0 && EditorValue.File.xmlVersion != 3 && + MessageBox.Show(this, "This skin has custom scaled boxes but the PCK file's current BOX Version does not support it. Would you like to set the PCK's BOX version to 3? This feature only works in TU69 and above.", "BOX Version mismatch.", MessageBoxButtons.YesNo) == DialogResult.Yes) + { + // set the xmlVersion of the parent pck to 3 + (ParentForm as MainForm).setXMLVersion3MenuItem.PerformClick(); + } + using CustomSkinEditor skinEditor = new CustomSkinEditor(skin, saveContext, EditorValue.File.xmlVersion); if (skinEditor.ShowDialog() == DialogResult.OK) { diff --git a/PCK-Studio/Forms/Editor/CustomSkinEditor.cs b/PCK-Studio/Forms/Editor/CustomSkinEditor.cs index 614c9dbe..8f2b3cfd 100644 --- a/PCK-Studio/Forms/Editor/CustomSkinEditor.cs +++ b/PCK-Studio/Forms/Editor/CustomSkinEditor.cs @@ -75,7 +75,7 @@ namespace PckStudio.Forms.Editor skinNameLabel.Text = EditorValue.MetaData.Name; if (EditorValue.HasCape) renderer3D1.CapeTexture = EditorValue.CapeTexture; - boxEditorControl1.Enabled = false; // enabled by default just in case - May + boxEditorControl1.Enabled = false; LoadModelData(); } @@ -90,13 +90,14 @@ namespace PckStudio.Forms.Editor List boxProperties = modelInfo.AdditionalBoxes; List offsetProperties = modelInfo.PartOffsets; - + renderer3D1.ANIM = EditorValue.Anim; renderer3D1.ModelData.Clear(); foreach (SkinBOX box in boxProperties) { - renderer3D1.ModelData.Add(box); + // this is to ensure scales are removed if not version 3 + renderer3D1.ModelData.Add(new SkinBOX(box.Type, box.Pos, box.Size, box.UV, box.ArmorMaskFlags.ToValue(), box.Mirror, _xmlVersion == 3 ? box.Scale : 0)); } renderer3D1.ResetOffsets(); foreach (SkinPartOffset offset in offsetProperties) diff --git a/PCK-Studio/MainForm.Designer.cs b/PCK-Studio/MainForm.Designer.cs index 91ba6cca..54c771ab 100644 --- a/PCK-Studio/MainForm.Designer.cs +++ b/PCK-Studio/MainForm.Designer.cs @@ -600,10 +600,10 @@ private System.Windows.Forms.ToolStripMenuItem recentlyOpenToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem setXMLVersionStripMenuItem; - private ToolboxItems.ToolStripRadioButtonMenuItem setXMLVersion0MenuItem; - private ToolboxItems.ToolStripRadioButtonMenuItem setXMLVersion1MenuItem; - private ToolboxItems.ToolStripRadioButtonMenuItem setXMLVersion2MenuItem; - private ToolboxItems.ToolStripRadioButtonMenuItem setXMLVersion3MenuItem; + public ToolboxItems.ToolStripRadioButtonMenuItem setXMLVersion0MenuItem; + public ToolboxItems.ToolStripRadioButtonMenuItem setXMLVersion1MenuItem; + public ToolboxItems.ToolStripRadioButtonMenuItem setXMLVersion2MenuItem; + public ToolboxItems.ToolStripRadioButtonMenuItem setXMLVersion3MenuItem; } }