diff --git a/PCK-Studio/App.config b/PCK-Studio/App.config index 026edf47..58eccc24 100644 --- a/PCK-Studio/App.config +++ b/PCK-Studio/App.config @@ -62,7 +62,7 @@ False - + False diff --git a/PCK-Studio/Controls/Editor/PckEditor.Designer.cs b/PCK-Studio/Controls/Editor/PckEditor.Designer.cs index dfe17388..ff7a30fe 100644 --- a/PCK-Studio/Controls/Editor/PckEditor.Designer.cs +++ b/PCK-Studio/Controls/Editor/PckEditor.Designer.cs @@ -47,8 +47,9 @@ namespace PckStudio.Controls this.contextMenuParameterTree = new System.Windows.Forms.ContextMenuStrip(this.components); this.addParameterToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.addParameterToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.addBOXEntryToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.addANIMEntryToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.addBOXEntryToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.addOFFSETParameterToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.addMultipleEntriesToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.deleteEntryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.editAllEntriesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -112,9 +113,8 @@ namespace PckStudio.Controls this.deleteFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.imageList = new System.Windows.Forms.ImageList(this.components); this.addMultipleEntriesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.LittleEndianCheckBox = new MetroFramework.Controls.MetroCheckBox(); + this.BigEndianCheckBox = new MetroFramework.Controls.MetroCheckBox(); this.previewPictureBox = new PckStudio.ToolboxItems.InterpolationPictureBox(); - this.addOFFSETParameterToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); logoPictureBox = new System.Windows.Forms.PictureBox(); ((System.ComponentModel.ISupportInitialize)(logoPictureBox)).BeginInit(); this.ParametersTabControl.SuspendLayout(); @@ -297,17 +297,23 @@ namespace PckStudio.Controls resources.ApplyResources(this.addParameterToolStripMenuItem1, "addParameterToolStripMenuItem1"); this.addParameterToolStripMenuItem1.Click += new System.EventHandler(this.addParameterToolStripMenuItem_Click); // + // addANIMEntryToolStripMenuItem1 + // + this.addANIMEntryToolStripMenuItem1.Name = "addANIMEntryToolStripMenuItem1"; + resources.ApplyResources(this.addANIMEntryToolStripMenuItem1, "addANIMEntryToolStripMenuItem1"); + this.addANIMEntryToolStripMenuItem1.Click += new System.EventHandler(this.addSkinAdjustmentParametersToolStripMenuItem_Click); + // // addBOXEntryToolStripMenuItem1 // this.addBOXEntryToolStripMenuItem1.Name = "addBOXEntryToolStripMenuItem1"; resources.ApplyResources(this.addBOXEntryToolStripMenuItem1, "addBOXEntryToolStripMenuItem1"); this.addBOXEntryToolStripMenuItem1.Click += new System.EventHandler(this.addBOXParameterToolStripMenuItem1_Click); // - // addANIMEntryToolStripMenuItem1 + // addOFFSETParameterToolStripMenuItem // - this.addANIMEntryToolStripMenuItem1.Name = "addANIMEntryToolStripMenuItem1"; - resources.ApplyResources(this.addANIMEntryToolStripMenuItem1, "addANIMEntryToolStripMenuItem1"); - this.addANIMEntryToolStripMenuItem1.Click += new System.EventHandler(this.addSkinAdjustmentParametersToolStripMenuItem_Click); + this.addOFFSETParameterToolStripMenuItem.Name = "addOFFSETParameterToolStripMenuItem"; + resources.ApplyResources(this.addOFFSETParameterToolStripMenuItem, "addOFFSETParameterToolStripMenuItem"); + this.addOFFSETParameterToolStripMenuItem.Click += new System.EventHandler(this.addOFFSETParameterToolStripMenuItem_Click); // // addMultipleEntriesToolStripMenuItem1 // @@ -765,14 +771,14 @@ namespace PckStudio.Controls resources.ApplyResources(this.addMultipleEntriesToolStripMenuItem, "addMultipleEntriesToolStripMenuItem"); this.addMultipleEntriesToolStripMenuItem.Name = "addMultipleEntriesToolStripMenuItem"; // - // LittleEndianCheckBox + // BigEndianCheckBox // - resources.ApplyResources(this.LittleEndianCheckBox, "LittleEndianCheckBox"); - this.LittleEndianCheckBox.BackColor = System.Drawing.Color.Transparent; - this.LittleEndianCheckBox.Name = "LittleEndianCheckBox"; - this.LittleEndianCheckBox.Style = MetroFramework.MetroColorStyle.White; - this.LittleEndianCheckBox.Theme = MetroFramework.MetroThemeStyle.Dark; - this.LittleEndianCheckBox.UseSelectable = true; + resources.ApplyResources(this.BigEndianCheckBox, "BigEndianCheckBox"); + this.BigEndianCheckBox.BackColor = System.Drawing.Color.Transparent; + this.BigEndianCheckBox.Name = "BigEndianCheckBox"; + this.BigEndianCheckBox.Style = MetroFramework.MetroColorStyle.White; + this.BigEndianCheckBox.Theme = MetroFramework.MetroThemeStyle.Dark; + this.BigEndianCheckBox.UseSelectable = true; // // previewPictureBox // @@ -784,18 +790,12 @@ namespace PckStudio.Controls this.previewPictureBox.Name = "previewPictureBox"; this.previewPictureBox.TabStop = false; // - // addOFFSETParameterToolStripMenuItem - // - this.addOFFSETParameterToolStripMenuItem.Name = "addOFFSETParameterToolStripMenuItem"; - resources.ApplyResources(this.addOFFSETParameterToolStripMenuItem, "addOFFSETParameterToolStripMenuItem"); - this.addOFFSETParameterToolStripMenuItem.Click += new System.EventHandler(this.addOFFSETParameterToolStripMenuItem_Click); - // // PckEditor // this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(18)))), ((int)(((byte)(18)))), ((int)(((byte)(18))))); resources.ApplyResources(this, "$this"); this.Controls.Add(this.previewPictureBox); - this.Controls.Add(this.LittleEndianCheckBox); + this.Controls.Add(this.BigEndianCheckBox); this.Controls.Add(this.pckFileLabel); this.Controls.Add(this.labelImageSize); this.Controls.Add(this.fileEntryCountLabel); @@ -870,7 +870,7 @@ namespace PckStudio.Controls private MetroFramework.Controls.MetroTextBox parameterValueTextBox; private MetroFramework.Controls.MetroButton buttonEdit; private MetroFramework.Controls.MetroLabel metroLabel1; - private MetroFramework.Controls.MetroCheckBox LittleEndianCheckBox; + private MetroFramework.Controls.MetroCheckBox BigEndianCheckBox; private System.Windows.Forms.ToolStripMenuItem setSubPCKEndiannessToolStripMenuItem; private ToolStripMenuItem bigEndianXbox360PS3WiiUToolStripMenuItem; private ToolStripMenuItem littleEndianPS4PSVitaSwitchToolStripMenuItem; diff --git a/PCK-Studio/Controls/Editor/PckEditor.cs b/PCK-Studio/Controls/Editor/PckEditor.cs index e561910e..afe118ce 100644 --- a/PCK-Studio/Controls/Editor/PckEditor.cs +++ b/PCK-Studio/Controls/Editor/PckEditor.cs @@ -80,8 +80,8 @@ namespace PckStudio.Controls _originalEndianness = packInfo.Endianness; _currentEndianness = packInfo.Endianness; - LittleEndianCheckBox.Visible = packInfo.AllowEndianSwap; - LittleEndianCheckBox.Checked = packInfo.Endianness == OMI.ByteOrder.LittleEndian; + BigEndianCheckBox.Visible = packInfo.AllowEndianSwap; + BigEndianCheckBox.Checked = packInfo.Endianness == OMI.ByteOrder.BigEndian; treeViewMain.TreeViewNodeSorter = new PckNodeSorter(); treeViewMain.DrawMode = TreeViewDrawMode.OwnerDrawText; @@ -186,7 +186,7 @@ namespace PckStudio.Controls protected override void PreSave() { - EditorValue.Endianness = LittleEndianCheckBox.Checked ? OMI.ByteOrder.LittleEndian : OMI.ByteOrder.BigEndian; + EditorValue.Endianness = BigEndianCheckBox.Checked ? OMI.ByteOrder.BigEndian : OMI.ByteOrder.LittleEndian; } protected override void PostSave() @@ -1526,11 +1526,11 @@ namespace PckStudio.Controls } PckAudioFile newAudioFile = CreateNewAudioFile(); - PckAsset newAudioAsset = CreateNewAudioAsset(LittleEndianCheckBox.Checked, newAudioFile); + PckAsset newAudioAsset = CreateNewAudioAsset(BigEndianCheckBox.Checked, newAudioFile); ISaveContext saveContext = new DelegatedSaveContext(Settings.Default.AutoSaveChanges, (audioFile) => { - newAudioAsset.SetData(new PckAudioFileWriter(audioFile, LittleEndianCheckBox.Checked ? OMI.ByteOrder.LittleEndian : OMI.ByteOrder.BigEndian)); + newAudioAsset.SetData(new PckAudioFileWriter(audioFile, BigEndianCheckBox.Checked ? OMI.ByteOrder.BigEndian : OMI.ByteOrder.LittleEndian)); }); AudioEditor diag = new AudioEditor(newAudioFile, saveContext); @@ -1563,7 +1563,7 @@ namespace PckStudio.Controls } EditorValue.File.CreateNewAsset("Skins.pck", PckAssetType.SkinDataFile, new PckFileWriter(new PckFile(3, 3), - LittleEndianCheckBox.Checked ? OMI.ByteOrder.LittleEndian : OMI.ByteOrder.BigEndian)); + BigEndianCheckBox.Checked ? OMI.ByteOrder.BigEndian : OMI.ByteOrder.LittleEndian)); BuildMainTreeView(); } @@ -2352,13 +2352,13 @@ namespace PckStudio.Controls private void SetPckXMLVersion(int xmlVersion) { - bool isLittleEndian = LittleEndianCheckBox.Checked; + bool isBigEndian = BigEndianCheckBox.Checked; try { if (treeViewMain.SelectedNode.Tag is PckAsset asset && (asset.Type is PckAssetType.AudioFile || asset.Type is PckAssetType.SkinDataFile || asset.Type is PckAssetType.TexturePackInfoFile)) { - OMI.ByteOrder endianness = isLittleEndian ? OMI.ByteOrder.LittleEndian : OMI.ByteOrder.BigEndian; + OMI.ByteOrder endianness = isBigEndian ? OMI.ByteOrder.BigEndian : OMI.ByteOrder.LittleEndian; IDataFormatReader reader = new PckFileReader(endianness); object pck = reader.FromStream(new MemoryStream(asset.Data)); @@ -2370,7 +2370,7 @@ namespace PckStudio.Controls } catch (OverflowException) { - MessageBox.Show(this, $"\"PCK cannot be set because the file endianness is not {(isLittleEndian ? "little" : "big")}.", "Unable to set PCK BOX Version"); + MessageBox.Show(this, $"\"PCK cannot be set because the file endianness is not {(isBigEndian ? "big" : "little")}.", "Unable to set PCK BOX Version"); return; } catch (Exception ex) diff --git a/PCK-Studio/Controls/Editor/PckEditor.resx b/PCK-Studio/Controls/Editor/PckEditor.resx index 5d345c0c..ea5827db 100644 --- a/PCK-Studio/Controls/Editor/PckEditor.resx +++ b/PCK-Studio/Controls/Editor/PckEditor.resx @@ -912,7 +912,7 @@ True - 76, 72 + 76, 69 0, 0 @@ -957,7 +957,7 @@ False - 215, 42 + 215, 39 146, 20 @@ -1002,7 +1002,7 @@ False - 215, 74 + 215, 71 146, 20 @@ -1026,7 +1026,7 @@ Bottom, Right - 215, 100 + 215, 97 146, 33 @@ -1059,7 +1059,7 @@ True - 138, -35 + 138, -38 0, 0 @@ -1139,7 +1139,7 @@ Edit All Parameters - 206, 114 + 206, 92 contextMenuParameterTree @@ -1743,34 +1743,34 @@ Add Multiple Entries - + Top, Right - + True - - 831, 0 + + 819, 0 - - 173, 15 + + 185, 15 - + 22 - - Save as Switch/Vita/PS4 PCK + + Set as Xbox 360/PS3/Wii U PCK - - LittleEndianCheckBox + + BigEndianCheckBox - + MetroFramework.Controls.MetroCheckBox, MetroFramework, Version=1.4.0.0, Culture=neutral, PublicKeyToken=5f91a84759bf584a - + $this - + 3 @@ -1833,16 +1833,22 @@ System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + addANIMEntryToolStripMenuItem1 + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + addBOXEntryToolStripMenuItem1 System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - addANIMEntryToolStripMenuItem1 + + addOFFSETParameterToolStripMenuItem - + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 @@ -2205,12 +2211,6 @@ System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - addOFFSETParameterToolStripMenuItem - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - PckEditor diff --git a/PCK-Studio/Forms/AppSettingsForm.cs b/PCK-Studio/Forms/AppSettingsForm.cs index c42fe787..2192dbe7 100644 --- a/PCK-Studio/Forms/AppSettingsForm.cs +++ b/PCK-Studio/Forms/AppSettingsForm.cs @@ -21,7 +21,7 @@ namespace PckStudio.Forms { ["ShowRichPresence"] = "Show Rich Presence", ["AutoSaveChanges"] = "Auto Save", - ["UseLittleEndianAsDefault"] = "Open as Little Endian", + ["UseBigEndianAsDefault"] = "Open as Big Endian", ["AutoUpdate"] = "Auto Update", ["LoadSubPcks"] = "Load Sub Pcks", ["UsePrerelease"] = "Use Prerelease", diff --git a/PCK-Studio/Forms/Skins-And-Textures/AdvancedOptions.cs b/PCK-Studio/Forms/Skins-And-Textures/AdvancedOptions.cs index e4f8699f..0b1249b5 100644 --- a/PCK-Studio/Forms/Skins-And-Textures/AdvancedOptions.cs +++ b/PCK-Studio/Forms/Skins-And-Textures/AdvancedOptions.cs @@ -14,11 +14,11 @@ namespace PckStudio.Popups { public partial class AdvancedOptions : MetroFramework.Forms.MetroForm { - public bool IsLittleEndian + public bool IsBigEndian { set { - _endianness = value ? ByteOrder.LittleEndian : ByteOrder.BigEndian; + _endianness = value ? ByteOrder.BigEndian : ByteOrder.LittleEndian; } } private readonly PckFile _pckFile; diff --git a/PCK-Studio/MainForm.cs b/PCK-Studio/MainForm.cs index 3c5b9033..bb22f97c 100644 --- a/PCK-Studio/MainForm.cs +++ b/PCK-Studio/MainForm.cs @@ -95,7 +95,8 @@ namespace PckStudio } try { - OMI.ByteOrder byteOrder = OMI.ByteOrder.BigEndian; + // Try first with Little Endian as more platforms use that + OMI.ByteOrder byteOrder = OMI.ByteOrder.LittleEndian; PckFile pckFile = ReadPck(filepath, byteOrder); packInfo = PackInfo.Create(pckFile, byteOrder, true); return packInfo.IsValid; @@ -104,8 +105,8 @@ namespace PckStudio { try { - // if failed, attempt again in the reverse. THEN throw an error if failed - OMI.ByteOrder byteOrder = OMI.ByteOrder.LittleEndian; + // if failed, attempt check again for Old Gen Platforms + OMI.ByteOrder byteOrder = OMI.ByteOrder.BigEndian; PckFile pckFile = ReadPck(filepath, byteOrder); packInfo = PackInfo.Create(pckFile, byteOrder, true); return packInfo.IsValid; @@ -441,7 +442,7 @@ namespace PckStudio if (TryGetCurrentEditor(out IEditor editor)) { using AdvancedOptions advanced = new AdvancedOptions(editor.EditorValue.File); - advanced.IsLittleEndian = editor.EditorValue.Endianness == OMI.ByteOrder.LittleEndian; + advanced.IsBigEndian = editor.EditorValue.Endianness == OMI.ByteOrder.BigEndian; if (advanced.ShowDialog() == DialogResult.OK) { editor.UpdateView(); diff --git a/PCK-Studio/Properties/Settings.Designer.cs b/PCK-Studio/Properties/Settings.Designer.cs index 3f841b70..5a772874 100644 --- a/PCK-Studio/Properties/Settings.Designer.cs +++ b/PCK-Studio/Properties/Settings.Designer.cs @@ -47,12 +47,12 @@ namespace PckStudio.Properties { [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool UseLittleEndianAsDefault { + public bool UseBigEndianAsDefault { get { - return ((bool)(this["UseLittleEndianAsDefault"])); + return ((bool)(this["UseBigEndianAsDefault"])); } set { - this["UseLittleEndianAsDefault"] = value; + this["UseBigEndianAsDefault"] = value; } } diff --git a/PCK-Studio/Properties/Settings.settings b/PCK-Studio/Properties/Settings.settings index ee7a7d69..ec5787f3 100644 --- a/PCK-Studio/Properties/Settings.settings +++ b/PCK-Studio/Properties/Settings.settings @@ -8,7 +8,7 @@ False - + False