From d25784a029e656173759644a4c8acf4d75fd30d5 Mon Sep 17 00:00:00 2001 From: igorseabra4 Date: Wed, 28 Nov 2018 03:57:53 -0300 Subject: [PATCH] add SHRP, SURF, duplotron template --- .../ArchiveEditor/ArchiveEditor.Designer.cs | 29 +- IndustrialPark/ArchiveEditor/ArchiveEditor.cs | 34 ++ .../ArchiveEditor/ArchiveEditorFunctions.cs | 14 +- .../ArchiveEditorFunctions_AssetEditing.cs | 3 + .../ArchiveEditorFunctions_AssetTemplates.cs | 35 ++ .../InternalShrapnelEditor.Designer.cs | 178 +++++++ .../AssetEditor/InternalShrapnelEditor.cs | 84 ++++ .../AssetEditor/InternalShrapnelEditor.resx | 120 +++++ .../AssetTemplates/AssetTemplate.cs | 2 + IndustrialPark/Assets/Binary/AssetSHRP.cs | 433 ++++++++++++++++++ .../Assets/ObjectAssets/AssetCNTR.cs | 5 +- .../Assets/ObjectAssets/AssetCOND.cs | 5 +- .../Assets/ObjectAssets/AssetCSNM.cs | 5 +- .../Assets/ObjectAssets/AssetDPAT.cs | 5 +- .../Assets/ObjectAssets/AssetENV.cs | 5 +- .../Assets/ObjectAssets/AssetFOG.cs | 2 +- .../Assets/ObjectAssets/AssetGRUP.cs | 5 +- .../Assets/ObjectAssets/AssetPARE.cs | 9 +- .../Assets/ObjectAssets/AssetPARP.cs | 5 +- .../Assets/ObjectAssets/AssetPORT.cs | 5 +- .../Assets/ObjectAssets/AssetSURF.cs | 404 ++++++++++++++++ .../Assets/ObjectAssets/AssetTIMR.cs | 5 +- .../ObjectAssets/ClickableAssets/AssetCAM.cs | 5 +- .../ObjectAssets/ClickableAssets/AssetMVPT.cs | 5 +- .../ObjectAssets/ClickableAssets/AssetSFX.cs | 2 +- .../PlaceableAssets/AssetBOUL.cs | 4 +- .../PlaceableAssets/AssetBUTN.cs | 5 +- .../PlaceableAssets/AssetDSTR.cs | 4 +- .../PlaceableAssets/AssetEGEN.cs | 4 +- .../PlaceableAssets/AssetHANG.cs | 4 +- .../PlaceableAssets/AssetPEND.cs | 4 +- .../PlaceableAssets/AssetPKUP.cs | 4 +- .../PlaceableAssets/AssetPLAT.cs | 4 +- .../PlaceableAssets/AssetPLYR.cs | 4 +- .../PlaceableAssets/AssetSIMP.cs | 4 +- .../PlaceableAssets/AssetTRIG.cs | 4 +- .../PlaceableAssets/AssetUI.cs | 4 +- .../PlaceableAssets/AssetUIFT.cs | 4 +- .../PlaceableAssets/AssetVIL.cs | 4 +- IndustrialPark/Assets/Shared/ObjectAsset.cs | 4 +- IndustrialPark/IndustrialPark.csproj | 11 + IndustrialPark/MainForm/AboutBox.Designer.cs | 2 +- IndustrialPark/MainForm/MainForm.cs | 8 + IndustrialPark/SharpDX/TextureManager.cs | 14 +- 44 files changed, 1412 insertions(+), 88 deletions(-) create mode 100644 IndustrialPark/ArchiveEditor/AssetEditor/InternalShrapnelEditor.Designer.cs create mode 100644 IndustrialPark/ArchiveEditor/AssetEditor/InternalShrapnelEditor.cs create mode 100644 IndustrialPark/ArchiveEditor/AssetEditor/InternalShrapnelEditor.resx create mode 100644 IndustrialPark/Assets/Binary/AssetSHRP.cs create mode 100644 IndustrialPark/Assets/ObjectAssets/AssetSURF.cs diff --git a/IndustrialPark/ArchiveEditor/ArchiveEditor.Designer.cs b/IndustrialPark/ArchiveEditor/ArchiveEditor.Designer.cs index b0a1d351..568d8199 100644 --- a/IndustrialPark/ArchiveEditor/ArchiveEditor.Designer.cs +++ b/IndustrialPark/ArchiveEditor/ArchiveEditor.Designer.cs @@ -45,6 +45,8 @@ private void InitializeComponent() this.importTXDArchiveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.statusStrip1 = new System.Windows.Forms.StatusStrip(); this.toolStripStatusLabelCurrentFilename = new System.Windows.Forms.ToolStripStatusLabel(); + this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel(); + this.toolStripStatusLabelSelectionCount = new System.Windows.Forms.ToolStripStatusLabel(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.buttonArrowDown = new System.Windows.Forms.Button(); this.buttonArrowUp = new System.Windows.Forms.Button(); @@ -81,6 +83,7 @@ private void InitializeComponent() this.toolStripMenuItem_Export = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem_EditHeader = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem_EditData = new System.Windows.Forms.ToolStripMenuItem(); + this.hideButtonsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.menuStrip1.SuspendLayout(); this.statusStrip1.SuspendLayout(); this.groupBox1.SuspendLayout(); @@ -107,6 +110,7 @@ private void InitializeComponent() this.saveToolStripMenuItem, this.saveAsToolStripMenuItem, this.toolStripSeparator1, + this.hideButtonsToolStripMenuItem, this.closeToolStripMenuItem}); this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); @@ -209,7 +213,9 @@ private void InitializeComponent() // statusStrip1 // this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.toolStripStatusLabelCurrentFilename}); + this.toolStripStatusLabelCurrentFilename, + this.toolStripStatusLabel1, + this.toolStripStatusLabelSelectionCount}); this.statusStrip1.Location = new System.Drawing.Point(0, 419); this.statusStrip1.Name = "statusStrip1"; this.statusStrip1.Size = new System.Drawing.Size(624, 22); @@ -221,6 +227,17 @@ private void InitializeComponent() this.toolStripStatusLabelCurrentFilename.Name = "toolStripStatusLabelCurrentFilename"; this.toolStripStatusLabelCurrentFilename.Size = new System.Drawing.Size(0, 17); // + // toolStripStatusLabel1 + // + this.toolStripStatusLabel1.Name = "toolStripStatusLabel1"; + this.toolStripStatusLabel1.Size = new System.Drawing.Size(10, 17); + this.toolStripStatusLabel1.Text = "|"; + // + // toolStripStatusLabelSelectionCount + // + this.toolStripStatusLabelSelectionCount.Name = "toolStripStatusLabelSelectionCount"; + this.toolStripStatusLabelSelectionCount.Size = new System.Drawing.Size(0, 17); + // // groupBox1 // this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) @@ -612,6 +629,13 @@ private void InitializeComponent() this.toolStripMenuItem_EditData.Text = "Edit Data (Ctrl + G)"; this.toolStripMenuItem_EditData.Click += new System.EventHandler(this.toolStripMenuItem_EditData_Click); // + // hideButtonsToolStripMenuItem + // + this.hideButtonsToolStripMenuItem.Name = "hideButtonsToolStripMenuItem"; + this.hideButtonsToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.hideButtonsToolStripMenuItem.Text = "Hide Buttons"; + this.hideButtonsToolStripMenuItem.Click += new System.EventHandler(this.hideButtonsToolStripMenuItem_Click); + // // ArchiveEditor // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -695,5 +719,8 @@ private void InitializeComponent() private System.Windows.Forms.Label labelTemplateFocus; private System.Windows.Forms.ToolStripMenuItem importMultipleAssetsToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem_AddMulti; + private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1; + private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabelSelectionCount; + private System.Windows.Forms.ToolStripMenuItem hideButtonsToolStripMenuItem; } } \ No newline at end of file diff --git a/IndustrialPark/ArchiveEditor/ArchiveEditor.cs b/IndustrialPark/ArchiveEditor/ArchiveEditor.cs index 7e3d242c..251e1f7a 100644 --- a/IndustrialPark/ArchiveEditor/ArchiveEditor.cs +++ b/IndustrialPark/ArchiveEditor/ArchiveEditor.cs @@ -375,6 +375,8 @@ private void PopulateAssetList(AssetType type = AssetType.Null) assetList.Sort(); listBoxAssets.Items.AddRange(assetList.ToArray()); + + toolStripStatusLabelSelectionCount.Text = $"{listBoxAssets.SelectedItems.Count}/{listBoxAssets.Items.Count} assets selected"; } private void comboBoxAssetTypes_SelectedIndexChanged(object sender, EventArgs e) @@ -639,6 +641,12 @@ public void OpenInternalEditors() archive.OpenInternalEditor(archive.GetCurrentlySelectedAssetIDs()); } + public void DeleteSelectedAssets() + { + buttonRemoveAsset_Click(null, null); + listBoxAssets.SelectedIndex = -1; + } + private void buttonExportRaw_Click(object sender, EventArgs e) { if (listBoxAssets.SelectedItem == null) @@ -694,6 +702,8 @@ private uint GetAssetIDFromName(string name) private void listBoxAssets_SelectedIndexChanged(object sender, EventArgs e) { + toolStripStatusLabelSelectionCount.Text = $"{listBoxAssets.SelectedItems.Count}/{listBoxAssets.Items.Count} assets selected"; + archive.ClearSelectedAssets(); foreach (string s in listBoxAssets.SelectedItems) archive.SelectAsset(GetAssetIDFromName(s), true); @@ -1011,5 +1021,29 @@ private void labelTemplateFocus_Click(object sender, EventArgs e) TemplateFocusOn(); } } + + private void hideButtonsToolStripMenuItem_Click(object sender, EventArgs e) + { + hideButtonsToolStripMenuItem.Checked = !hideButtonsToolStripMenuItem.Checked; + + buttonAddAsset.Visible = !hideButtonsToolStripMenuItem.Checked; + buttonDuplicate.Visible = !hideButtonsToolStripMenuItem.Checked; + buttonCopy.Visible = !hideButtonsToolStripMenuItem.Checked; + buttonPaste.Visible = !hideButtonsToolStripMenuItem.Checked; + buttonRemoveAsset.Visible = !hideButtonsToolStripMenuItem.Checked; + buttonView.Visible = !hideButtonsToolStripMenuItem.Checked; + buttonEditAsset.Visible = !hideButtonsToolStripMenuItem.Checked; + buttonExportRaw.Visible = !hideButtonsToolStripMenuItem.Checked; + buttonInternalEdit.Visible = !hideButtonsToolStripMenuItem.Checked; + + if (hideButtonsToolStripMenuItem.Checked) + { + listBoxAssets.Size = new System.Drawing.Size(listBoxAssets.Size.Width + 81, listBoxAssets.Size.Height); + } + else + { + listBoxAssets.Size = new System.Drawing.Size(listBoxAssets.Size.Width - 81, listBoxAssets.Size.Height); + } + } } } \ No newline at end of file diff --git a/IndustrialPark/ArchiveEditor/ArchiveEditorFunctions.cs b/IndustrialPark/ArchiveEditor/ArchiveEditorFunctions.cs index 8684e811..2ba0b055 100644 --- a/IndustrialPark/ArchiveEditor/ArchiveEditorFunctions.cs +++ b/IndustrialPark/ArchiveEditor/ArchiveEditorFunctions.cs @@ -459,6 +459,12 @@ private void AddAssetToDictionary(Section_AHDR AHDR) assetDictionary.Add(AHDR.assetID, newAsset); } break; + case AssetType.SHRP: + { + AssetSHRP newAsset = new AssetSHRP(AHDR); + assetDictionary.Add(AHDR.assetID, newAsset); + } + break; case AssetType.SNDI: { if (currentPlatform == Platform.GameCube && (currentGame == Game.BFBB || currentGame == Game.Scooby)) @@ -483,6 +489,12 @@ private void AddAssetToDictionary(Section_AHDR AHDR) } } break; + case AssetType.SURF: + { + AssetSURF newAsset = new AssetSURF(AHDR); + assetDictionary.Add(AHDR.assetID, newAsset); + } + break; case AssetType.TEXT: { AssetTEXT newAsset = new AssetTEXT(AHDR); @@ -542,7 +554,6 @@ private void AddAssetToDictionary(Section_AHDR AHDR) case AssetType.SPLN: case AssetType.SSET: case AssetType.SUBT: - case AssetType.SURF: case AssetType.TPIK: case AssetType.TRWT: case AssetType.UIM: @@ -563,7 +574,6 @@ private void AddAssetToDictionary(Section_AHDR AHDR) case AssetType.NPCS: case AssetType.ONEL: case AssetType.RAW: - case AssetType.SHRP: case AssetType.SND: case AssetType.SNDS: case AssetType.SPLP: diff --git a/IndustrialPark/ArchiveEditor/ArchiveEditorFunctions_AssetEditing.cs b/IndustrialPark/ArchiveEditor/ArchiveEditorFunctions_AssetEditing.cs index a9428cdd..8ff8806a 100644 --- a/IndustrialPark/ArchiveEditor/ArchiveEditorFunctions_AssetEditing.cs +++ b/IndustrialPark/ArchiveEditor/ArchiveEditorFunctions_AssetEditing.cs @@ -55,6 +55,9 @@ private void OpenInternalEditor(Asset asset) case AssetType.TEXT: internalEditors.Add(new InternalTextEditor((AssetTEXT)asset, this)); break; + case AssetType.SHRP: + internalEditors.Add(new InternalShrapnelEditor((AssetSHRP)asset, this)); + break; case AssetType.SND: case AssetType.SNDS: internalEditors.Add(new InternalSoundEditor(asset, this)); diff --git a/IndustrialPark/ArchiveEditor/ArchiveEditorFunctions_AssetTemplates.cs b/IndustrialPark/ArchiveEditor/ArchiveEditorFunctions_AssetTemplates.cs index 71b7910e..5785d7a8 100644 --- a/IndustrialPark/ArchiveEditor/ArchiveEditorFunctions_AssetTemplates.cs +++ b/IndustrialPark/ArchiveEditor/ArchiveEditorFunctions_AssetTemplates.cs @@ -136,6 +136,12 @@ public uint PlaceTemplate(Vector3 position, int layerIndex, out bool success, re case AssetTemplate.SphereTrigger: newAssetType = AssetType.TRIG; break; + case AssetTemplate.DuplicatotronSettings: + newAssetType = AssetType.DYNA; + break; + case AssetTemplate.EmptyGroup: + newAssetType = AssetType.GRUP; + break; default: if (template != AssetTemplate.None) MessageBox.Show("Unsupported asset template"); @@ -150,6 +156,9 @@ public uint PlaceTemplate(Vector3 position, int layerIndex, out bool success, re data = GetTemplate(newAssetType) }; + if (template == AssetTemplate.DuplicatotronSettings) + newAsset.data = new byte[0x10]; + if (string.IsNullOrWhiteSpace(customName)) newAsset.ADBG = new Section_ADBG(0, template.ToString().ToUpper() + "_01", "", 0); else @@ -442,6 +451,32 @@ public uint PlaceTemplate(Vector3 position, int layerIndex, out bool success, re case AssetTemplate.Duplicatotron: ((AssetVIL)asset).ModelAssetID = BKDRHash("duplicatotron1000_bind.MINF"); ((AssetVIL)asset).VilType = VilType.duplicatotron1000_bind; + ((AssetVIL)asset).AssetID_DYNA_NPCSettings = PlaceTemplate(position, layerIndex, out success, ref assetIDs, template.ToString().ToUpper() + "_SETTINGS", AssetTemplate.DuplicatotronSettings); + ((AssetVIL)asset).EventsBFBB = new AssetEventBFBB[] { + new AssetEventBFBB + { + Arguments_Float = new float[6], + TargetAssetID = PlaceTemplate(position, layerIndex, out success, ref assetIDs, template.ToString().ToUpper() + "_GROUP", AssetTemplate.EmptyGroup), + EventReceiveID = EventTypeBFBB.ScenePrepare, + EventSendID = EventTypeBFBB.Connect_IOwnYou + } + }; + break; + case AssetTemplate.DuplicatotronSettings: + ((AssetDYNA)asset).Flags = 0x1D; + ((AssetDYNA)asset).Version = 2; + ((AssetDYNA)asset).Type = DynaType.game_object__NPCSettings; + ((AssetDYNA)asset).DynaBase = new DynaNPCSettings() + { + Flags1 = 1, + Flags2 = 1, + Flags3 = 1, + Flags5 = 1, + Flags9 = 1, + Flags10 = 1, + DuploSpawnRate = 1f, + DuploEnemyLimit = -1 + }; break; case AssetTemplate.Button: ((AssetBUTN)asset).RotationX = -90f; diff --git a/IndustrialPark/ArchiveEditor/AssetEditor/InternalShrapnelEditor.Designer.cs b/IndustrialPark/ArchiveEditor/AssetEditor/InternalShrapnelEditor.Designer.cs new file mode 100644 index 00000000..22dffbe9 --- /dev/null +++ b/IndustrialPark/ArchiveEditor/AssetEditor/InternalShrapnelEditor.Designer.cs @@ -0,0 +1,178 @@ +namespace IndustrialPark +{ + partial class InternalShrapnelEditor + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.propertyGridAsset = new System.Windows.Forms.PropertyGrid(); + this.labelAssetName = new System.Windows.Forms.Label(); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.buttonAdd4 = new System.Windows.Forms.Button(); + this.buttonFindCallers = new System.Windows.Forms.Button(); + this.buttonAdd3 = new System.Windows.Forms.Button(); + this.buttonAdd5 = new System.Windows.Forms.Button(); + this.buttonAdd6 = new System.Windows.Forms.Button(); + this.tableLayoutPanel1.SuspendLayout(); + this.SuspendLayout(); + // + // propertyGridAsset + // + this.propertyGridAsset.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.tableLayoutPanel1.SetColumnSpan(this.propertyGridAsset, 4); + this.propertyGridAsset.HelpVisible = false; + this.propertyGridAsset.Location = new System.Drawing.Point(3, 23); + this.propertyGridAsset.Name = "propertyGridAsset"; + this.propertyGridAsset.PropertySort = System.Windows.Forms.PropertySort.Categorized; + this.propertyGridAsset.Size = new System.Drawing.Size(324, 319); + this.propertyGridAsset.TabIndex = 5; + this.propertyGridAsset.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.propertyGridAsset_PropertyValueChanged); + // + // labelAssetName + // + this.labelAssetName.AutoSize = true; + this.tableLayoutPanel1.SetColumnSpan(this.labelAssetName, 4); + this.labelAssetName.Dock = System.Windows.Forms.DockStyle.Left; + this.labelAssetName.Location = new System.Drawing.Point(3, 0); + this.labelAssetName.Name = "labelAssetName"; + this.labelAssetName.Size = new System.Drawing.Size(0, 20); + this.labelAssetName.TabIndex = 6; + this.labelAssetName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // tableLayoutPanel1 + // + this.tableLayoutPanel1.ColumnCount = 4; + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F)); + this.tableLayoutPanel1.Controls.Add(this.buttonAdd4, 1, 2); + this.tableLayoutPanel1.Controls.Add(this.propertyGridAsset, 0, 1); + this.tableLayoutPanel1.Controls.Add(this.labelAssetName, 0, 0); + this.tableLayoutPanel1.Controls.Add(this.buttonFindCallers, 0, 3); + this.tableLayoutPanel1.Controls.Add(this.buttonAdd3, 0, 2); + this.tableLayoutPanel1.Controls.Add(this.buttonAdd5, 2, 2); + this.tableLayoutPanel1.Controls.Add(this.buttonAdd6, 3, 2); + this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + this.tableLayoutPanel1.RowCount = 4; + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel1.Size = new System.Drawing.Size(330, 401); + this.tableLayoutPanel1.TabIndex = 7; + // + // buttonAdd4 + // + this.buttonAdd4.Dock = System.Windows.Forms.DockStyle.Fill; + this.buttonAdd4.Location = new System.Drawing.Point(85, 348); + this.buttonAdd4.Name = "buttonAdd4"; + this.buttonAdd4.Size = new System.Drawing.Size(76, 22); + this.buttonAdd4.TabIndex = 9; + this.buttonAdd4.Text = "Add Type 4"; + this.buttonAdd4.UseVisualStyleBackColor = true; + this.buttonAdd4.Click += new System.EventHandler(this.buttonAdd4_Click); + // + // buttonFindCallers + // + this.buttonFindCallers.AutoSize = true; + this.tableLayoutPanel1.SetColumnSpan(this.buttonFindCallers, 4); + this.buttonFindCallers.Dock = System.Windows.Forms.DockStyle.Fill; + this.buttonFindCallers.Location = new System.Drawing.Point(3, 376); + this.buttonFindCallers.Name = "buttonFindCallers"; + this.buttonFindCallers.Size = new System.Drawing.Size(324, 22); + this.buttonFindCallers.TabIndex = 7; + this.buttonFindCallers.Text = "Find Who Targets Me"; + this.buttonFindCallers.UseVisualStyleBackColor = true; + this.buttonFindCallers.Click += new System.EventHandler(this.buttonFindCallers_Click); + // + // buttonAdd3 + // + this.buttonAdd3.Dock = System.Windows.Forms.DockStyle.Fill; + this.buttonAdd3.Location = new System.Drawing.Point(3, 348); + this.buttonAdd3.Name = "buttonAdd3"; + this.buttonAdd3.Size = new System.Drawing.Size(76, 22); + this.buttonAdd3.TabIndex = 8; + this.buttonAdd3.Text = "Add Type 3"; + this.buttonAdd3.UseVisualStyleBackColor = true; + this.buttonAdd3.Click += new System.EventHandler(this.buttonAdd3_Click); + // + // buttonAdd5 + // + this.buttonAdd5.Dock = System.Windows.Forms.DockStyle.Fill; + this.buttonAdd5.Location = new System.Drawing.Point(167, 348); + this.buttonAdd5.Name = "buttonAdd5"; + this.buttonAdd5.Size = new System.Drawing.Size(76, 22); + this.buttonAdd5.TabIndex = 10; + this.buttonAdd5.Text = "Add Type 5"; + this.buttonAdd5.UseVisualStyleBackColor = true; + this.buttonAdd5.Click += new System.EventHandler(this.buttonAdd5_Click); + // + // buttonAdd6 + // + this.buttonAdd6.Dock = System.Windows.Forms.DockStyle.Fill; + this.buttonAdd6.Location = new System.Drawing.Point(249, 348); + this.buttonAdd6.Name = "buttonAdd6"; + this.buttonAdd6.Size = new System.Drawing.Size(78, 22); + this.buttonAdd6.TabIndex = 11; + this.buttonAdd6.Text = "Add Type 6"; + this.buttonAdd6.UseVisualStyleBackColor = true; + this.buttonAdd6.Click += new System.EventHandler(this.buttonAdd6_Click); + // + // InternalShrapnelEditor + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(330, 401); + this.Controls.Add(this.tableLayoutPanel1); + this.MaximizeBox = false; + this.Name = "InternalShrapnelEditor"; + this.ShowIcon = false; + this.Text = "Asset Data Editor"; + this.TopMost = true; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.InternalAssetEditor_FormClosing); + this.tableLayoutPanel1.ResumeLayout(false); + this.tableLayoutPanel1.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + private System.Windows.Forms.PropertyGrid propertyGridAsset; + private System.Windows.Forms.Label labelAssetName; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.Button buttonFindCallers; + private System.Windows.Forms.Button buttonAdd4; + private System.Windows.Forms.Button buttonAdd3; + private System.Windows.Forms.Button buttonAdd5; + private System.Windows.Forms.Button buttonAdd6; + } +} \ No newline at end of file diff --git a/IndustrialPark/ArchiveEditor/AssetEditor/InternalShrapnelEditor.cs b/IndustrialPark/ArchiveEditor/AssetEditor/InternalShrapnelEditor.cs new file mode 100644 index 00000000..5b93c179 --- /dev/null +++ b/IndustrialPark/ArchiveEditor/AssetEditor/InternalShrapnelEditor.cs @@ -0,0 +1,84 @@ +using System.Collections.Generic; +using System.Linq; +using System.Windows.Forms; + +namespace IndustrialPark +{ + public partial class InternalShrapnelEditor : Form, IInternalEditor + { + public InternalShrapnelEditor(AssetSHRP asset, ArchiveEditorFunctions archive) + { + InitializeComponent(); + TopMost = true; + + this.asset = asset; + this.archive = archive; + + propertyGridAsset.SelectedObject = asset; + labelAssetName.Text = $"[{asset.AHDR.assetType.ToString()}] {asset.ToString()}"; + } + + private void InternalAssetEditor_FormClosing(object sender, FormClosingEventArgs e) + { + archive.CloseInternalEditor(this); + } + + private AssetSHRP asset; + private ArchiveEditorFunctions archive; + + public uint GetAssetID() + { + return asset.AHDR.assetID; + } + + private void buttonFindCallers_Click(object sender, System.EventArgs e) + { + Program.MainForm.FindWhoTargets(GetAssetID()); + } + + private void propertyGridAsset_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) + { + archive.UnsavedChanges = true; + } + + private void buttonAdd3_Click(object sender, System.EventArgs e) + { + List list = asset.SHRPEntries.ToList(); + list.Add(new EntrySHRP_Type3()); + asset.SHRPEntries = list.ToArray(); + + propertyGridAsset.SelectedObject = asset; + archive.UnsavedChanges = true; + } + + private void buttonAdd4_Click(object sender, System.EventArgs e) + { + List list = asset.SHRPEntries.ToList(); + list.Add(new EntrySHRP_Type4()); + asset.SHRPEntries = list.ToArray(); + + propertyGridAsset.SelectedObject = asset; + archive.UnsavedChanges = true; + } + + private void buttonAdd5_Click(object sender, System.EventArgs e) + { + List list = asset.SHRPEntries.ToList(); + list.Add(new EntrySHRP_Type5()); + asset.SHRPEntries = list.ToArray(); + + propertyGridAsset.SelectedObject = asset; + archive.UnsavedChanges = true; + } + + private void buttonAdd6_Click(object sender, System.EventArgs e) + { + List list = asset.SHRPEntries.ToList(); + list.Add(new EntrySHRP_Type6()); + asset.SHRPEntries = list.ToArray(); + + propertyGridAsset.SelectedObject = asset; + archive.UnsavedChanges = true; + } + } +} diff --git a/IndustrialPark/ArchiveEditor/AssetEditor/InternalShrapnelEditor.resx b/IndustrialPark/ArchiveEditor/AssetEditor/InternalShrapnelEditor.resx new file mode 100644 index 00000000..1af7de15 --- /dev/null +++ b/IndustrialPark/ArchiveEditor/AssetEditor/InternalShrapnelEditor.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/IndustrialPark/ArchiveEditor/AssetTemplates/AssetTemplate.cs b/IndustrialPark/ArchiveEditor/AssetTemplates/AssetTemplate.cs index 9bf0f3a3..70e3e580 100644 --- a/IndustrialPark/ArchiveEditor/AssetTemplates/AssetTemplate.cs +++ b/IndustrialPark/ArchiveEditor/AssetTemplates/AssetTemplate.cs @@ -45,5 +45,7 @@ public enum AssetTemplate TexasHitch, SphereTrigger, EnemyMVPT, + EmptyGroup, + DuplicatotronSettings, } } diff --git a/IndustrialPark/Assets/Binary/AssetSHRP.cs b/IndustrialPark/Assets/Binary/AssetSHRP.cs new file mode 100644 index 00000000..8975f796 --- /dev/null +++ b/IndustrialPark/Assets/Binary/AssetSHRP.cs @@ -0,0 +1,433 @@ +using HipHopFile; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.IO; +using System.Linq; +using static IndustrialPark.ConverterFunctions; + +namespace IndustrialPark +{ + public class AssetSHRP : Asset + { + public AssetSHRP(Section_AHDR AHDR) : base(AHDR) { } + + public override bool HasReference(uint assetID) + { + if (AssetID == assetID) + return true; + + foreach (EntrySHRP a in SHRPEntries) + if (a.HasReference(assetID)) + return true; + + return false; + } + + [Category("Shrapnel"), ReadOnly(true)] + public int AmountOfEntries + { + get => ReadInt(0x00); + set => Write(0x00, value); + } + + [Category("Shrapnel")] + public AssetID AssetID + { + get => ReadUInt(0x04); + set => Write(0x04, value); + } + + [Category("Shrapnel")] + public int UnknownInt08 + { + get => ReadInt(0x08); + set => Write(0x08, value); + } + + [Category("Shrapnel")] + public EntrySHRP[] SHRPEntries + { + get + { + List entries = new List(); + BinaryReader binaryReader = new BinaryReader(new MemoryStream(Data.Skip(0xC).ToArray())); + + for (int i = 0; i < AmountOfEntries; i++) + { + int Type = Switch(binaryReader.ReadInt32()); + binaryReader.BaseStream.Position -= 4; + + EntrySHRP entry = null; + + if (Type == 3) + entry = new EntrySHRP_Type3(binaryReader.ReadBytes(0x1D4)); + else if (Type == 4) + entry = new EntrySHRP_Type4(binaryReader.ReadBytes(0x90)); + else if (Type == 5) + entry = new EntrySHRP_Type5(binaryReader.ReadBytes(0x68)); + else if (Type == 6) + entry = new EntrySHRP_Type6(binaryReader.ReadBytes(0x4C)); + else + System.Windows.Forms.MessageBox.Show("Unknown SHRP entry type found: " + Type.ToString() + " in asset " + ToString()); + + entries.Add(entry); + } + + return entries.ToArray(); + } + + set + { + List newData = Data.Take(0xC).ToList(); + foreach (EntrySHRP entry in value) + newData.AddRange(entry.ToByteArray()); + Data = newData.ToArray(); + AmountOfEntries = value.Length; + } + } + } + + public abstract class EntrySHRP + { + [ReadOnly(true)] + public int Type { get; set; } + public AssetID Unknown04 { get; set; } + public AssetID Unknown08 { get; set; } + public AssetID Unknown0C { get; set; } + public float Unknown10 { get; set; } + public float Unknown14 { get; set; } + + public EntrySHRP() + { + Unknown04 = 0; + Unknown08 = 0; + Unknown0C = 0; + } + + public EntrySHRP(byte[] data) + { + Type = Switch(BitConverter.ToInt32(data, 0x00)); + Unknown04 = Switch(BitConverter.ToUInt32(data, 0x04)); + Unknown08 = Switch(BitConverter.ToUInt32(data, 0x08)); + Unknown0C = Switch(BitConverter.ToUInt32(data, 0x0C)); + Unknown10 = Switch(BitConverter.ToSingle(data, 0x10)); + Unknown14 = Switch(BitConverter.ToSingle(data, 0x14)); + } + + public virtual List ToByteArray() + { + List list = new List(); + + list.AddRange(BitConverter.GetBytes(Switch(Type))); + list.AddRange(BitConverter.GetBytes(Switch(Unknown04))); + list.AddRange(BitConverter.GetBytes(Switch(Unknown08))); + list.AddRange(BitConverter.GetBytes(Switch(Unknown0C))); + list.AddRange(BitConverter.GetBytes(Switch(Unknown10))); + list.AddRange(BitConverter.GetBytes(Switch(Unknown14))); + + return list; + } + + public virtual bool HasReference(uint assetID) + { + if (Unknown04 == assetID) + return true; + + return false; + } + } + + public class EntrySHRP_Type3 : EntrySHRP + { + public int Unknown18 { get; set; } + public int Unknown1C { get; set; } + public float Unknown20 { get; set; } + public float Unknown24 { get; set; } + public float Unknown28 { get; set; } + public int Unknown3C { get; set; } + public int Unknown40 { get; set; } + public int Unknown44 { get; set; } + public float Unknown48 { get; set; } + public float Unknown4C { get; set; } + public AssetID PARE_AssetID { get; set; } + public int Unknown1D0 { get; set; } + + public EntrySHRP_Type3() : base() + { + Type = 3; + PARE_AssetID = 0; + } + + public EntrySHRP_Type3(byte[] data) : base(data) + { + Unknown18 = Switch(BitConverter.ToInt32(data, 0x18)); + Unknown1C = Switch(BitConverter.ToInt32(data, 0x1C)); + Unknown20 = Switch(BitConverter.ToSingle(data, 0x20)); + Unknown24 = Switch(BitConverter.ToSingle(data, 0x24)); + Unknown28 = Switch(BitConverter.ToSingle(data, 0x28)); + Unknown3C = Switch(BitConverter.ToInt32(data, 0x3C)); + Unknown40 = Switch(BitConverter.ToInt32(data, 0x40)); + Unknown44 = Switch(BitConverter.ToInt32(data, 0x44)); + Unknown48 = Switch(BitConverter.ToSingle(data, 0x48)); + Unknown4C = Switch(BitConverter.ToSingle(data, 0x4C)); + PARE_AssetID = Switch(BitConverter.ToUInt32(data, 0x1CC)); + Unknown1D0 = Switch(BitConverter.ToInt32(data, 0x1D0)); + } + + public override List ToByteArray() + { + List list = base.ToByteArray(); + + list.AddRange(BitConverter.GetBytes(Switch(Unknown18))); + list.AddRange(BitConverter.GetBytes(Switch(Unknown1C))); + list.AddRange(BitConverter.GetBytes(Switch(Unknown20))); + list.AddRange(BitConverter.GetBytes(Switch(Unknown24))); + list.AddRange(BitConverter.GetBytes(Switch(Unknown28))); + for (int i = 0; i < 0x10; i++) + list.Add(0xCD); + list.AddRange(BitConverter.GetBytes(Switch(Unknown3C))); + list.AddRange(BitConverter.GetBytes(Switch(Unknown40))); + list.AddRange(BitConverter.GetBytes(Switch(Unknown44))); + list.AddRange(BitConverter.GetBytes(Switch(Unknown48))); + list.AddRange(BitConverter.GetBytes(Switch(Unknown4C))); + for (int i = 0; i < 0x17C; i++) + list.Add(0xCD); + list.AddRange(BitConverter.GetBytes(Switch(PARE_AssetID))); + list.AddRange(BitConverter.GetBytes(Switch(Unknown1D0))); + + return list; + } + + public override bool HasReference(uint assetID) + { + if (PARE_AssetID == assetID) + return true; + + return base.HasReference(assetID); + } + } + + public class EntrySHRP_Type4 : EntrySHRP + { + public AssetID ModelAssetID { get; set; } + public int Unknown1C { get; set; } + public int Unknown20 { get; set; } + public int Unknown24 { get; set; } + public float Unknown28 { get; set; } + public float Unknown2C { get; set; } + public float Unknown30 { get; set; } + public float Unknown68 { get; set; } + public int Unknown6C { get; set; } + public int Unknown70 { get; set; } + public AssetID UnknownAssetID74 { get; set; } + public float Unknown78 { get; set; } + public float Unknown7C { get; set; } + public float Unknown80 { get; set; } + public float Unknown84 { get; set; } + public float Unknown88 { get; set; } + public float Unknown8C { get; set; } + + public EntrySHRP_Type4() : base() + { + Type = 4; + ModelAssetID = 0; + UnknownAssetID74 = 0; + } + + public EntrySHRP_Type4(byte[] data) : base(data) + { + ModelAssetID = Switch(BitConverter.ToUInt32(data, 0x18)); + Unknown1C = Switch(BitConverter.ToInt32(data, 0x1C)); + Unknown20 = Switch(BitConverter.ToInt32(data, 0x20)); + Unknown24 = Switch(BitConverter.ToInt32(data, 0x24)); + Unknown28 = Switch(BitConverter.ToSingle(data, 0x28)); + Unknown2C = Switch(BitConverter.ToSingle(data, 0x2C)); + Unknown30 = Switch(BitConverter.ToSingle(data, 0x30)); + Unknown68 = Switch(BitConverter.ToSingle(data, 0x68)); + Unknown6C = Switch(BitConverter.ToInt32(data, 0x6C)); + Unknown70 = Switch(BitConverter.ToInt32(data, 0x70)); + UnknownAssetID74 = Switch(BitConverter.ToUInt32(data, 0x74)); + Unknown78 = Switch(BitConverter.ToSingle(data, 0x78)); + Unknown7C = Switch(BitConverter.ToSingle(data, 0x7C)); + Unknown80 = Switch(BitConverter.ToSingle(data, 0x80)); + Unknown84 = Switch(BitConverter.ToSingle(data, 0x84)); + Unknown88 = Switch(BitConverter.ToSingle(data, 0x88)); + Unknown8C = Switch(BitConverter.ToSingle(data, 0x8C)); + } + + public override List ToByteArray() + { + List list = base.ToByteArray(); + + list.AddRange(BitConverter.GetBytes(Switch(ModelAssetID))); + list.AddRange(BitConverter.GetBytes(Switch(Unknown1C))); + list.AddRange(BitConverter.GetBytes(Switch(Unknown20))); + list.AddRange(BitConverter.GetBytes(Switch(Unknown24))); + list.AddRange(BitConverter.GetBytes(Switch(Unknown28))); + list.AddRange(BitConverter.GetBytes(Switch(Unknown2C))); + list.AddRange(BitConverter.GetBytes(Switch(Unknown30))); + for (int i = 0; i < 0x34; i++) + list.Add(0xCD); + list.AddRange(BitConverter.GetBytes(Switch(Unknown68))); + list.AddRange(BitConverter.GetBytes(Switch(Unknown6C))); + list.AddRange(BitConverter.GetBytes(Switch(Unknown70))); + list.AddRange(BitConverter.GetBytes(Switch(UnknownAssetID74))); + list.AddRange(BitConverter.GetBytes(Switch(Unknown78))); + list.AddRange(BitConverter.GetBytes(Switch(Unknown7C))); + list.AddRange(BitConverter.GetBytes(Switch(Unknown80))); + list.AddRange(BitConverter.GetBytes(Switch(Unknown84))); + list.AddRange(BitConverter.GetBytes(Switch(Unknown88))); + list.AddRange(BitConverter.GetBytes(Switch(Unknown8C))); + + return list; + } + + public override bool HasReference(uint assetID) + { + if (ModelAssetID == assetID) + return true; + if (UnknownAssetID74 == assetID) + return true; + + return base.HasReference(assetID); + } + } + + public class EntrySHRP_Type5 : EntrySHRP + { + public int Unknown18 { get; set; } + public AssetID Unknown1C { get; set; } + public float Unknown20 { get; set; } + public AssetID Unknown24 { get; set; } + public AssetID Unknown28 { get; set; } + public int Unknown3C { get; set; } + public AssetID Unknown40 { get; set; } + public float Unknown44 { get; set; } + public AssetID Unknown48 { get; set; } + public AssetID Unknown4C { get; set; } + + public EntrySHRP_Type5() : base() + { + Type = 5; + Unknown1C = 0; + Unknown24 = 0; + Unknown28 = 0; + Unknown40 = 0; + Unknown48 = 0; + Unknown4C = 0; + } + + public EntrySHRP_Type5(byte[] data) : base(data) + { + Unknown18 = Switch(BitConverter.ToInt32(data, 0x18)); + Unknown1C = Switch(BitConverter.ToUInt32(data, 0x1C)); + Unknown20 = Switch(BitConverter.ToSingle(data, 0x20)); + Unknown24 = Switch(BitConverter.ToUInt32(data, 0x24)); + Unknown28 = Switch(BitConverter.ToUInt32(data, 0x28)); + Unknown3C = Switch(BitConverter.ToInt32(data, 0x3C)); + Unknown40 = Switch(BitConverter.ToUInt32(data, 0x40)); + Unknown44 = Switch(BitConverter.ToSingle(data, 0x44)); + Unknown48 = Switch(BitConverter.ToUInt32(data, 0x48)); + Unknown4C = Switch(BitConverter.ToUInt32(data, 0x4C)); + } + + public override List ToByteArray() + { + List list = base.ToByteArray(); + + list.AddRange(BitConverter.GetBytes(Switch(Unknown18))); + list.AddRange(BitConverter.GetBytes(Switch(Unknown1C))); + list.AddRange(BitConverter.GetBytes(Switch(Unknown20))); + list.AddRange(BitConverter.GetBytes(Switch(Unknown24))); + list.AddRange(BitConverter.GetBytes(Switch(Unknown28))); + for (int i = 0; i < 0x10; i++) + list.Add(0xCD); + list.AddRange(BitConverter.GetBytes(Switch(Unknown3C))); + list.AddRange(BitConverter.GetBytes(Switch(Unknown40))); + list.AddRange(BitConverter.GetBytes(Switch(Unknown44))); + list.AddRange(BitConverter.GetBytes(Switch(Unknown48))); + list.AddRange(BitConverter.GetBytes(Switch(Unknown4C))); + for (int i = 0; i < 0x18; i++) + list.Add(0xCD); + + return list; + } + + public override bool HasReference(uint assetID) + { + if (Unknown1C == assetID) + return true; + if (Unknown24 == assetID) + return true; + if (Unknown28 == assetID) + return true; + if (Unknown40 == assetID) + return true; + if (Unknown48 == assetID) + return true; + if (Unknown4C == assetID) + return true; + return base.HasReference(assetID); + } + } + + public class EntrySHRP_Type6 : EntrySHRP + { + public AssetID SoundAssetID { get; set; } + public int Unknown1C { get; set; } + public int Unknown20 { get; set; } + public int Unknown24 { get; set; } + public int Unknown28 { get; set; } + public int Unknown2C { get; set; } + public float Unknown40 { get; set; } + public float Unknown44 { get; set; } + public float Unknown48 { get; set; } + + public EntrySHRP_Type6() : base() + { + Type = 6; + SoundAssetID = 0; + } + + public EntrySHRP_Type6(byte[] data) : base(data) + { + SoundAssetID = Switch(BitConverter.ToUInt32(data, 0x18)); + Unknown1C = Switch(BitConverter.ToInt32(data, 0x1C)); + Unknown20 = Switch(BitConverter.ToInt32(data, 0x20)); + Unknown24 = Switch(BitConverter.ToInt32(data, 0x24)); + Unknown28 = Switch(BitConverter.ToInt32(data, 0x28)); + Unknown2C = Switch(BitConverter.ToInt32(data, 0x2C)); + Unknown40 = Switch(BitConverter.ToSingle(data, 0x40)); + Unknown44 = Switch(BitConverter.ToSingle(data, 0x44)); + Unknown48 = Switch(BitConverter.ToSingle(data, 0x48)); + } + + public override List ToByteArray() + { + List list = base.ToByteArray(); + + list.AddRange(BitConverter.GetBytes(Switch(SoundAssetID))); + list.AddRange(BitConverter.GetBytes(Switch(Unknown1C))); + list.AddRange(BitConverter.GetBytes(Switch(Unknown20))); + list.AddRange(BitConverter.GetBytes(Switch(Unknown24))); + list.AddRange(BitConverter.GetBytes(Switch(Unknown28))); + list.AddRange(BitConverter.GetBytes(Switch(Unknown2C))); + for (int i = 0; i < 0x10; i++) + list.Add(0xCD); + list.AddRange(BitConverter.GetBytes(Switch(Unknown40))); + list.AddRange(BitConverter.GetBytes(Switch(Unknown44))); + list.AddRange(BitConverter.GetBytes(Switch(Unknown48))); + + return list; + } + + public override bool HasReference(uint assetID) + { + if (SoundAssetID == assetID) + return true; + + return base.HasReference(assetID); + } + } +} \ No newline at end of file diff --git a/IndustrialPark/Assets/ObjectAssets/AssetCNTR.cs b/IndustrialPark/Assets/ObjectAssets/AssetCNTR.cs index a1c93446..a9ea4d27 100644 --- a/IndustrialPark/Assets/ObjectAssets/AssetCNTR.cs +++ b/IndustrialPark/Assets/ObjectAssets/AssetCNTR.cs @@ -7,10 +7,7 @@ public class AssetCNTR : ObjectAsset { public AssetCNTR(Section_AHDR AHDR) : base(AHDR) { } - protected override int EventStartOffset - { - get => 0xC; - } + protected override int EventStartOffset => 0xC; [Category("Counter")] public short Count diff --git a/IndustrialPark/Assets/ObjectAssets/AssetCOND.cs b/IndustrialPark/Assets/ObjectAssets/AssetCOND.cs index 4649bd21..1954c404 100644 --- a/IndustrialPark/Assets/ObjectAssets/AssetCOND.cs +++ b/IndustrialPark/Assets/ObjectAssets/AssetCOND.cs @@ -49,10 +49,7 @@ public override bool HasReference(uint assetID) return base.HasReference(assetID); } - protected override int EventStartOffset - { - get => 0x18; - } + protected override int EventStartOffset => 0x18; [Category("Conditional")] public CONDVariable Conditional diff --git a/IndustrialPark/Assets/ObjectAssets/AssetCSNM.cs b/IndustrialPark/Assets/ObjectAssets/AssetCSNM.cs index 656620b7..8d2c7214 100644 --- a/IndustrialPark/Assets/ObjectAssets/AssetCSNM.cs +++ b/IndustrialPark/Assets/ObjectAssets/AssetCSNM.cs @@ -7,10 +7,7 @@ public class AssetCSNM : ObjectAsset { public AssetCSNM(Section_AHDR AHDR) : base(AHDR) { } - protected override int EventStartOffset - { - get => 0xC8; - } + protected override int EventStartOffset => 0xC8; public override bool HasReference(uint assetID) { diff --git a/IndustrialPark/Assets/ObjectAssets/AssetDPAT.cs b/IndustrialPark/Assets/ObjectAssets/AssetDPAT.cs index 344f3aa0..45124357 100644 --- a/IndustrialPark/Assets/ObjectAssets/AssetDPAT.cs +++ b/IndustrialPark/Assets/ObjectAssets/AssetDPAT.cs @@ -6,9 +6,6 @@ public class AssetDPAT : ObjectAsset { public AssetDPAT(Section_AHDR AHDR) : base(AHDR) { } - protected override int EventStartOffset - { - get => 0x8; - } + protected override int EventStartOffset => 0x8; } } \ No newline at end of file diff --git a/IndustrialPark/Assets/ObjectAssets/AssetENV.cs b/IndustrialPark/Assets/ObjectAssets/AssetENV.cs index 31d2a7c7..e316092a 100644 --- a/IndustrialPark/Assets/ObjectAssets/AssetENV.cs +++ b/IndustrialPark/Assets/ObjectAssets/AssetENV.cs @@ -8,10 +8,7 @@ public class AssetENV : ObjectAsset { public AssetENV(Section_AHDR AHDR) : base(AHDR) { } - protected override int EventStartOffset - { - get => 0x44; - } + protected override int EventStartOffset => 0x44; public override bool HasReference(uint assetID) { diff --git a/IndustrialPark/Assets/ObjectAssets/AssetFOG.cs b/IndustrialPark/Assets/ObjectAssets/AssetFOG.cs index f557ba62..54673f72 100644 --- a/IndustrialPark/Assets/ObjectAssets/AssetFOG.cs +++ b/IndustrialPark/Assets/ObjectAssets/AssetFOG.cs @@ -10,7 +10,7 @@ public class AssetFOG : ObjectAsset { public AssetFOG(Section_AHDR AHDR) : base(AHDR) { } - protected override int EventStartOffset { get => 0x24; } + protected override int EventStartOffset => 0x24; [Category("Fog"), Editor(typeof(MyColorEditor), typeof(UITypeEditor))] public MyColor Color1 diff --git a/IndustrialPark/Assets/ObjectAssets/AssetGRUP.cs b/IndustrialPark/Assets/ObjectAssets/AssetGRUP.cs index db176808..99c5124e 100644 --- a/IndustrialPark/Assets/ObjectAssets/AssetGRUP.cs +++ b/IndustrialPark/Assets/ObjectAssets/AssetGRUP.cs @@ -19,10 +19,7 @@ public override bool HasReference(uint assetID) return base.HasReference(assetID); } - protected override int EventStartOffset - { - get => 0x0C + ReadShort(0x08) * 4; - } + protected override int EventStartOffset => 0x0C + ReadShort(0x08) * 4; public enum Delegation { diff --git a/IndustrialPark/Assets/ObjectAssets/AssetPARE.cs b/IndustrialPark/Assets/ObjectAssets/AssetPARE.cs index 41c87ff6..35cdfc14 100644 --- a/IndustrialPark/Assets/ObjectAssets/AssetPARE.cs +++ b/IndustrialPark/Assets/ObjectAssets/AssetPARE.cs @@ -7,10 +7,7 @@ public class AssetPARE : ObjectAsset { public AssetPARE(Section_AHDR AHDR) : base(AHDR) { } - protected override int EventStartOffset - { - get => 0x54; - } + protected override int EventStartOffset => 0x54; public override bool HasReference(uint assetID) { @@ -163,9 +160,9 @@ public float UnknownFloat48 } [Category("Particle Emitter")] - public float UnknownFloat4C + public int UnknownInt4C { - get => ReadFloat(0x4C); + get => ReadInt(0x4C); set => Write(0x4C, value); } diff --git a/IndustrialPark/Assets/ObjectAssets/AssetPARP.cs b/IndustrialPark/Assets/ObjectAssets/AssetPARP.cs index e03f08f9..5fb09b82 100644 --- a/IndustrialPark/Assets/ObjectAssets/AssetPARP.cs +++ b/IndustrialPark/Assets/ObjectAssets/AssetPARP.cs @@ -24,10 +24,7 @@ public class AssetPARP : ObjectAsset { public AssetPARP(Section_AHDR AHDR) : base(AHDR) { } - protected override int EventStartOffset - { - get => 0x138; - } + protected override int EventStartOffset => 0x138; public override bool HasReference(uint assetID) { diff --git a/IndustrialPark/Assets/ObjectAssets/AssetPORT.cs b/IndustrialPark/Assets/ObjectAssets/AssetPORT.cs index d496224d..6220fb46 100644 --- a/IndustrialPark/Assets/ObjectAssets/AssetPORT.cs +++ b/IndustrialPark/Assets/ObjectAssets/AssetPORT.cs @@ -19,10 +19,7 @@ public override bool HasReference(uint assetID) return base.HasReference(assetID); } - protected override int EventStartOffset - { - get => 0x18; - } + protected override int EventStartOffset => 0x18; [Category("Portal")] public AssetID Camera_Unknown diff --git a/IndustrialPark/Assets/ObjectAssets/AssetSURF.cs b/IndustrialPark/Assets/ObjectAssets/AssetSURF.cs new file mode 100644 index 00000000..eb9d3a23 --- /dev/null +++ b/IndustrialPark/Assets/ObjectAssets/AssetSURF.cs @@ -0,0 +1,404 @@ +using HipHopFile; +using System.ComponentModel; + +namespace IndustrialPark +{ + public class AssetSURF : ObjectAsset + { + public AssetSURF(Section_AHDR AHDR) : base(AHDR) { } + + protected override int EventStartOffset => 0x12C; + + [Category("Surface")] + public int UnknownInt08 + { + get => ReadInt(0x08); + set => Write(0x08, value); + } + + [Category("Surface")] + public byte UnknownByte0C + { + get => ReadByte(0x0C); + set => Write(0x0C, value); + } + + [Category("Surface")] + public byte UnknownByte0D + { + get => ReadByte(0x0D); + set => Write(0x0D, value); + } + + [Category("Surface")] + public byte UnknownByte0E + { + get => ReadByte(0x0E); + set => Write(0x0E, value); + } + + [Category("Surface")] + public byte UnknownByte0F + { + get => ReadByte(0x0F); + set => Write(0x0F, value); + } + + [Category("Surface")] + public float UnknownFloat10 + { + get => ReadFloat(0x10); + set => Write(0x10, value); + } + + [Category("Surface")] + public int UnknownInt14 + { + get => ReadInt(0x14); + set => Write(0x14, value); + } + + [Category("Surface")] + public int UnknownInt18 + { + get => ReadInt(0x18); + set => Write(0x18, value); + } + + [Category("Surface")] + public int UnknownInt1C + { + get => ReadInt(0x1C); + set => Write(0x1C, value); + } + + [Category("Surface")] + public int UnknownInt20 + { + get => ReadInt(0x20); + set => Write(0x20, value); + } + + [Category("Surface")] + public int UnknownInt24 + { + get => ReadInt(0x24); + set => Write(0x24, value); + } + + [Category("Surface")] + public int UnknownInt28 + { + get => ReadInt(0x28); + set => Write(0x28, value); + } + + [Category("Surface")] + public short UnknownShort2C + { + get => ReadShort(0x2C); + set => Write(0x2C, value); + } + + [Category("Surface")] + public short UnknownShort2E + { + get => ReadShort(0x2E); + set => Write(0x2E, value); + } + + [Category("Surface")] + public float UnknownFloat30 + { + get => ReadFloat(0x30); + set => Write(0x30, value); + } + + [Category("Surface")] + public float UnknownFloat34 + { + get => ReadFloat(0x34); + set => Write(0x34, value); + } + + [Category("Surface")] + public float UnknownFloat38 + { + get => ReadFloat(0x38); + set => Write(0x38, value); + } + + [Category("Surface")] + public float UnknownFloat3C + { + get => ReadFloat(0x3C); + set => Write(0x3C, value); + } + + [Category("Surface")] + public float UnknownFloat40 + { + get => ReadFloat(0x40); + set => Write(0x40, value); + } + + [Category("Surface")] + public float UnknownFloat44 + { + get => ReadFloat(0x44); + set => Write(0x44, value); + } + + [Category("Surface")] + public float UnknownFloat48 + { + get => ReadFloat(0x48); + set => Write(0x48, value); + } + + [Category("Surface")] + public float UnknownFloat4C + { + get => ReadFloat(0x4C); + set => Write(0x4C, value); + } + + [Category("Surface")] + public int UnknownInt50 + { + get => ReadInt(0x50); + set => Write(0x50, value); + } + + [Category("Surface")] + public int UnknownInt54 + { + get => ReadInt(0x54); + set => Write(0x54, value); + } + + [Category("Surface")] + public int UnknownInt58 + { + get => ReadInt(0x58); + set => Write(0x58, value); + } + + [Category("Surface")] + public int UnknownInt5C + { + get => ReadInt(0x5C); + set => Write(0x5C, value); + } + + [Category("Surface")] + public int UnknownInt60 + { + get => ReadInt(0x60); + set => Write(0x60, value); + } + + [Category("Surface")] + public int UnknownInt64 + { + get => ReadInt(0x64); + set => Write(0x64, value); + } + + [Category("Surface")] + public int UnknownInt68 + { + get => ReadInt(0x68); + set => Write(0x68, value); + } + + [Category("Surface")] + public float UVAnimation_X + { + get => ReadFloat(0x6C); + set => Write(0x6C, value); + } + + [Category("Surface")] + public float UVAnimation_Y + { + get => ReadFloat(0x70); + set => Write(0x70, value); + } + + [Category("Surface")] + public float UnknownFloat74 + { + get => ReadFloat(0x74); + set => Write(0x74, value); + } + + [Category("Surface")] + public float UnknownFloat78 + { + get => ReadFloat(0x78); + set => Write(0x78, value); + } + + [Category("Surface")] + public float UnknownFloat7C + { + get => ReadFloat(0x7C); + set => Write(0x7C, value); + } + + [Category("Surface")] + public float UnknownFloat80 + { + get => ReadFloat(0x80); + set => Write(0x80, value); + } + + [Category("Surface")] + public float UnknownFloat84 + { + get => ReadFloat(0x84); + set => Write(0x84, value); + } + + [Category("Surface")] + public float UnknownFloat88 + { + get => ReadFloat(0x88); + set => Write(0x88, value); + } + + [Category("Surface")] + public float UnknownFloat8C + { + get => ReadFloat(0x8C); + set => Write(0x8C, value); + } + + [Category("Surface")] + public float UnknownFloat90 + { + get => ReadFloat(0x90); + set => Write(0x90, value); + } + + [Category("Surface")] + public float UnknownFloat94 + { + get => ReadFloat(0x94); + set => Write(0x94, value); + } + + [Category("Surface")] + public float UnknownFloat98 + { + get => ReadFloat(0x98); + set => Write(0x98, value); + } + + [Category("Surface")] + public float UnknownFloat9C + { + get => ReadFloat(0x9C); + set => Write(0x9C, value); + } + + [Category("Surface")] + public float UnknownFloat100 + { + get => ReadFloat(0x100); + set => Write(0x100, value); + } + + [Category("Surface")] + public float UnknownFloat104 + { + get => ReadFloat(0x104); + set => Write(0x104, value); + } + + [Category("Surface")] + public float UnknownFloat108 + { + get => ReadFloat(0x108); + set => Write(0x108, value); + } + + [Category("Surface")] + public float UnknownFloat10C + { + get => ReadFloat(0x10C); + set => Write(0x10C, value); + } + + [Category("Surface")] + public float UnknownFloat110 + { + get => ReadFloat(0x110); + set => Write(0x110, value); + } + + [Category("Surface")] + public byte UnknownByte114 + { + get => ReadByte(0x114); + set => Write(0x114, value); + } + + [Category("Surface")] + public byte UnknownByte115 + { + get => ReadByte(0x115); + set => Write(0x115, value); + } + + [Category("Surface")] + public byte UnknownByte116 + { + get => ReadByte(0x116); + set => Write(0x116, value); + } + + [Category("Surface")] + public byte UnknownByte117 + { + get => ReadByte(0x117); + set => Write(0x117, value); + } + + [Category("Surface")] + public float UnknownFloat118 + { + get => ReadFloat(0x118); + set => Write(0x118, value); + } + + [Category("Surface")] + public float UnknownFloat11C + { + get => ReadFloat(0x11C); + set => Write(0x11C, value); + } + + [Category("Surface")] + public float UnknownFloat120 + { + get => ReadFloat(0x120); + set => Write(0x120, value); + } + + [Category("Surface")] + public float UnknownFloat124 + { + get => ReadFloat(0x124); + set => Write(0x124, value); + } + + [Category("Surface")] + public float UnknownFloat128 + { + get => ReadFloat(0x128); + set => Write(0x128, value); + } + } +} \ No newline at end of file diff --git a/IndustrialPark/Assets/ObjectAssets/AssetTIMR.cs b/IndustrialPark/Assets/ObjectAssets/AssetTIMR.cs index 8b87b0bb..23c7b2e9 100644 --- a/IndustrialPark/Assets/ObjectAssets/AssetTIMR.cs +++ b/IndustrialPark/Assets/ObjectAssets/AssetTIMR.cs @@ -8,10 +8,7 @@ public class AssetTIMR : ObjectAsset { public AssetTIMR(Section_AHDR AHDR) : base(AHDR) { } - protected override int EventStartOffset - { - get => 0x10; - } + protected override int EventStartOffset => 0x10; [Category("Timer")] public float Time diff --git a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/AssetCAM.cs b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/AssetCAM.cs index 0275c145..23bdd727 100644 --- a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/AssetCAM.cs +++ b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/AssetCAM.cs @@ -14,10 +14,7 @@ public class AssetCAM : ObjectAsset, IRenderableAsset, IClickableAsset public static bool dontRender = false; - protected override int EventStartOffset - { - get => 0x88; - } + protected override int EventStartOffset => 0x88; public AssetCAM(Section_AHDR AHDR) : base(AHDR) { diff --git a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/AssetMVPT.cs b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/AssetMVPT.cs index 73450e6a..95fb6539 100644 --- a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/AssetMVPT.cs +++ b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/AssetMVPT.cs @@ -16,10 +16,7 @@ public class AssetMVPT : ObjectAsset, IRenderableAsset, IClickableAsset public static bool dontRender = false; - protected override int EventStartOffset - { - get => 0x28 + 4 * SiblingAmount; - } + protected override int EventStartOffset => 0x28 + 4 * SiblingAmount; public AssetMVPT(Section_AHDR AHDR) : base(AHDR) { diff --git a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/AssetSFX.cs b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/AssetSFX.cs index b4c68e2a..4894218c 100644 --- a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/AssetSFX.cs +++ b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/AssetSFX.cs @@ -15,7 +15,7 @@ public class AssetSFX : ObjectAsset, IRenderableAsset, IClickableAsset public static bool dontRender = false; - protected override int EventStartOffset { get => 0x30; } + protected override int EventStartOffset => 0x30; public AssetSFX(Section_AHDR AHDR) : base(AHDR) { } diff --git a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetBOUL.cs b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetBOUL.cs index 623cad31..c2f23c8d 100644 --- a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetBOUL.cs +++ b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetBOUL.cs @@ -7,9 +7,9 @@ public class AssetBOUL : PlaceableAsset { public static bool dontRender = false; - protected override bool DontRender { get => dontRender; } + protected override bool DontRender => dontRender; - protected override int EventStartOffset { get => 0x9C + Offset; } + protected override int EventStartOffset => 0x9C + Offset; public AssetBOUL(Section_AHDR AHDR) : base(AHDR) { } diff --git a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetBUTN.cs b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetBUTN.cs index 00bba6fc..c6bd8d18 100644 --- a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetBUTN.cs +++ b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetBUTN.cs @@ -1,5 +1,4 @@ using HipHopFile; -using System; using System.ComponentModel; namespace IndustrialPark @@ -8,9 +7,9 @@ public class AssetBUTN : PlaceableAsset { public static bool dontRender = false; - protected override bool DontRender { get => dontRender; } + protected override bool DontRender => dontRender; - protected override int EventStartOffset { get => 0x9C + Offset; } + protected override int EventStartOffset => 0x9C + Offset; public AssetBUTN(Section_AHDR AHDR) : base(AHDR) { } diff --git a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetDSTR.cs b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetDSTR.cs index e08ab831..eaa9b63b 100644 --- a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetDSTR.cs +++ b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetDSTR.cs @@ -7,9 +7,9 @@ public class AssetDSTR : PlaceableAsset { public static bool dontRender = false; - protected override bool DontRender { get => dontRender; } + protected override bool DontRender => dontRender; - protected override int EventStartOffset { get => 0x8C + Offset; } + protected override int EventStartOffset => 0x8C + Offset; public AssetDSTR(Section_AHDR AHDR) : base(AHDR) { } diff --git a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetEGEN.cs b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetEGEN.cs index bb478546..d5fdda53 100644 --- a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetEGEN.cs +++ b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetEGEN.cs @@ -7,11 +7,11 @@ public class AssetEGEN : PlaceableAsset { public static bool dontRender = false; - protected override bool DontRender { get => dontRender; } + protected override bool DontRender => dontRender; public AssetEGEN(Section_AHDR AHDR) : base(AHDR) { } - protected override int EventStartOffset { get => 0x6C + Offset; } + protected override int EventStartOffset => 0x6C + Offset; public override bool HasReference(uint assetID) { diff --git a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetHANG.cs b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetHANG.cs index ac1518cb..02064ef0 100644 --- a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetHANG.cs +++ b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetHANG.cs @@ -7,11 +7,11 @@ public class AssetHANG : PlaceableAsset { public static bool dontRender = false; - protected override bool DontRender { get => dontRender; } + protected override bool DontRender => dontRender; public AssetHANG(Section_AHDR AHDR) : base(AHDR) { } - protected override int EventStartOffset { get => 0x74 + Offset; } + protected override int EventStartOffset => 0x74 + Offset; [Category("Hangable")] public int UnknownInt54 diff --git a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetPEND.cs b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetPEND.cs index e3762b1f..b2cc17a6 100644 --- a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetPEND.cs +++ b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetPEND.cs @@ -7,11 +7,11 @@ public class AssetPEND : PlaceableAsset { public static bool dontRender = false; - protected override bool DontRender { get => dontRender; } + protected override bool DontRender => dontRender; public AssetPEND(Section_AHDR AHDR) : base(AHDR) { } - protected override int EventStartOffset { get => 0x84 + Offset; } + protected override int EventStartOffset => 0x84 + Offset; [Category("Pendulum")] public byte UnknownByte54 diff --git a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetPKUP.cs b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetPKUP.cs index 8b9975a8..ffe7a231 100644 --- a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetPKUP.cs +++ b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetPKUP.cs @@ -8,9 +8,9 @@ public class AssetPKUP : PlaceableAsset { public static bool dontRender = false; - protected override bool DontRender { get => dontRender; } + protected override bool DontRender => dontRender; - protected override int EventStartOffset { get => 0x5C + Offset; } + protected override int EventStartOffset => 0x5C + Offset; public AssetPKUP(Section_AHDR AHDR) : base(AHDR) { } diff --git a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetPLAT.cs b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetPLAT.cs index 8c587f52..71481ea5 100644 --- a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetPLAT.cs +++ b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetPLAT.cs @@ -8,9 +8,9 @@ public class AssetPLAT : PlaceableAsset { public static bool dontRender = false; - protected override bool DontRender { get => dontRender; } + protected override bool DontRender => dontRender; - protected override int EventStartOffset { get => 0xC0 + Offset; } + protected override int EventStartOffset => 0xC0 + Offset; public AssetPLAT(Section_AHDR AHDR) : base(AHDR) { } diff --git a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetPLYR.cs b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetPLYR.cs index c521a6b7..abc6a6eb 100644 --- a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetPLYR.cs +++ b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetPLYR.cs @@ -10,9 +10,9 @@ public class AssetPLYR : PlaceableAsset { public static bool dontRender = false; - protected override bool DontRender { get => dontRender; } + protected override bool DontRender => dontRender; - protected override int EventStartOffset { get => 0x54 + Offset; } + protected override int EventStartOffset => 0x54 + Offset; public AssetPLYR(Section_AHDR AHDR) : base(AHDR) { } diff --git a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetSIMP.cs b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetSIMP.cs index 0d6a7bbd..054a098e 100644 --- a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetSIMP.cs +++ b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetSIMP.cs @@ -7,9 +7,9 @@ public class AssetSIMP : PlaceableAsset { public static bool dontRender = false; - protected override bool DontRender { get => dontRender; } + protected override bool DontRender => dontRender; - protected override int EventStartOffset { get => 0x60 + Offset; } + protected override int EventStartOffset => 0x60 + Offset; public AssetSIMP(Section_AHDR AHDR) : base(AHDR) { } diff --git a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetTRIG.cs b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetTRIG.cs index 2fb49478..f5865953 100644 --- a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetTRIG.cs +++ b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetTRIG.cs @@ -16,9 +16,9 @@ public class AssetTRIG : PlaceableAsset { public static bool dontRender = false; - protected override bool DontRender { get => dontRender; } + protected override bool DontRender => dontRender; - protected override int EventStartOffset { get => 0x94 + Offset; } + protected override int EventStartOffset => 0x94 + Offset; public BoundingSphere boundingSphere; diff --git a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetUI.cs b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetUI.cs index c321946a..d5bf2884 100644 --- a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetUI.cs +++ b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetUI.cs @@ -10,9 +10,9 @@ public class AssetUI : PlaceableAsset { public static bool dontRender = false; - protected override bool DontRender { get => dontRender; } + protected override bool DontRender => dontRender; - protected override int EventStartOffset { get => 0x80 + Offset; } + protected override int EventStartOffset => 0x80 + Offset; public AssetUI(Section_AHDR AHDR) : base(AHDR) { diff --git a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetUIFT.cs b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetUIFT.cs index 2d9c4c5b..c0fd302b 100644 --- a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetUIFT.cs +++ b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetUIFT.cs @@ -10,9 +10,9 @@ public class AssetUIFT : AssetUI { public static new bool dontRender = false; - protected override bool DontRender { get => dontRender; } + protected override bool DontRender => dontRender; - protected override int EventStartOffset { get => 0xA4 + Offset; } + protected override int EventStartOffset => 0xA4 + Offset; public AssetUIFT(Section_AHDR AHDR) : base(AHDR) { } diff --git a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetVIL.cs b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetVIL.cs index 99b30c86..264d061d 100644 --- a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetVIL.cs +++ b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetVIL.cs @@ -7,9 +7,9 @@ public class AssetVIL : PlaceableAsset { public static bool dontRender = false; - protected override bool DontRender { get => dontRender; } + protected override bool DontRender => dontRender; - protected override int EventStartOffset { get => 0x6C + Offset; } + protected override int EventStartOffset => 0x6C + Offset; public AssetVIL(Section_AHDR AHDR) : base(AHDR) { } diff --git a/IndustrialPark/Assets/Shared/ObjectAsset.cs b/IndustrialPark/Assets/Shared/ObjectAsset.cs index 3238b257..e306256a 100644 --- a/IndustrialPark/Assets/Shared/ObjectAsset.cs +++ b/IndustrialPark/Assets/Shared/ObjectAsset.cs @@ -76,6 +76,8 @@ public bool ReceiveShadows set => Flags = (short)(value ? (Flags | (short)Mask(4)) : (Flags & (short)InvMask(4))); } + protected virtual int EventStartOffset => Data.Length - AmountOfEvents * AssetEvent.sizeOfStruct; + [Category("Object Base")] public AssetEventBFBB[] EventsBFBB { @@ -107,8 +109,6 @@ public AssetEventTSSM[] EventsTSSM } set => WriteEvents(value); } - - protected virtual int EventStartOffset { get => Data.Length - AmountOfEvents * AssetEvent.sizeOfStruct; } protected void WriteEvents(AssetEvent[] value) { diff --git a/IndustrialPark/IndustrialPark.csproj b/IndustrialPark/IndustrialPark.csproj index 646172ee..58502837 100644 --- a/IndustrialPark/IndustrialPark.csproj +++ b/IndustrialPark/IndustrialPark.csproj @@ -77,6 +77,12 @@ + + Form + + + InternalShrapnelEditor.cs + Form @@ -89,6 +95,7 @@ InternalFlyEditor.cs + @@ -96,6 +103,7 @@ + Form @@ -375,6 +383,9 @@ ViewConfig.cs + + InternalShrapnelEditor.cs + InternalGrupEditor.cs diff --git a/IndustrialPark/MainForm/AboutBox.Designer.cs b/IndustrialPark/MainForm/AboutBox.Designer.cs index 0320a803..85f2a8ba 100644 --- a/IndustrialPark/MainForm/AboutBox.Designer.cs +++ b/IndustrialPark/MainForm/AboutBox.Designer.cs @@ -103,7 +103,7 @@ private void InitializeComponent() this.labelVersion.Name = "labelVersion"; this.labelVersion.Size = new System.Drawing.Size(271, 17); this.labelVersion.TabIndex = 0; - this.labelVersion.Text = "Preview 21"; + this.labelVersion.Text = "Preview 22"; this.labelVersion.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // labelCopyright diff --git a/IndustrialPark/MainForm/MainForm.cs b/IndustrialPark/MainForm/MainForm.cs index 5e13e030..fe341a48 100644 --- a/IndustrialPark/MainForm/MainForm.cs +++ b/IndustrialPark/MainForm/MainForm.cs @@ -438,6 +438,8 @@ private void MainForm_KeyDown(object sender, KeyEventArgs e) ToggleWireFrame(); else if (e.KeyCode == Keys.G) OpenInternalEditors(); + else if (e.KeyCode == Keys.Delete) + DeleteSelectedAssets(); else if (e.KeyCode == Keys.U) uIModeToolStripMenuItem_Click(null, null); @@ -724,6 +726,12 @@ private void OpenInternalEditors() ae.OpenInternalEditors(); } + private void DeleteSelectedAssets() + { + foreach (ArchiveEditor ae in archiveEditors) + ae.DeleteSelectedAssets(); + } + private void addTextureFolderToolStripMenuItem_Click(object sender, EventArgs e) { CommonOpenFileDialog openFile = new CommonOpenFileDialog() { IsFolderPicker = true }; diff --git a/IndustrialPark/SharpDX/TextureManager.cs b/IndustrialPark/SharpDX/TextureManager.cs index c8f6ca03..3474a822 100644 --- a/IndustrialPark/SharpDX/TextureManager.cs +++ b/IndustrialPark/SharpDX/TextureManager.cs @@ -166,9 +166,21 @@ public static void ReapplyTextures() public static void SetTextureForAnimation(string diffuseMapName, string newMapName) { + List models = new List(); foreach (IAssetWithModel awm in ArchiveEditorFunctions.renderingDictionary.Values) - models.Add(awm.GetRenderWareModelFile()); + try + { + models.Add(awm.GetRenderWareModelFile()); + } + catch { } + foreach (IRenderableAsset awm in ArchiveEditorFunctions.renderableAssetSetJSP) + if (awm is AssetJSP alm) + try + { + models.Add(alm.model); + } + catch { } foreach (RenderWareModelFile m in models) foreach (SharpMesh mesh in m.meshList)