From d452f21653e7b788d784733bd053a782356eb36b Mon Sep 17 00:00:00 2001 From: igorseabra4 Date: Sat, 24 Nov 2018 15:58:24 -0300 Subject: [PATCH] more asset data, multiple sndi support, fix copy sounds --- HipHopTool | 2 +- .../ArchiveEditor/ArchiveEditor.Designer.cs | 68 ++--- IndustrialPark/ArchiveEditor/ArchiveEditor.cs | 38 ++- .../ArchiveEditor/ArchiveEditorFunctions.cs | 35 ++- .../AssetEditor/AddAssetDialog.cs | 17 -- .../AssetEditor/InternalSoundEditor.cs | 2 +- IndustrialPark/Assets/Binary/AssetALST.cs | 2 + IndustrialPark/Assets/Binary/AssetANIM.cs | 11 + IndustrialPark/Assets/Binary/AssetMAPR.cs | 3 + IndustrialPark/Assets/Binary/AssetPICK.cs | 1 + IndustrialPark/Assets/Binary/AssetPIPT.cs | 1 + IndustrialPark/Assets/Binary/AssetSHDW.cs | 2 + .../Assets/Binary/AssetSNDI_GCN_V1.cs | 3 + IndustrialPark/Assets/Binary/AssetSNDI_PS2.cs | 3 + .../Assets/Binary/AssetSNDI_XBOX.cs | 4 + .../Assets/ObjectAssets/AssetCNTR.cs | 3 + .../Assets/ObjectAssets/AssetCOND.cs | 5 + .../Assets/ObjectAssets/AssetENV.cs | 16 ++ .../Assets/ObjectAssets/AssetGRUP.cs | 3 + .../Assets/ObjectAssets/AssetPORT.cs | 5 + .../Assets/ObjectAssets/AssetTIMR.cs | 3 + .../ObjectAssets/ClickableAssets/AssetCAM.cs | 66 +++-- .../ObjectAssets/ClickableAssets/AssetMRKR.cs | 7 + .../ObjectAssets/ClickableAssets/AssetMVPT.cs | 12 + .../ObjectAssets/ClickableAssets/AssetSFX.cs | 13 + .../PlaceableAssets/AssetBUTN.cs | 266 +++--------------- .../PlaceableAssets/AssetPKUP.cs | 4 + .../PlaceableAssets/AssetPLYR.cs | 2 + .../PlaceableAssets/AssetVIL.cs | 7 + IndustrialPark/Assets/Shared/Asset.cs | 10 + IndustrialPark/Assets/Shared/ObjectAsset.cs | 53 +--- .../Assets/Shared/PlaceableAsset.cs | 21 ++ IndustrialPark/Assets/WithModel/AssetMINF.cs | 2 + 33 files changed, 318 insertions(+), 372 deletions(-) diff --git a/HipHopTool b/HipHopTool index aa943346..e77edb90 160000 --- a/HipHopTool +++ b/HipHopTool @@ -1 +1 @@ -Subproject commit aa943346b30ae1cecb37c0d86ae4492135f145a5 +Subproject commit e77edb90bf03e54a766cfa38abbdc17cb15e05a1 diff --git a/IndustrialPark/ArchiveEditor/ArchiveEditor.Designer.cs b/IndustrialPark/ArchiveEditor/ArchiveEditor.Designer.cs index 7161b8c2..8763b130 100644 --- a/IndustrialPark/ArchiveEditor/ArchiveEditor.Designer.cs +++ b/IndustrialPark/ArchiveEditor/ArchiveEditor.Designer.cs @@ -30,11 +30,15 @@ private void InitializeComponent() { this.menuStrip1 = new System.Windows.Forms.MenuStrip(); this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.closeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.hipHopToolExportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.importHIPArchiveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.exportTXDArchiveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.importTXDArchiveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.statusStrip1 = new System.Windows.Forms.StatusStrip(); @@ -62,10 +66,6 @@ private void InitializeComponent() this.buttonAddAsset = new System.Windows.Forms.Button(); this.comboBoxAssetTypes = new System.Windows.Forms.ComboBox(); this.label2 = new System.Windows.Forms.Label(); - this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); - this.importHIPArchiveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.hipHopToolExportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.menuStrip1.SuspendLayout(); this.statusStrip1.SuspendLayout(); this.groupBox1.SuspendLayout(); @@ -96,10 +96,17 @@ private void InitializeComponent() this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); this.fileToolStripMenuItem.Text = "File"; // + // newToolStripMenuItem + // + this.newToolStripMenuItem.Name = "newToolStripMenuItem"; + this.newToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.newToolStripMenuItem.Text = "New"; + this.newToolStripMenuItem.Click += new System.EventHandler(this.newToolStripMenuItem_Click); + // // openToolStripMenuItem // this.openToolStripMenuItem.Name = "openToolStripMenuItem"; - this.openToolStripMenuItem.Size = new System.Drawing.Size(123, 22); + this.openToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.openToolStripMenuItem.Text = "Open"; this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click); // @@ -107,7 +114,7 @@ private void InitializeComponent() // this.saveToolStripMenuItem.Enabled = false; this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; - this.saveToolStripMenuItem.Size = new System.Drawing.Size(123, 22); + this.saveToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.saveToolStripMenuItem.Text = "Save"; this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click); // @@ -115,14 +122,19 @@ private void InitializeComponent() // this.saveAsToolStripMenuItem.Enabled = false; this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem"; - this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(123, 22); + this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.saveAsToolStripMenuItem.Text = "Save As..."; this.saveAsToolStripMenuItem.Click += new System.EventHandler(this.saveAsToolStripMenuItem_Click); // + // toolStripSeparator1 + // + this.toolStripSeparator1.Name = "toolStripSeparator1"; + this.toolStripSeparator1.Size = new System.Drawing.Size(177, 6); + // // closeToolStripMenuItem // this.closeToolStripMenuItem.Name = "closeToolStripMenuItem"; - this.closeToolStripMenuItem.Size = new System.Drawing.Size(123, 22); + this.closeToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.closeToolStripMenuItem.Text = "Close"; this.closeToolStripMenuItem.Click += new System.EventHandler(this.closeToolStripMenuItem_Click); // @@ -137,6 +149,20 @@ private void InitializeComponent() this.editToolStripMenuItem.Size = new System.Drawing.Size(39, 20); this.editToolStripMenuItem.Text = "Edit"; // + // hipHopToolExportToolStripMenuItem + // + this.hipHopToolExportToolStripMenuItem.Name = "hipHopToolExportToolStripMenuItem"; + this.hipHopToolExportToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.hipHopToolExportToolStripMenuItem.Text = "Export Assets + INI"; + this.hipHopToolExportToolStripMenuItem.Click += new System.EventHandler(this.hipHopToolExportToolStripMenuItem_Click); + // + // importHIPArchiveToolStripMenuItem + // + this.importHIPArchiveToolStripMenuItem.Name = "importHIPArchiveToolStripMenuItem"; + this.importHIPArchiveToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.importHIPArchiveToolStripMenuItem.Text = "Import HIP Archive"; + this.importHIPArchiveToolStripMenuItem.Click += new System.EventHandler(this.importHIPArchiveToolStripMenuItem_Click); + // // exportTXDArchiveToolStripMenuItem // this.exportTXDArchiveToolStripMenuItem.Name = "exportTXDArchiveToolStripMenuItem"; @@ -449,32 +475,6 @@ private void InitializeComponent() this.label2.TabIndex = 4; this.label2.Text = "Show by Type:"; // - // toolStripSeparator1 - // - this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(177, 6); - // - // importHIPArchiveToolStripMenuItem - // - this.importHIPArchiveToolStripMenuItem.Name = "importHIPArchiveToolStripMenuItem"; - this.importHIPArchiveToolStripMenuItem.Size = new System.Drawing.Size(180, 22); - this.importHIPArchiveToolStripMenuItem.Text = "Import HIP Archive"; - this.importHIPArchiveToolStripMenuItem.Click += new System.EventHandler(this.importHIPArchiveToolStripMenuItem_Click); - // - // hipHopToolExportToolStripMenuItem - // - this.hipHopToolExportToolStripMenuItem.Name = "hipHopToolExportToolStripMenuItem"; - this.hipHopToolExportToolStripMenuItem.Size = new System.Drawing.Size(180, 22); - this.hipHopToolExportToolStripMenuItem.Text = "HipHopTool Export"; - this.hipHopToolExportToolStripMenuItem.Click += new System.EventHandler(this.hipHopToolExportToolStripMenuItem_Click); - // - // newToolStripMenuItem - // - this.newToolStripMenuItem.Name = "newToolStripMenuItem"; - this.newToolStripMenuItem.Size = new System.Drawing.Size(180, 22); - this.newToolStripMenuItem.Text = "New"; - this.newToolStripMenuItem.Click += new System.EventHandler(this.newToolStripMenuItem_Click); - // // ArchiveEditor // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); diff --git a/IndustrialPark/ArchiveEditor/ArchiveEditor.cs b/IndustrialPark/ArchiveEditor/ArchiveEditor.cs index ed50ea65..289b1906 100644 --- a/IndustrialPark/ArchiveEditor/ArchiveEditor.cs +++ b/IndustrialPark/ArchiveEditor/ArchiveEditor.cs @@ -438,7 +438,30 @@ private void buttonCopy_Click(object sender, EventArgs e) List copiedAHDRs = new List(); foreach (uint u in archive.GetCurrentlySelectedAssetIDs()) - copiedAHDRs.Add(archive.GetFromAssetID(u).AHDR); + { + Section_AHDR AHDR = JsonConvert.DeserializeObject(JsonConvert.SerializeObject(archive.GetFromAssetID(u).AHDR)); + + if (AHDR.assetType == AssetType.SND || AHDR.assetType == AssetType.SNDS) + { + List file = new List(); + file.AddRange(archive.GetHeaderFromSNDI(AHDR.assetID)); + file.AddRange(AHDR.data); + + if (new string(new char[] { (char)file[0], (char)file[1], (char)file[2], (char)file[3] }) == "RIFF") + { + byte[] chunkSizeArr = BitConverter.GetBytes(file.Count - 8); + + file[4] = chunkSizeArr[0]; + file[5] = chunkSizeArr[1]; + file[6] = chunkSizeArr[2]; + file[7] = chunkSizeArr[3]; + } + + AHDR.data = file.ToArray(); + } + + copiedAHDRs.Add(AHDR); + } Clipboard.SetText(JsonConvert.SerializeObject(copiedAHDRs)); } @@ -462,6 +485,19 @@ private void buttonPaste_Click(object sender, EventArgs e) foreach (Section_AHDR AHDR in AHDRs) { + if (AHDR.assetType == AssetType.SND || AHDR.assetType == AssetType.SNDS) + { + try + { + archive.AddSoundToSNDI(AHDR.data, AHDR.assetID, AHDR.assetType, out byte[] soundData); + AHDR.data = soundData; + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + } + } + archive.AddAssetWithUniqueID(comboBoxLayers.SelectedIndex, AHDR); assetIDs.Add(AHDR.assetID); } diff --git a/IndustrialPark/ArchiveEditor/ArchiveEditorFunctions.cs b/IndustrialPark/ArchiveEditor/ArchiveEditorFunctions.cs index d38cf673..51798aab 100644 --- a/IndustrialPark/ArchiveEditor/ArchiveEditorFunctions.cs +++ b/IndustrialPark/ArchiveEditor/ArchiveEditorFunctions.cs @@ -1048,23 +1048,23 @@ public void AddTextureDictionary(string fileName) ReadFileMethods.treatTexturesAsByteArray = false; } - public void AddSoundToSNDI(byte[] soundData, uint assetID, out byte[] finalData) + public void AddSoundToSNDI(byte[] soundData, uint assetID, AssetType assetType, out byte[] finalData) { foreach (Asset a in assetDictionary.Values) { if (a is AssetSNDI_GCN_V1 SNDI_G1) { - SNDI_G1.AddEntry(soundData, assetID, GetFromAssetID(assetID).AHDR.assetType, out finalData); + SNDI_G1.AddEntry(soundData, assetID, assetType, out finalData); return; } else if (a is AssetSNDI_XBOX SNDI_X) { - SNDI_X.AddEntry(soundData, assetID, GetFromAssetID(assetID).AHDR.assetType, out finalData); + SNDI_X.AddEntry(soundData, assetID, assetType, out finalData); return; } else if (a is AssetSNDI_PS2 SNDI_P) { - SNDI_P.AddEntry(soundData, assetID, GetFromAssetID(assetID).AHDR.assetType, out finalData); + SNDI_P.AddEntry(soundData, assetID, assetType, out finalData); return; } } @@ -1078,18 +1078,18 @@ public void RemoveSoundFromSNDI(uint assetID) { if (a is AssetSNDI_GCN_V1 SNDI_G1) { - SNDI_G1.RemoveEntry(assetID, GetFromAssetID(assetID).AHDR.assetType); - break; + if (SNDI_G1.HasReference(assetID)) + SNDI_G1.RemoveEntry(assetID, GetFromAssetID(assetID).AHDR.assetType); } else if (a is AssetSNDI_XBOX SNDI_X) { - SNDI_X.RemoveEntry(assetID, GetFromAssetID(assetID).AHDR.assetType); - break; + if (SNDI_X.HasReference(assetID)) + SNDI_X.RemoveEntry(assetID, GetFromAssetID(assetID).AHDR.assetType); } else if (a is AssetSNDI_PS2 SNDI_P) { - SNDI_P.RemoveEntry(assetID, GetFromAssetID(assetID).AHDR.assetType); - break; + if (SNDI_P.HasReference(assetID)) + SNDI_P.RemoveEntry(assetID, GetFromAssetID(assetID).AHDR.assetType); } } } @@ -1099,11 +1099,20 @@ public byte[] GetHeaderFromSNDI(uint assetID) foreach (Asset a in assetDictionary.Values) { if (a is AssetSNDI_GCN_V1 SNDI_G1) - return SNDI_G1.GetHeader(assetID, GetFromAssetID(assetID).AHDR.assetType); + { + if (SNDI_G1.HasReference(assetID)) + return SNDI_G1.GetHeader(assetID, GetFromAssetID(assetID).AHDR.assetType); + } else if (a is AssetSNDI_XBOX SNDI_X) - return SNDI_X.GetHeader(assetID, GetFromAssetID(assetID).AHDR.assetType); + { + if (SNDI_X.HasReference(assetID)) + return SNDI_X.GetHeader(assetID, GetFromAssetID(assetID).AHDR.assetType); + } else if (a is AssetSNDI_PS2 SNDI_P) - return SNDI_P.GetHeader(assetID, GetFromAssetID(assetID).AHDR.assetType); + { + if (SNDI_P.HasReference(assetID)) + return SNDI_P.GetHeader(assetID, GetFromAssetID(assetID).AHDR.assetType); + } } throw new Exception("Error: could not find SNDI asset in this archive."); diff --git a/IndustrialPark/ArchiveEditor/AssetEditor/AddAssetDialog.cs b/IndustrialPark/ArchiveEditor/AssetEditor/AddAssetDialog.cs index 3bf9856e..56c25a79 100644 --- a/IndustrialPark/ArchiveEditor/AssetEditor/AddAssetDialog.cs +++ b/IndustrialPark/ArchiveEditor/AssetEditor/AddAssetDialog.cs @@ -53,23 +53,6 @@ public AddAssetDialog(Section_AHDR AHDR) VerifyTemplate(); } - private string GetMiscSettingsString(byte[] MiscSettings) - { - if (MiscSettings.Length == 0) return ""; - - string output = String.Format("{0, 2:X2}", MiscSettings[0]) + String.Format("{0, 2:X2}", MiscSettings[1]) - + String.Format("{0, 2:X2}", MiscSettings[2]) + String.Format("{0, 2:X2}", MiscSettings[3]); - - for (int i = 4; i < MiscSettings.Length; i += 4) - { - output += " " + - String.Format("{0, 2:X2}", MiscSettings[i]) + String.Format("{0, 2:X2}", MiscSettings[i + 1]) + - String.Format("{0, 2:X2}", MiscSettings[i + 2]) + String.Format("{0, 2:X2}", MiscSettings[i + 3]); - } - - return output; - } - public static Section_AHDR GetAsset(AddAssetDialog a, out bool success) { DialogResult d = a.ShowDialog(); diff --git a/IndustrialPark/ArchiveEditor/AssetEditor/InternalSoundEditor.cs b/IndustrialPark/ArchiveEditor/AssetEditor/InternalSoundEditor.cs index c4e33c84..d5680380 100644 --- a/IndustrialPark/ArchiveEditor/AssetEditor/InternalSoundEditor.cs +++ b/IndustrialPark/ArchiveEditor/AssetEditor/InternalSoundEditor.cs @@ -46,7 +46,7 @@ private void button1_Click(object sender, EventArgs e) { try { - archive.AddSoundToSNDI(file, asset.AHDR.assetID, out byte[] soundData); + archive.AddSoundToSNDI(file, asset.AHDR.assetID, asset.AHDR.assetType, out byte[] soundData); asset.AHDR.data = soundData; } catch (Exception ex) diff --git a/IndustrialPark/Assets/Binary/AssetALST.cs b/IndustrialPark/Assets/Binary/AssetALST.cs index 9d0052bc..919d56fd 100644 --- a/IndustrialPark/Assets/Binary/AssetALST.cs +++ b/IndustrialPark/Assets/Binary/AssetALST.cs @@ -3,6 +3,7 @@ using System; using System.Linq; using static HipHopFile.Functions; +using System.ComponentModel; namespace IndustrialPark { @@ -19,6 +20,7 @@ public override bool HasReference(uint assetID) return base.HasReference(assetID); } + [Category("Animation List")] public AssetID[] ANIM_AssetIDs { get diff --git a/IndustrialPark/Assets/Binary/AssetANIM.cs b/IndustrialPark/Assets/Binary/AssetANIM.cs index 06b04da7..5c7229a5 100644 --- a/IndustrialPark/Assets/Binary/AssetANIM.cs +++ b/IndustrialPark/Assets/Binary/AssetANIM.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using HipHopFile; using static IndustrialPark.ConverterFunctions; @@ -22,42 +23,49 @@ public class AssetANIM : Asset { public AssetANIM(Section_AHDR AHDR) : base(AHDR) { } + [Category("Animation")] public int Unknown_04 { get => ReadInt(0x04); set => Write(0x04, value); } + [Category("Animation")] public short NumBones { get => ReadShort(0x08); set => Write(0x08, value); } + [Category("Animation")] public short NumFrames { get => ReadShort(0x0A); set => Write(0x0A, value); } + [Category("Animation")] public int NumKeyFrames { get => ReadInt(0xC); set => Write(0xC, value); } + [Category("Animation")] public int Unknown10 { get => ReadInt(0x10); set => Write(0x10, value); } + [Category("Animation")] public int Unknown14 { get => ReadInt(0x14); set => Write(0x14, value); } + [Category("Animation")] public int Unknown18 { get => ReadInt(0x18); @@ -66,6 +74,7 @@ public int Unknown18 private int KeyFramesSectionStart { get => 0x1C; } + [Category("Animation")] public KeyFrame[] KeyFrames { get @@ -110,6 +119,7 @@ public KeyFrame[] KeyFrames private int TimeMapSectionStart { get => KeyFramesSectionStart + NumKeyFrames * 0x10; } + [Category("Animation")] public float[] TimeMap { get @@ -133,6 +143,7 @@ public float[] TimeMap private int KeyFrameMapSectionStart { get => TimeMapSectionStart + NumFrames * 4; } + [Category("Animation")] public short[][] KeyFrameMap { get diff --git a/IndustrialPark/Assets/Binary/AssetMAPR.cs b/IndustrialPark/Assets/Binary/AssetMAPR.cs index d0432b7a..d72a0f3d 100644 --- a/IndustrialPark/Assets/Binary/AssetMAPR.cs +++ b/IndustrialPark/Assets/Binary/AssetMAPR.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using HipHopFile; using static IndustrialPark.ConverterFunctions; @@ -38,12 +39,14 @@ public override bool HasReference(uint assetID) return base.HasReference(assetID); } + [Category("Material Map")] public AssetID AssetID { get => ReadUInt(0); set => Write(0, value); } + [Category("Material Map")] public EntryMAPR[] MAPR_Entries { get diff --git a/IndustrialPark/Assets/Binary/AssetPICK.cs b/IndustrialPark/Assets/Binary/AssetPICK.cs index e6c0859d..707c6469 100644 --- a/IndustrialPark/Assets/Binary/AssetPICK.cs +++ b/IndustrialPark/Assets/Binary/AssetPICK.cs @@ -62,6 +62,7 @@ public override bool HasReference(uint assetID) return base.HasReference(assetID); } + [Category("Pickup Table")] public EntryPICK[] PICK_Entries { get diff --git a/IndustrialPark/Assets/Binary/AssetPIPT.cs b/IndustrialPark/Assets/Binary/AssetPIPT.cs index 4749334c..86410a4f 100644 --- a/IndustrialPark/Assets/Binary/AssetPIPT.cs +++ b/IndustrialPark/Assets/Binary/AssetPIPT.cs @@ -47,6 +47,7 @@ public override bool HasReference(uint assetID) return base.HasReference(assetID); } + [Category("Pipe Table")] public EntryPIPT[] PIPT_Entries { get diff --git a/IndustrialPark/Assets/Binary/AssetSHDW.cs b/IndustrialPark/Assets/Binary/AssetSHDW.cs index 584450ea..6aef9bdc 100644 --- a/IndustrialPark/Assets/Binary/AssetSHDW.cs +++ b/IndustrialPark/Assets/Binary/AssetSHDW.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using HipHopFile; using static IndustrialPark.ConverterFunctions; @@ -42,6 +43,7 @@ public override bool HasReference(uint assetID) return base.HasReference(assetID); } + [Category("Shadow Map")] public EntrySHDW[] SHDW_Entries { get diff --git a/IndustrialPark/Assets/Binary/AssetSNDI_GCN_V1.cs b/IndustrialPark/Assets/Binary/AssetSNDI_GCN_V1.cs index 0134f257..04358443 100644 --- a/IndustrialPark/Assets/Binary/AssetSNDI_GCN_V1.cs +++ b/IndustrialPark/Assets/Binary/AssetSNDI_GCN_V1.cs @@ -97,6 +97,7 @@ private int Entries_SND_CIN_StartOffset get => Entries_SNDS_StartOffset + Entries_SNDS_amount * EntrySoundInfo_GCN_V1.StructSize; } + [Category("Sound Info")] public EntrySoundInfo_GCN_V1[] Entries_SND { get @@ -134,6 +135,7 @@ public EntrySoundInfo_GCN_V1[] Entries_SND } } + [Category("Sound Info")] public EntrySoundInfo_GCN_V1[] Entries_SNDS { get @@ -171,6 +173,7 @@ public EntrySoundInfo_GCN_V1[] Entries_SNDS } } + [Category("Sound Info")] public EntrySoundInfo_GCN_V1[] Entries_Sound_CIN { get diff --git a/IndustrialPark/Assets/Binary/AssetSNDI_PS2.cs b/IndustrialPark/Assets/Binary/AssetSNDI_PS2.cs index 6d665f04..7fcd3934 100644 --- a/IndustrialPark/Assets/Binary/AssetSNDI_PS2.cs +++ b/IndustrialPark/Assets/Binary/AssetSNDI_PS2.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using HipHopFile; @@ -80,6 +81,7 @@ private int Entries_SNDS_StartOffset get => Entries_SND_StartOffset + Entries_SND_amount * EntrySoundInfo_PS2.StructSize; } + [Category("Sound Info")] public EntrySoundInfo_PS2[] Entries_SND { get @@ -108,6 +110,7 @@ public EntrySoundInfo_PS2[] Entries_SND } } + [Category("Sound Info")] public EntrySoundInfo_PS2[] Entries_SNDS { get diff --git a/IndustrialPark/Assets/Binary/AssetSNDI_XBOX.cs b/IndustrialPark/Assets/Binary/AssetSNDI_XBOX.cs index b8a341c1..cea35487 100644 --- a/IndustrialPark/Assets/Binary/AssetSNDI_XBOX.cs +++ b/IndustrialPark/Assets/Binary/AssetSNDI_XBOX.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using HipHopFile; @@ -134,6 +135,7 @@ private int Entries_SND_CIN_StartOffset get => Entries_SNDS_StartOffset + Entries_SNDS_amount * EntrySoundInfo_XBOX.StructSize; } + [Category("Sound Info")] public EntrySoundInfo_XBOX[] Entries_SND { get @@ -162,6 +164,7 @@ public EntrySoundInfo_XBOX[] Entries_SND } } + [Category("Sound Info")] public EntrySoundInfo_XBOX[] Entries_SNDS { get @@ -190,6 +193,7 @@ public EntrySoundInfo_XBOX[] Entries_SNDS } } + [Category("Sound Info")] public EntrySoundInfo_XBOX[] Entries_Sound_CIN { get diff --git a/IndustrialPark/Assets/ObjectAssets/AssetCNTR.cs b/IndustrialPark/Assets/ObjectAssets/AssetCNTR.cs index 6e85567f..a1c93446 100644 --- a/IndustrialPark/Assets/ObjectAssets/AssetCNTR.cs +++ b/IndustrialPark/Assets/ObjectAssets/AssetCNTR.cs @@ -1,4 +1,5 @@ using HipHopFile; +using System.ComponentModel; namespace IndustrialPark { @@ -11,12 +12,14 @@ protected override int EventStartOffset get => 0xC; } + [Category("Counter")] public short Count { get => ReadShort(0x8); set => Write(0x8, value); } + [Category("Counter")] public short Unknown { get => ReadShort(0xA); diff --git a/IndustrialPark/Assets/ObjectAssets/AssetCOND.cs b/IndustrialPark/Assets/ObjectAssets/AssetCOND.cs index 886e599b..4649bd21 100644 --- a/IndustrialPark/Assets/ObjectAssets/AssetCOND.cs +++ b/IndustrialPark/Assets/ObjectAssets/AssetCOND.cs @@ -1,4 +1,5 @@ using HipHopFile; +using System.ComponentModel; namespace IndustrialPark { @@ -53,24 +54,28 @@ protected override int EventStartOffset get => 0x18; } + [Category("Conditional")] public CONDVariable Conditional { get => (CONDVariable)ReadUInt(0xC); set => Write(0xC, (uint)value); } + [Category("Conditional")] public CONDOperation Operation { get => (CONDOperation)ReadInt(0x10); set => Write(0x10, (int)value); } + [Category("Conditional")] public int EvaluationAmount { get => ReadInt(0x8); set => Write(0x8, value); } + [Category("Conditional")] public AssetID AssetUnderEvaluation { get => ReadUInt(0x14); diff --git a/IndustrialPark/Assets/ObjectAssets/AssetENV.cs b/IndustrialPark/Assets/ObjectAssets/AssetENV.cs index 702ed8e8..31d2a7c7 100644 --- a/IndustrialPark/Assets/ObjectAssets/AssetENV.cs +++ b/IndustrialPark/Assets/ObjectAssets/AssetENV.cs @@ -1,5 +1,6 @@ using HipHopFile; using System; +using System.ComponentModel; namespace IndustrialPark { @@ -28,90 +29,105 @@ public override bool HasReference(uint assetID) return base.HasReference(assetID); } + [Category("Environment")] public AssetID JSP_AssetID { get => ReadUInt(0x8); set => Write(0x8, value); } + [Category("Environment")] public AssetID CAM_AssetID { get => ReadUInt(0xC); set => Write(0xC, value); } + [Category("Environment")] public int Unknown10 { get => ReadInt(0x10); set => Write(0x10, value); } + [Category("Environment")] public int Unknown14 { get => ReadInt(0x14); set => Write(0x14, value); } + [Category("Environment")] public int Unknown18 { get => ReadInt(0x18); set => Write(0x18, value); } + [Category("Environment")] public AssetID LKIT_AssetID_0 { get => ReadUInt(0x1C); set => Write(0x1C, value); } + [Category("Environment")] public AssetID LKIT_AssetID_1 { get => ReadUInt(0x20); set => Write(0x20, value); } + [Category("Environment")] public int Unknown24 { get => ReadInt(0x24); set => Write(0x24, value); } + [Category("Environment")] public int Unknown28 { get => ReadInt(0x28); set => Write(0x28, value); } + [Category("Environment")] public int Unknown2C { get => ReadInt(0x2C); set => Write(0x2C, value); } + [Category("Environment")] public int Unknown30 { get => ReadInt(0x30); set => Write(0x30, value); } + [Category("Environment")] public AssetID MAPR_AssetID { get => ReadUInt(0x34); set => Write(0x34, value); } + [Category("Environment")] public int Unknown38 { get => ReadInt(0x38); set => Write(0x38, value); } + [Category("Environment")] public int Unknown3C { get => ReadInt(0x3C); set => Write(0x3C, value); } + [Category("Environment")] public float UnknownFloat40 { get => BitConverter.ToSingle(AHDR.data, 0x40); diff --git a/IndustrialPark/Assets/ObjectAssets/AssetGRUP.cs b/IndustrialPark/Assets/ObjectAssets/AssetGRUP.cs index 81f96823..db176808 100644 --- a/IndustrialPark/Assets/ObjectAssets/AssetGRUP.cs +++ b/IndustrialPark/Assets/ObjectAssets/AssetGRUP.cs @@ -1,6 +1,7 @@ using HipHopFile; using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; namespace IndustrialPark @@ -30,12 +31,14 @@ public enum Delegation InOrder = 2 } + [Category("Group")] public Delegation ReceiveEventDelegation { get => (Delegation)ReadShort(0x0A); set => Write(0x0A, (short)value); } + [Category("Group")] public AssetID[] GroupItems { get diff --git a/IndustrialPark/Assets/ObjectAssets/AssetPORT.cs b/IndustrialPark/Assets/ObjectAssets/AssetPORT.cs index 32217359..d496224d 100644 --- a/IndustrialPark/Assets/ObjectAssets/AssetPORT.cs +++ b/IndustrialPark/Assets/ObjectAssets/AssetPORT.cs @@ -1,5 +1,6 @@ using HipHopFile; using System.Collections.Generic; +using System.ComponentModel; using static HipHopFile.Functions; namespace IndustrialPark @@ -23,24 +24,28 @@ protected override int EventStartOffset get => 0x18; } + [Category("Portal")] public AssetID Camera_Unknown { get => ReadUInt(0x8); set => Write(0x8, value); } + [Category("Portal")] public AssetID Destination_MRKR { get => ReadUInt(0xC); set => Write(0xC, value); } + [Category("Portal")] public float Rotation { get => ReadFloat(0x10); set => Write(0x10, value); } + [Category("Portal")] public string DestinationLevel { get diff --git a/IndustrialPark/Assets/ObjectAssets/AssetTIMR.cs b/IndustrialPark/Assets/ObjectAssets/AssetTIMR.cs index 62cb328c..8b87b0bb 100644 --- a/IndustrialPark/Assets/ObjectAssets/AssetTIMR.cs +++ b/IndustrialPark/Assets/ObjectAssets/AssetTIMR.cs @@ -1,5 +1,6 @@ using HipHopFile; using System; +using System.ComponentModel; namespace IndustrialPark { @@ -12,12 +13,14 @@ protected override int EventStartOffset get => 0x10; } + [Category("Timer")] public float Time { get => ReadFloat(0x8); set => Write(0x8, value); } + [Category("Timer")] public float Unknown { get => BitConverter.ToSingle(AHDR.data, 0xC); diff --git a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/AssetCAM.cs b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/AssetCAM.cs index e1e0792f..43e76569 100644 --- a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/AssetCAM.cs +++ b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/AssetCAM.cs @@ -107,7 +107,7 @@ public float GetDistance(Vector3 cameraPosition) } private Vector3 _position; - [TypeConverter(typeof(FloatTypeConverter))] + [Category("Camera"), TypeConverter(typeof(FloatTypeConverter))] public float PositionX { get { return _position.X; } @@ -119,7 +119,7 @@ public float PositionX } } - [TypeConverter(typeof(FloatTypeConverter))] + [Category("Camera"), TypeConverter(typeof(FloatTypeConverter))] public float PositionY { get { return _position.Y; } @@ -131,7 +131,7 @@ public float PositionY } } - [TypeConverter(typeof(FloatTypeConverter))] + [Category("Camera"), TypeConverter(typeof(FloatTypeConverter))] public float PositionZ { get { return _position.Z; } @@ -143,193 +143,199 @@ public float PositionZ } } - [TypeConverter(typeof(FloatTypeConverter))] + [Category("Camera"), TypeConverter(typeof(FloatTypeConverter))] public float NormalizedForwardX { get => ReadFloat(0x14); set => Write(0x14, value); } - [TypeConverter(typeof(FloatTypeConverter))] + [Category("Camera"), TypeConverter(typeof(FloatTypeConverter))] public float NormalizedForwardY { get => ReadFloat(0x18); set => Write(0x18, value); } - [TypeConverter(typeof(FloatTypeConverter))] + [Category("Camera"), TypeConverter(typeof(FloatTypeConverter))] public float NormalizedForwardZ { get => ReadFloat(0x1C); set => Write(0x1C, value); } - [TypeConverter(typeof(FloatTypeConverter))] + [Category("Camera"), TypeConverter(typeof(FloatTypeConverter))] public float NormalizedUpX { get => ReadFloat(0x20); set => Write(0x20, value); } - [TypeConverter(typeof(FloatTypeConverter))] + [Category("Camera"), TypeConverter(typeof(FloatTypeConverter))] public float NormalizedUpY { get => ReadFloat(0x24); set => Write(0x24, value); } - [TypeConverter(typeof(FloatTypeConverter))] + [Category("Camera"), TypeConverter(typeof(FloatTypeConverter))] public float NormalizedUpZ { get => ReadFloat(0x28); set => Write(0x28, value); } - [TypeConverter(typeof(FloatTypeConverter))] + [Category("Camera"), TypeConverter(typeof(FloatTypeConverter))] public float Float2C { get => ReadFloat(0x2C); set => Write(0x2C, value); } - [TypeConverter(typeof(HexIntTypeConverter))] + [Category("Camera"), TypeConverter(typeof(HexIntTypeConverter))] public int UnknownValue30 { get => ReadInt(0x30); set => Write(0x30, value); } - [TypeConverter(typeof(HexIntTypeConverter))] + [Category("Camera"), TypeConverter(typeof(HexIntTypeConverter))] public int UnknownValue34 { get => ReadInt(0x34); set => Write(0x34, value); } + [Category("Camera")] public int UnknownValue38 { get => ReadInt(0x38); set => Write(0x38, value); } + [Category("Camera")] public int UnknownValue3C { get => ReadInt(0x3C); set => Write(0x3C, value); } + [Category("Camera")] public int UnknownValue40 { get => ReadInt(0x40); set => Write(0x40, value); } + [Category("Camera")] public short UnknownShort44 { get => ReadShort(0x44); set => Write(0x44, value); } + [Category("Camera")] public short UnknownShort46 { get => ReadShort(0x46); set => Write(0x46, value); } - [TypeConverter(typeof(FloatTypeConverter))] + [Category("Camera"), TypeConverter(typeof(FloatTypeConverter))] public float CameraSpeed { get => ReadFloat(0x48); set => Write(0x48, value); } - [TypeConverter(typeof(FloatTypeConverter))] + [Category("Camera"), TypeConverter(typeof(FloatTypeConverter))] public float Float4C { get => ReadFloat(0x4C); set => Write(0x4C, value); } + [Category("Camera")] public int UnknownValue50 { get => ReadInt(0x50); set => Write(0x50, value); } - [TypeConverter(typeof(FloatTypeConverter))] + [Category("Camera"), TypeConverter(typeof(FloatTypeConverter))] public float UnknownFloat54 { get => ReadFloat(0x54); set => Write(0x54, value); } - [TypeConverter(typeof(FloatTypeConverter))] + [Category("Camera"), TypeConverter(typeof(FloatTypeConverter))] public float UnknownFloat58 { get => ReadFloat(0x58); set => Write(0x58, value); } - [TypeConverter(typeof(FloatTypeConverter))] + [Category("Camera"), TypeConverter(typeof(FloatTypeConverter))] public float UnknownFloat5C { get => ReadFloat(0x5C); set => Write(0x5C, value); } - [TypeConverter(typeof(FloatTypeConverter))] + [Category("Camera"), TypeConverter(typeof(FloatTypeConverter))] public float UnknownFloat60 { get => ReadFloat(0x60); set => Write(0x60, value); } - [TypeConverter(typeof(FloatTypeConverter))] + [Category("Camera"), TypeConverter(typeof(FloatTypeConverter))] public float UnknownFloat64 { get => ReadFloat(0x64); set => Write(0x64, value); } - [TypeConverter(typeof(FloatTypeConverter))] + [Category("Camera"), TypeConverter(typeof(FloatTypeConverter))] public float UnknownFloat68 { get => ReadFloat(0x68); set => Write(0x68, value); } - [TypeConverter(typeof(FloatTypeConverter))] + [Category("Camera"), TypeConverter(typeof(FloatTypeConverter))] public float UnknownFloat6C { get => ReadFloat(0x6C); set => Write(0x6C, value); } - [TypeConverter(typeof(FloatTypeConverter))] + [Category("Camera"), TypeConverter(typeof(FloatTypeConverter))] public float UnknownFloat70 { get => ReadFloat(0x70); set => Write(0x70, value); } - [TypeConverter(typeof(FloatTypeConverter))] + [Category("Camera"), TypeConverter(typeof(FloatTypeConverter))] public float UnknownFloat74 { get => ReadFloat(0x74); set => Write(0x74, value); } - [TypeConverter(typeof(HexByteTypeConverter))] + [Category("Camera"), TypeConverter(typeof(HexByteTypeConverter))] public byte Flags1 { get => ReadByte(0x78); set => Write(0x78, value); } - [TypeConverter(typeof(HexByteTypeConverter))] + [Category("Camera"), TypeConverter(typeof(HexByteTypeConverter))] public byte Flags2 { get => ReadByte(0x79); set => Write(0x79, value); } - [TypeConverter(typeof(HexByteTypeConverter))] + [Category("Camera"), TypeConverter(typeof(HexByteTypeConverter))] public byte Flags3 { get => ReadByte(0x7A); set => Write(0x7A, value); } - [TypeConverter(typeof(HexByteTypeConverter))] + [Category("Camera"), TypeConverter(typeof(HexByteTypeConverter))] public byte Flags4 { get => ReadByte(0x7B); set => Write(0x7B, value); } - [TypeConverter(typeof(HexIntTypeConverter))] + [Category("Camera"), TypeConverter(typeof(HexIntTypeConverter))] public int UnknownValue7C { get => ReadInt(0x7C); set => Write(0x7C, value); } - [TypeConverter(typeof(HexIntTypeConverter))] + [Category("Camera"), TypeConverter(typeof(HexIntTypeConverter))] public int UnknownValue80 { get => ReadInt(0x80); set => Write(0x80, value); } - [TypeConverter(typeof(HexIntTypeConverter))] + [Category("Camera"), TypeConverter(typeof(HexIntTypeConverter))] public int UnknownValue84 { get => ReadInt(0x84); diff --git a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/AssetMRKR.cs b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/AssetMRKR.cs index 19c18b7f..70c999ed 100644 --- a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/AssetMRKR.cs +++ b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/AssetMRKR.cs @@ -102,6 +102,9 @@ public float GetDistance(Vector3 cameraPosition) } private Vector3 _position; + + [Category("Marker")] + [TypeConverter(typeof(FloatTypeConverter))] public float PositionX { get { return _position.X; } @@ -113,6 +116,8 @@ public float PositionX } } + [Category("Marker")] + [TypeConverter(typeof(FloatTypeConverter))] public float PositionY { get { return _position.Y; } @@ -124,6 +129,8 @@ public float PositionY } } + [Category("Marker")] + [TypeConverter(typeof(FloatTypeConverter))] public float PositionZ { get { return _position.Z; } diff --git a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/AssetMVPT.cs b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/AssetMVPT.cs index d457b4df..cbf3a5c6 100644 --- a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/AssetMVPT.cs +++ b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/AssetMVPT.cs @@ -136,6 +136,7 @@ public float GetDistance(Vector3 cameraPosition) } private Vector3 _position; + [Category("Move Point")] public float PositionX { get { return _position.X; } @@ -147,6 +148,7 @@ public float PositionX } } + [Category("Move Point")] public float PositionY { get { return _position.Y; } @@ -158,6 +160,7 @@ public float PositionY } } + [Category("Move Point")] public float PositionZ { get { return _position.Z; } @@ -169,6 +172,7 @@ public float PositionZ } } + [Category("Move Point")] [TypeConverter(typeof(HexByteTypeConverter))] public byte UnknownByte14 { @@ -176,6 +180,7 @@ public byte UnknownByte14 set => Write(0x14, value); } + [Category("Move Point")] [TypeConverter(typeof(HexByteTypeConverter))] public byte UnknownByte15 { @@ -183,6 +188,7 @@ public byte UnknownByte15 set => Write(0x15, value); } + [Category("Move Point")] [TypeConverter(typeof(HexByteTypeConverter))] public byte UnknownByte16 { @@ -190,6 +196,7 @@ public byte UnknownByte16 set => Write(0x16, value); } + [Category("Move Point")] [TypeConverter(typeof(HexByteTypeConverter))] public byte PointType { @@ -197,6 +204,7 @@ public byte PointType set => Write(0x17, value); } + [Category("Move Point")] [ReadOnly(true)] public int SiblingAmount { @@ -204,12 +212,14 @@ public int SiblingAmount set => Write(0x18, value); } + [Category("Move Point")] public float MovementAngle { get => ReadFloat(0x1C); set => Write(0x1C, value); } + [Category("Move Point")] public float MovementRadius { get => ReadFloat(0x20); @@ -217,6 +227,7 @@ public float MovementRadius } private float _distanceICanSeeYou; + [Category("Move Point")] public float DistanceICanSeeYou { get => _distanceICanSeeYou; @@ -228,6 +239,7 @@ public float DistanceICanSeeYou } } + [Category("Move Point")] public AssetID[] SiblingMVPTs { get diff --git a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/AssetSFX.cs b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/AssetSFX.cs index 511dafec..b4c68e2a 100644 --- a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/AssetSFX.cs +++ b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/AssetSFX.cs @@ -117,6 +117,7 @@ public float GetDistance(Vector3 cameraPosition) return Vector3.Distance(cameraPosition, _position) - _radius; } + [Category("Sound Effect")] [TypeConverter(typeof(HexByteTypeConverter))] public byte Flag08 { @@ -124,6 +125,7 @@ public byte Flag08 set => Write(0x8, value); } + [Category("Sound Effect")] [TypeConverter(typeof(HexByteTypeConverter))] public byte Flag09 { @@ -131,6 +133,7 @@ public byte Flag09 set => Write(0x9, value); } + [Category("Sound Effect")] [TypeConverter(typeof(HexByteTypeConverter))] public byte Flag0A { @@ -138,6 +141,7 @@ public byte Flag0A set => Write(0xA, value); } + [Category("Sound Effect")] [TypeConverter(typeof(HexByteTypeConverter))] public byte Flag0B { @@ -145,24 +149,28 @@ public byte Flag0B set => Write(0xA, value); } + [Category("Sound Effect")] public float UnknownFloat0C { get => ReadFloat(0xC); set => Write(0xC, value); } + [Category("Sound Effect")] public AssetID SoundAssetID { get => ReadUInt(0x10); set => Write(0x10, value); } + [Category("Sound Effect")] public float UnknownFloat14 { get => ReadFloat(0x14); set => Write(0x14, value); } + [Category("Sound Effect")] public int UnknownInt18 { get => ReadInt(0x18); @@ -170,6 +178,7 @@ public int UnknownInt18 } private Vector3 _position; + [Category("Sound Effect")] public float PositionX { get { return _position.X; } @@ -181,6 +190,7 @@ public float PositionX } } + [Category("Sound Effect")] public float PositionY { get { return _position.Y; } @@ -192,6 +202,7 @@ public float PositionY } } + [Category("Sound Effect")] public float PositionZ { get { return _position.Z; } @@ -204,6 +215,7 @@ public float PositionZ } private float _radius; + [Category("Sound Effect")] public float RadiusMin { get => _radius; @@ -216,6 +228,7 @@ public float RadiusMin } private float _radius2; + [Category("Sound Effect")] public float RadiusMax { get => _radius2; diff --git a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetBUTN.cs b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetBUTN.cs index 31436655..00bba6fc 100644 --- a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetBUTN.cs +++ b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetBUTN.cs @@ -70,430 +70,228 @@ private uint HitMask set => Write(0x68 + Offset, value); } - private uint Mask(uint bit) - { - return (uint)Math.Pow(2, bit); - } - - private uint InvMask(uint bit) - { - return uint.MaxValue - Mask(bit); - } - [Category("Button Hitmask")] public bool BubbleSpin { get => (HitMask & Mask(0)) != 0; - set - { - if (value) - HitMask = HitMask | Mask(0); - else - HitMask = HitMask & InvMask(0); - } + set => HitMask = value ? (HitMask | Mask(0)) : (HitMask & InvMask(0)); } [Category("Button Hitmask")] public bool BubbleBounce { get => (HitMask & Mask(1)) != 0; - set - { - if (value) - HitMask = HitMask | Mask(1); - else - HitMask = HitMask & InvMask(1); - } + set => HitMask = value ? (HitMask | Mask(1)) : (HitMask & InvMask(1)); } [Category("Button Hitmask")] public bool BubbleBash { get => (HitMask & Mask(2)) != 0; - set - { - if (value) - HitMask = HitMask | Mask(2); - else - HitMask = HitMask & InvMask(2); - } + set => HitMask = value ? (HitMask | Mask(2)) : (HitMask & InvMask(2)); } [Category("Button Hitmask")] public bool BubbleBowl { get => (HitMask & Mask(3)) != 0; - set - { - if (value) - HitMask = HitMask | Mask(3); - else - HitMask = HitMask & InvMask(3); - } + set => HitMask = value ? (HitMask | Mask(3)) : (HitMask & InvMask(3)); } [Category("Button Hitmask")] public bool CruiseBubble { get => (HitMask & Mask(4)) != 0; - set - { - if (value) - HitMask = HitMask | Mask(4); - else - HitMask = HitMask & InvMask(4); - } + set => HitMask = value ? (HitMask | Mask(4)) : (HitMask & InvMask(4)); } [Category("Button Hitmask")] public bool HitMask5 { get => (HitMask & Mask(5)) != 0; - set - { - if (value) - HitMask = HitMask | Mask(5); - else - HitMask = HitMask & InvMask(5); - } + set => HitMask = value ? (HitMask | Mask(5)) : (HitMask & InvMask(5)); } [Category("Button Hitmask")] public bool HitMask6 { get => (HitMask & Mask(6)) != 0; - set - { - if (value) - HitMask = HitMask | Mask(6); - else - HitMask = HitMask & InvMask(6); - } + set => HitMask = value ? (HitMask | Mask(6)) : (HitMask & InvMask(6)); } [Category("Button Hitmask")] public bool Throwable { get => (HitMask & Mask(7)) != 0; - set - { - if (value) - HitMask = HitMask | Mask(7); - else - HitMask = HitMask & InvMask(7); - } + set => HitMask = value ? (HitMask | Mask(7)) : (HitMask & InvMask(7)); } [Category("Button Hitmask")] public bool PatrickSlam { get => (HitMask & Mask(8)) != 0; - set - { - if (value) - HitMask = HitMask | Mask(8); - else - HitMask = HitMask & InvMask(8); - } + set => HitMask = value ? (HitMask | Mask(8)) : (HitMask & InvMask(8)); } [Category("Button Hitmask")] public bool HitMask9 { get => (HitMask & Mask(9)) != 0; - set - { - if (value) - HitMask = HitMask | Mask(9); - else - HitMask = HitMask & InvMask(9); - } + set => HitMask = value ? (HitMask | Mask(9)) : (HitMask & InvMask(9)); } [Category("Button Hitmask")] public bool PlayerOnPressurePlate { get => (HitMask & Mask(10)) != 0; - set - { - if (value) - HitMask = HitMask | Mask(10); - else - HitMask = HitMask & InvMask(10); - } + set => HitMask = value ? (HitMask | Mask(10)) : (HitMask & InvMask(10)); } [Category("Button Hitmask")] public bool HitMask11 { get => (HitMask & Mask(11)) != 0; - set - { - if (value) - HitMask = HitMask | Mask(11); - else - HitMask = HitMask & InvMask(11); - } + set => HitMask = value ? (HitMask | Mask(11)) : (HitMask & InvMask(11)); } [Category("Button Hitmask")] public bool BubbleBowlOnPressurePlate { get => (HitMask & Mask(12)) != 0; - set - { - if (value) - HitMask = HitMask | Mask(12); - else - HitMask = HitMask & InvMask(12); - } + set => HitMask = value ? (HitMask | Mask(12)) : (HitMask & InvMask(12)); } [Category("Button Hitmask")] public bool AnyThrowableOnPressurePlate { get => (HitMask & Mask(13)) != 0; - set - { - if (value) - HitMask = HitMask | Mask(13); - else - HitMask = HitMask & InvMask(13); - } + set => HitMask = value ? (HitMask | Mask(13)) : (HitMask & InvMask(13)); } [Category("Button Hitmask")] public bool SandyMelee { get => (HitMask & Mask(14)) != 0; - set - { - if (value) - HitMask = HitMask | Mask(14); - else - HitMask = HitMask & InvMask(14); - } + set => HitMask = value ? (HitMask | Mask(14)) : (HitMask & InvMask(14)); } [Category("Button Hitmask")] public bool PatrickBelly { get => (HitMask & Mask(15)) != 0; - set - { - if (value) - HitMask = HitMask | Mask(15); - else - HitMask = HitMask & InvMask(15); - } + set => HitMask = value ? (HitMask | Mask(15)) : (HitMask & InvMask(15)); } [Category("Button Hitmask")] public bool ThrowFruitOnPressurePlate { get => (HitMask & Mask(16)) != 0; - set - { - if (value) - HitMask = HitMask | Mask(16); - else - HitMask = HitMask & InvMask(16); - } + set => HitMask = value ? (HitMask | Mask(16)) : (HitMask & InvMask(16)); } [Category("Button Hitmask")] public bool HitMask17 { get => (HitMask & Mask(17)) != 0; - set - { - if (value) - HitMask = HitMask | Mask(17); - else - HitMask = HitMask & InvMask(17); - } + set => HitMask = value ? (HitMask | Mask(17)) : (HitMask & InvMask(17)); } [Category("Button Hitmask")] public bool HitMask18 { get => (HitMask & Mask(18)) != 0; - set - { - if (value) - HitMask = HitMask | Mask(18); - else - HitMask = HitMask & InvMask(18); - } + set => HitMask = value ? (HitMask | Mask(18)) : (HitMask & InvMask(18)); } [Category("Button Hitmask")] public bool HitMask19 { get => (HitMask & Mask(19)) != 0; - set - { - if (value) - HitMask = HitMask | Mask(19); - else - HitMask = HitMask & InvMask(19); - } + set => HitMask = value ? (HitMask | Mask(19)) : (HitMask & InvMask(19)); } [Category("Button Hitmask")] public bool HitMask20 { get => (HitMask & Mask(20)) != 0; - set - { - if (value) - HitMask = HitMask | Mask(20); - else - HitMask = HitMask & InvMask(20); - } + set => HitMask = value ? (HitMask | Mask(20)) : (HitMask & InvMask(20)); } [Category("Button Hitmask")] public bool HitMask21 { get => (HitMask & Mask(21)) != 0; - set - { - if (value) - HitMask = HitMask | Mask(21); - else - HitMask = HitMask & InvMask(21); - } + set => HitMask = value ? (HitMask | Mask(21)) : (HitMask & InvMask(21)); } [Category("Button Hitmask")] public bool HitMask22 { get => (HitMask & Mask(22)) != 0; - set - { - if (value) - HitMask = HitMask | Mask(22); - else - HitMask = HitMask & InvMask(22); - } + set => HitMask = value ? (HitMask | Mask(22)) : (HitMask & InvMask(22)); } [Category("Button Hitmask")] public bool HitMask23 { get => (HitMask & Mask(23)) != 0; - set - { - if (value) - HitMask = HitMask | Mask(23); - else - HitMask = HitMask & InvMask(23); - } + set => HitMask = value ? (HitMask | Mask(23)) : (HitMask & InvMask(23)); } [Category("Button Hitmask")] public bool HitMask24 { get => (HitMask & Mask(24)) != 0; - set - { - if (value) - HitMask = HitMask | Mask(24); - else - HitMask = HitMask & InvMask(24); - } + set => HitMask = value ? (HitMask | Mask(24)) : (HitMask & InvMask(24)); } [Category("Button Hitmask")] public bool HitMask25 { get => (HitMask & Mask(25)) != 0; - set - { - if (value) - HitMask = HitMask | Mask(25); - else - HitMask = HitMask & InvMask(25); - } + set => HitMask = value ? (HitMask | Mask(25)) : (HitMask & InvMask(25)); } [Category("Button Hitmask")] public bool HitMask26 { get => (HitMask & Mask(26)) != 0; - set - { - if (value) - HitMask = HitMask | Mask(26); - else - HitMask = HitMask & InvMask(26); - } + set => HitMask = value ? (HitMask | Mask(26)) : (HitMask & InvMask(26)); } [Category("Button Hitmask")] public bool HitMask27 { get => (HitMask & Mask(27)) != 0; - set - { - if (value) - HitMask = HitMask | Mask(27); - else - HitMask = HitMask & InvMask(27); - } + set => HitMask = value ? (HitMask | Mask(27)) : (HitMask & InvMask(27)); } [Category("Button Hitmask")] public bool HitMask28 { get => (HitMask & Mask(28)) != 0; - set - { - if (value) - HitMask = HitMask | Mask(28); - else - HitMask = HitMask & InvMask(28); - } + set => HitMask = value ? (HitMask | Mask(28)) : (HitMask & InvMask(28)); } [Category("Button Hitmask")] public bool HitMask29 { get => (HitMask & Mask(29)) != 0; - set - { - if (value) - HitMask = HitMask | Mask(29); - else - HitMask = HitMask & InvMask(29); - } + set => HitMask = value ? (HitMask | Mask(29)) : (HitMask & InvMask(29)); } [Category("Button Hitmask")] public bool HitMask30 { get => (HitMask & Mask(30)) != 0; - set - { - if (value) - HitMask = HitMask | Mask(30); - else - HitMask = HitMask & InvMask(30); - } + set => HitMask = value ? (HitMask | Mask(30)) : (HitMask & InvMask(30)); } [Category("Button Hitmask")] public bool HitMask31 { get => (HitMask & Mask(31)) != 0; - set - { - if (value) - HitMask = HitMask | Mask(31); - else - HitMask = HitMask & InvMask(31); - } + set => HitMask = value ? (HitMask | Mask(31)) : (HitMask & InvMask(31)); } [Category("Button")] diff --git a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetPKUP.cs b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetPKUP.cs index 3118994e..dccc0493 100644 --- a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetPKUP.cs +++ b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetPKUP.cs @@ -89,6 +89,7 @@ public override void Draw(SharpRenderer renderer) } [TypeConverter(typeof(HexByteTypeConverter))] + [Category("Pickup")] public byte Shape { get => ReadByte(0x09); @@ -96,6 +97,7 @@ public byte Shape } private uint _pickEntryID; + [Category("Pickup")] public AssetID PickReferenceID { get => _pickEntryID; @@ -106,12 +108,14 @@ public AssetID PickReferenceID } } + [Category("Pickup")] public short Unknown1 { get => ReadShort(0x58 + Offset); set => Write(0x58 + Offset, value); } + [Category("Pickup")] public short Unknown2 { get => ReadShort(0x5C + Offset); diff --git a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetPLYR.cs b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetPLYR.cs index 5d64a454..c521a6b7 100644 --- a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetPLYR.cs +++ b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetPLYR.cs @@ -2,6 +2,7 @@ using IndustrialPark.Models; using SharpDX; using System.Collections.Generic; +using System.ComponentModel; namespace IndustrialPark { @@ -74,6 +75,7 @@ public override void Draw(SharpRenderer renderer) renderer.DrawPyramid(world, isSelected, 1f); } + [Category("Player References")] public AssetID LightKitID { get => ReadUInt(EventStartOffset + AmountOfEvents * AssetEvent.sizeOfStruct); diff --git a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetVIL.cs b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetVIL.cs index 2737023c..99b30c86 100644 --- a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetVIL.cs +++ b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetVIL.cs @@ -1,4 +1,5 @@ using HipHopFile; +using System.ComponentModel; namespace IndustrialPark { @@ -28,36 +29,42 @@ public override bool HasReference(uint assetID) return base.HasReference(assetID); } + [Category("VIL")] public int Unknown54 { get => ReadInt(0x54 + Offset); set => Write(0x54 + Offset, value); } + [Category("VIL")] public VilType VilType { get => (VilType)ReadUInt(0x58 + Offset); set => Write(0x58 + Offset, (uint)value); } + [Category("VIL")] public AssetID AssetID_DYNA_NPCSettings { get => ReadUInt(0x5C + Offset); set => Write(0x5C + Offset, value); } + [Category("VIL")] public AssetID AssetID_MVPT { get => ReadUInt(0x60 + Offset); set => Write(0x60 + Offset, value); } + [Category("VIL")] public AssetID AssetID_DYNA_1 { get => ReadUInt(0x64 + Offset); set => Write(0x64 + Offset, value); } + [Category("VIL")] public AssetID AssetID_DYNA_2 { get => ReadUInt(0x68 + Offset); diff --git a/IndustrialPark/Assets/Shared/Asset.cs b/IndustrialPark/Assets/Shared/Asset.cs index 70715306..d98fd00f 100644 --- a/IndustrialPark/Assets/Shared/Asset.cs +++ b/IndustrialPark/Assets/Shared/Asset.cs @@ -153,6 +153,16 @@ protected void Write(int j, uint value) AHDR.data[j + i] = split[i]; } + protected static uint Mask(uint bit) + { + return (uint)Math.Pow(2, bit); + } + + protected static uint InvMask(uint bit) + { + return uint.MaxValue - Mask(bit); + } + public virtual bool HasReference(uint assetID) => false; } } \ No newline at end of file diff --git a/IndustrialPark/Assets/Shared/ObjectAsset.cs b/IndustrialPark/Assets/Shared/ObjectAsset.cs index 9138367c..52d64f6c 100644 --- a/IndustrialPark/Assets/Shared/ObjectAsset.cs +++ b/IndustrialPark/Assets/Shared/ObjectAsset.cs @@ -41,69 +41,40 @@ public short Flags set => Write(0x6, value); } + [Category("Object Base")] public bool EnabledOnStart { - get => (Flags & 0x01) != 0; - set - { - if (value) - Flags = (short)(Flags | 0x01); - else - Flags = (short)(Flags & (0xFF - 0x01)); - } + get => (Flags & Mask(0)) != 0; + set => Flags = (short)(value ? (Flags | (short)Mask(0)) : (Flags & (short)InvMask(0))); } [Category("Object Base")] public bool StateIsPersistent { - get => (Flags & 0x02) != 0; - set - { - if (value) - Flags = (short)(Flags | 0x02); - else - Flags = (short)(Flags & (0xFF - 0x02)); - } + get => (Flags & Mask(1)) != 0; + set => Flags = (short)(value ? (Flags | (short)Mask(1)) : (Flags & (short)InvMask(1))); } [Category("Object Base")] - public bool UnknownAlways1 + public bool UnknownAlwaysTrue { - get => (Flags & 0x04) != 0; - set - { - if (value) - Flags = (short)(Flags | 0x04); - else - Flags = (short)(Flags & (0xFF - 0x04)); - } + get => (Flags & Mask(2)) != 0; + set => Flags = (short)(value ? (Flags | (short)Mask(2)) : (Flags & (short)InvMask(2))); } [Category("Object Base")] public bool VisibleDuringCutscenes { - get => (Flags & 0x08) != 0; - set - { - if (value) - Flags = (short)(Flags | 0x08); - else - Flags = (short)(Flags & (0xFF - 0x08)); - } + get => (Flags & Mask(3)) != 0; + set => Flags = (short)(value ? (Flags | (short)Mask(3)) : (Flags & (short)InvMask(3))); } [Category("Object Base")] public bool ReceiveShadows { - get => (Flags & 0x10) != 0; - set - { - if (value) - Flags = (short)(Flags | 0x10); - else - Flags = (short)(Flags & (0xFF - 0x10)); - } + get => (Flags & Mask(4)) != 0; + set => Flags = (short)(value ? (Flags | (short)Mask(4)) : (Flags & (short)InvMask(4))); } [Category("Object Base")] diff --git a/IndustrialPark/Assets/Shared/PlaceableAsset.cs b/IndustrialPark/Assets/Shared/PlaceableAsset.cs index a500db16..025366b9 100644 --- a/IndustrialPark/Assets/Shared/PlaceableAsset.cs +++ b/IndustrialPark/Assets/Shared/PlaceableAsset.cs @@ -148,6 +148,20 @@ public byte VisibilityFlag set { Write(0x8, value); } } + [Category("Placement Flags")] + public bool Visible + { + get => (VisibilityFlag & Mask(0)) != 0; + set => VisibilityFlag = (byte)(value ? (VisibilityFlag | Mask(0)) : (VisibilityFlag & InvMask(0))); + } + + [Category("Placement Flags")] + public bool UseGravity + { + get => (VisibilityFlag & Mask(1)) != 0; + set => VisibilityFlag = (byte)(value ? (VisibilityFlag | Mask(1)) : (VisibilityFlag & InvMask(1))); + } + [Category("Placement Flags"), ReadOnly(true), TypeConverter(typeof(HexByteTypeConverter))] public byte TypeFlag { @@ -169,6 +183,13 @@ public byte SolidityFlag set { Write(0xB, value); } } + [Category("Placement Flags")] + public bool PreciseCollision + { + get => (SolidityFlag & Mask(1)) != 0; + set => SolidityFlag = (byte)(value ? (VisibilityFlag | Mask(1)) : (VisibilityFlag & InvMask(1))); + } + [Category("Placement")] public int UnknownIntC { diff --git a/IndustrialPark/Assets/WithModel/AssetMINF.cs b/IndustrialPark/Assets/WithModel/AssetMINF.cs index fff10c02..6ba44f8e 100644 --- a/IndustrialPark/Assets/WithModel/AssetMINF.cs +++ b/IndustrialPark/Assets/WithModel/AssetMINF.cs @@ -1,6 +1,7 @@ using HipHopFile; using SharpDX; using System; +using System.ComponentModel; namespace IndustrialPark { @@ -62,6 +63,7 @@ public bool HasRenderWareModelFile() } private uint _modelAssetID; + [Category("Model Info")] public AssetID ModelAssetID { get { return _modelAssetID; }