From c84cbdb3f5b116499d621616d766eeaae42ad336 Mon Sep 17 00:00:00 2001 From: igorseabra4 Date: Thu, 30 Apr 2020 03:04:27 -0300 Subject: [PATCH] add SDFX and templates --- .../ArchiveEditor/ArchiveEditorFunctions.cs | 2 +- .../ArchiveEditorFunctions_AssetEditing.cs | 5 + .../ArchiveEditorFunctions_AssetTemplates.cs | 30 +- .../ArchiveEditor/Other/AssetTemplate.cs | 2 + .../ArchiveEditor/Other/EndianConverter.cs | 12 + .../Assets/ObjectAssets/AssetSGRP.cs | 5 +- .../ObjectAssets/ClickableAssets/AssetSDFX.cs | 208 ++++++++++++++ .../PlaceableAssets/AssetPLAT.cs | 36 +-- .../Assets/Shared/AssetWithMotion.cs | 4 +- .../Assets/Shared/Enums/PlatType.cs | 10 +- .../Assets/Shared/Enums/PlatTypeSpecific.cs | 262 ------------------ IndustrialPark/IndustrialPark.csproj | 4 +- IndustrialPark/MainForm/MainForm.Designer.cs | 28 +- IndustrialPark/MainForm/MainForm.cs | 10 + IndustrialPark/Other/ProjectJson.cs | 2 + 15 files changed, 311 insertions(+), 309 deletions(-) create mode 100644 IndustrialPark/Assets/ObjectAssets/ClickableAssets/AssetSDFX.cs delete mode 100644 IndustrialPark/Assets/Shared/Enums/PlatTypeSpecific.cs diff --git a/IndustrialPark/ArchiveEditor/ArchiveEditorFunctions.cs b/IndustrialPark/ArchiveEditor/ArchiveEditorFunctions.cs index 7ccbfe0c..76358b74 100644 --- a/IndustrialPark/ArchiveEditor/ArchiveEditorFunctions.cs +++ b/IndustrialPark/ArchiveEditor/ArchiveEditorFunctions.cs @@ -443,6 +443,7 @@ private void AddAssetToDictionary(Section_AHDR AHDR, bool fast, bool skipTexture case AssetType.RWTX: newAsset = skipTexturesAndModels ? new Asset(AHDR, game, platform) : new AssetRWTX(AHDR, game, platform); break; case AssetType.SCRP: newAsset = new AssetSCRP(AHDR, game, platform); break; + case AssetType.SDFX: newAsset = new AssetSDFX(AHDR, game, platform); break; case AssetType.SFX: newAsset = new AssetSFX(AHDR, game, platform); break; case AssetType.SGRP: newAsset = new AssetSGRP(AHDR, game, platform); break; case AssetType.SIMP: newAsset = new AssetSIMP(AHDR, game, platform); break; @@ -478,7 +479,6 @@ private void AddAssetToDictionary(Section_AHDR AHDR, bool fast, bool skipTexture case AssetType.NGMS: case AssetType.PGRS: case AssetType.RANM: - case AssetType.SDFX: case AssetType.SLID: case AssetType.SPLN: case AssetType.SSET: diff --git a/IndustrialPark/ArchiveEditor/ArchiveEditorFunctions_AssetEditing.cs b/IndustrialPark/ArchiveEditor/ArchiveEditorFunctions_AssetEditing.cs index 71b3d46c..7b5eb3a0 100644 --- a/IndustrialPark/ArchiveEditor/ArchiveEditorFunctions_AssetEditing.cs +++ b/IndustrialPark/ArchiveEditor/ArchiveEditorFunctions_AssetEditing.cs @@ -602,6 +602,11 @@ public void ApplyScale(Vector3 factor) SFX.OuterRadius *= singleFactor; SFX.InnerRadius *= singleFactor; } + else if (a is AssetSGRP SGRP) + { + SGRP.OuterRadius *= singleFactor; + SGRP.InnerRadius *= singleFactor; + } else if (a is PlaceableAsset placeable && !(a is AssetPLYR || a is AssetPKUP || a is AssetUI || a is AssetUIFT || a is AssetVIL || (a is AssetDYNA DYNA && DYNA.Type_BFBB == DynaType_BFBB.game_object__Teleport))) { placeable.ScaleX *= factor.X; diff --git a/IndustrialPark/ArchiveEditor/ArchiveEditorFunctions_AssetTemplates.cs b/IndustrialPark/ArchiveEditor/ArchiveEditorFunctions_AssetTemplates.cs index bb5a3fe4..4a279d37 100644 --- a/IndustrialPark/ArchiveEditor/ArchiveEditorFunctions_AssetTemplates.cs +++ b/IndustrialPark/ArchiveEditor/ArchiveEditorFunctions_AssetTemplates.cs @@ -24,6 +24,7 @@ public static void PopulateTemplateMenusAt(ToolStripMenuItem menu, EventHandler new ToolStripMenuItem(AssetTemplate.Group.ToString()), new ToolStripMenuItem(AssetTemplate.Portal.ToString()), new ToolStripMenuItem(AssetTemplate.Script.ToString()), + new ToolStripMenuItem(AssetTemplate.SoundGroup.ToString()), new ToolStripMenuItem(AssetTemplate.Text.ToString()), new ToolStripMenuItem(AssetTemplate.Timer.ToString()), new ToolStripSeparator(), @@ -240,9 +241,10 @@ public static void PopulateTemplateMenusAt(ToolStripMenuItem menu, EventHandler new ToolStripMenuItem(AssetTemplate.Player_Generic.ToString()), new ToolStripMenuItem(AssetTemplate.SIMP_Generic.ToString()), new ToolStripMenuItem(AssetTemplate.VIL_Generic.ToString()), - new ToolStripSeparator(), new ToolStripMenuItem(AssetTemplate.UI_Generic.ToString()), new ToolStripMenuItem(AssetTemplate.UIFT_Generic.ToString()), + new ToolStripSeparator(), + new ToolStripMenuItem(AssetTemplate.SDFX.ToString()), new ToolStripMenuItem(AssetTemplate.LightEmitter_Generic.ToString()), }); foreach (ToolStripItem i in placeable.DropDownItems) @@ -589,11 +591,19 @@ public uint PlaceTemplate(Vector3 position, int layerIndex, out bool success, re dataSize = 0x14; newAssetType = AssetType.SCRP; break; + case AssetTemplate.SoundGroup: + dataSize = 0x20; + newAssetType = AssetType.SGRP; + break; case AssetTemplate.SFX_OnEvent: case AssetTemplate.SFX_OnRadius: dataSize = 0x30; newAssetType = AssetType.SFX; break; + case AssetTemplate.SDFX: + dataSize = 0x20; + newAssetType = AssetType.SDFX; + break; case AssetTemplate.ShadowTable: dataSize = 4; newAssetType = AssetType.SHDW; @@ -859,7 +869,6 @@ public uint PlaceTemplate(Vector3 position, int layerIndex, out bool success, re case AssetTemplate.Platform_Generic: ((AssetPLAT)asset).AssetType = ObjectAssetType.PLAT; ((AssetPLAT)asset).PlatformType = PlatType.Mechanism; - ((AssetPLAT)asset).PlatformSubtype = PlatTypeSpecific.Mechanism; ((AssetPLAT)asset).PlatFlags = 4; ((AssetPLAT)asset).PlatSpecific = new PlatSpecific_Generic((AssetPLAT)asset); ((AssetPLAT)asset).Motion = new Motion_Mechanism((AssetPLAT)asset); @@ -886,6 +895,15 @@ public uint PlaceTemplate(Vector3 position, int layerIndex, out bool success, re ((AssetSCRP)asset).AssetType = ObjectAssetType.SCRP; ((AssetSCRP)asset).UnknownFloat08 = 1f; break; + case AssetTemplate.SoundGroup: + ((AssetSGRP)asset).AssetType = ObjectAssetType.SGRP; + ((AssetSGRP)asset).UnknownByte0E = 0x30; + ((AssetSGRP)asset).UnknownByte0F = 0x80; + ((AssetSGRP)asset).UnknownByte13 = 0x42; + ((AssetSGRP)asset).InnerRadius = 8f; + ((AssetSGRP)asset).OuterRadius = 25f; + ((AssetSGRP)asset).SGRP_Entries = new EntrySGRP[] { new EntrySGRP() }; + break; case AssetTemplate.SoundInfo: if (asset is AssetSNDI_GCN_V1 sndi) sndi.Padding = 0xCDCDCDCD; @@ -925,6 +943,12 @@ public uint PlaceTemplate(Vector3 position, int layerIndex, out bool success, re ((AssetSFX)asset).InnerRadius = 5f; ((AssetSFX)asset).OuterRadius = 10f; break; + case AssetTemplate.SDFX: + ((AssetSDFX)asset).AssetType = ObjectAssetType.SDFX; + ((AssetSDFX)asset).PositionX = position.X; + ((AssetSDFX)asset).PositionY = position.Y; + ((AssetSDFX)asset).PositionZ = position.Z; + break; case AssetTemplate.Shiny_Red: ((AssetPKUP)asset).StateIsPersistent = persistentShinies; ((AssetPKUP)asset).Shape = 0x3E; @@ -1635,7 +1659,6 @@ public uint PlaceTemplate(Vector3 position, int layerIndex, out bool success, re ((AssetPLAT)asset).Model_AssetID = 0x55E9EAB5; ((AssetPLAT)asset).Animation_AssetID = 0x7AAA99BB; ((AssetPLAT)asset).PlatformType = PlatType.Springboard; - ((AssetPLAT)asset).PlatformSubtype = PlatTypeSpecific.Springboard; ((AssetPLAT)asset).PlatFlags = 4; ((AssetPLAT)asset).PlatSpecific = new PlatSpecific_Springboard((AssetPLAT)asset) { @@ -1654,7 +1677,6 @@ public uint PlaceTemplate(Vector3 position, int layerIndex, out bool success, re ((AssetPLAT)asset).Model_AssetID = 0x335EE0C8; ((AssetPLAT)asset).Animation_AssetID = 0x730847B6; ((AssetPLAT)asset).PlatformType = PlatType.Mechanism; - ((AssetPLAT)asset).PlatformSubtype = PlatTypeSpecific.Mechanism; ((AssetPLAT)asset).PlatFlags = 4; ((AssetPLAT)asset).Motion = new Motion_Mechanism((AssetPLAT)asset) { Type = MotionType.Other, diff --git a/IndustrialPark/ArchiveEditor/Other/AssetTemplate.cs b/IndustrialPark/ArchiveEditor/Other/AssetTemplate.cs index 8f0e60d8..3ab15d8a 100644 --- a/IndustrialPark/ArchiveEditor/Other/AssetTemplate.cs +++ b/IndustrialPark/ArchiveEditor/Other/AssetTemplate.cs @@ -12,6 +12,7 @@ public enum AssetTemplate Group, Portal, Script, + SoundGroup, Text, Timer, CamTweak, @@ -169,6 +170,7 @@ public enum AssetTemplate UIFT_Generic, SFX_OnEvent, SFX_OnRadius, + SDFX, LightEmitter_Generic, // Other diff --git a/IndustrialPark/ArchiveEditor/Other/EndianConverter.cs b/IndustrialPark/ArchiveEditor/Other/EndianConverter.cs index 62a54be0..0d4671ec 100644 --- a/IndustrialPark/ArchiveEditor/Other/EndianConverter.cs +++ b/IndustrialPark/ArchiveEditor/Other/EndianConverter.cs @@ -135,6 +135,8 @@ private Section_AHDR GetReversedEndian(Section_AHDR AHDR) ReversePRJT(ref bytes); break; case AssetType.SCRP: ReverseSCRP(ref bytes); break; + case AssetType.SDFX: + ReverseSDFX(ref bytes); break; case AssetType.SFX: ReverseSFX(ref bytes); break; case AssetType.SGRP: @@ -774,6 +776,16 @@ private void ReverseSCRP(ref List bytes) ReverseLinks(ref bytes, bytes[5]); } + private void ReverseSDFX(ref List bytes) + { + ReverseObject(ref bytes); + + for (int i = 0; i < 6; i++) + bytes.AddRange(Reverse(reader.ReadInt32())); + + ReverseLinks(ref bytes, bytes[5]); + } + private void ReverseSFX(ref List bytes) { ReverseObject(ref bytes); diff --git a/IndustrialPark/Assets/ObjectAssets/AssetSGRP.cs b/IndustrialPark/Assets/ObjectAssets/AssetSGRP.cs index 25c6a15c..13479b30 100644 --- a/IndustrialPark/Assets/ObjectAssets/AssetSGRP.cs +++ b/IndustrialPark/Assets/ObjectAssets/AssetSGRP.cs @@ -18,6 +18,7 @@ public class EntrySGRP public EntrySGRP() { Sound_AssetID = 0; + UnknownFloat04 = 0.8f; } public static int SizeOfEntry => 0x10; @@ -114,14 +115,14 @@ public byte UnknownByte13 } [Category("Sound Group"), TypeConverter(typeof(FloatTypeConverter))] - public float UnknownFloat14 + public float InnerRadius { get => ReadFloat(0x14); set => Write(0x14, value); } [Category("Sound Group"), TypeConverter(typeof(FloatTypeConverter))] - public float UnknownFloat18 + public float OuterRadius { get => ReadFloat(0x18); set => Write(0x18, value); diff --git a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/AssetSDFX.cs b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/AssetSDFX.cs new file mode 100644 index 00000000..bdae4c7f --- /dev/null +++ b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/AssetSDFX.cs @@ -0,0 +1,208 @@ +using HipHopFile; +using SharpDX; +using System.Collections.Generic; +using System.ComponentModel; +using IndustrialPark.Models; + +namespace IndustrialPark +{ + public class AssetSDFX : ObjectAsset, IRenderableAsset, IClickableAsset + { + private Matrix world; + private Matrix world2; + private BoundingBox boundingBox; + + public static bool dontRender = false; + + protected override int EventStartOffset => 0x20; + + public AssetSDFX(Section_AHDR AHDR, Game game, Platform platform) : base(AHDR, game, platform) + { + _position = new Vector3(ReadFloat(0x10), ReadFloat(0x14), ReadFloat(0x18)); + + CreateTransformMatrix(); + + if (!ArchiveEditorFunctions.renderableAssetSetTrans.Contains(this)) + ArchiveEditorFunctions.renderableAssetSetTrans.Add(this); + } + + public override bool HasReference(uint assetID) => + SoundGroup_AssetID == assetID || + Emitter_AssetID == assetID || + base.HasReference(assetID); + + public override void Verify(ref List result) + { + base.Verify(ref result); + + if (SoundGroup_AssetID == 0) + result.Add("SDFX with SoundGroup_AssetID set to 0"); + Verify(SoundGroup_AssetID, ref result); + Verify(Emitter_AssetID, ref result); + } + + public void CreateTransformMatrix() + { + world = Matrix.Scaling(_radius * 2f) * Matrix.Translation(_position); + world2 = Matrix.Scaling(_radius2 * 2f) * Matrix.Translation(_position); + + CreateBoundingBox(); + } + + public BoundingSphere boundingSphere; + + protected void CreateBoundingBox() + { + boundingSphere = new BoundingSphere(_position, _radius); + boundingBox = BoundingBox.FromSphere(boundingSphere); + } + + public float? IntersectsWith(Ray ray) + { + if (dontRender || isInvisible) + return null; + + if (ray.Intersects(ref boundingSphere)) + return TriangleIntersection(ray, SharpRenderer.sphereTriangles, SharpRenderer.sphereVertices); + return null; + } + + private float? TriangleIntersection(Ray r, List triangles, List vertices) + { + bool hasIntersected = false; + float smallestDistance = 1000f; + + foreach (Triangle t in triangles) + { + Vector3 v1 = (Vector3)Vector3.Transform(vertices[t.vertex1], world); + Vector3 v2 = (Vector3)Vector3.Transform(vertices[t.vertex2], world); + Vector3 v3 = (Vector3)Vector3.Transform(vertices[t.vertex3], world); + + if (r.Intersects(ref v1, ref v2, ref v3, out float distance)) + { + hasIntersected = true; + + if (distance < smallestDistance) + smallestDistance = distance; + } + } + + if (hasIntersected) + return smallestDistance; + else return null; + } + + public void Draw(SharpRenderer renderer) + { + if (!isSelected && (dontRender || isInvisible)) + return; + + renderer.DrawSphere(world, isSelected, renderer.sfxColor); + + if (isSelected) + renderer.DrawSphere(world2, false, renderer.sfxColor); + } + + public BoundingBox GetBoundingBox() + { + return boundingBox; + } + + public float GetDistance(Vector3 cameraPosition) + { + return Vector3.Distance(cameraPosition, _position) - _radius; + } + + private AssetSGRP soundGroup + { + get + { + foreach (var ae in Program.MainForm.archiveEditors) + if (ae.archive.ContainsAsset(SoundGroup_AssetID)) + if (ae.archive.GetFromAssetID(SoundGroup_AssetID) is AssetSGRP sgrp) + return sgrp; + return null; + } + } + + private float _radius + { + get + { + if (soundGroup != null) + return soundGroup.InnerRadius; + return 1f; + } + } + + private float _radius2 + { + get + { + if (soundGroup != null) + return soundGroup.OuterRadius; + return 1f; + } + } + + private const string categoryName = "Sound Effect"; + + [Category(categoryName)] + public AssetID SoundGroup_AssetID + { + get => ReadUInt(0x8); + set { Write(0x8, value); CreateTransformMatrix(); } + } + + [Category(categoryName)] + public AssetID Emitter_AssetID + { + get => ReadUInt(0xC); + set => Write(0xC, value); + } + + private Vector3 _position; + [Category(categoryName), TypeConverter(typeof(FloatTypeConverter))] + public float PositionX + { + get { return _position.X; } + set + { + _position.X = value; + Write(0x10, _position.X); + CreateTransformMatrix(); + } + } + + [Category(categoryName), TypeConverter(typeof(FloatTypeConverter))] + public float PositionY + { + get { return _position.Y; } + set + { + _position.Y = value; + Write(0x14, _position.Y); + CreateTransformMatrix(); + } + } + + [Category(categoryName), TypeConverter(typeof(FloatTypeConverter))] + public float PositionZ + { + get { return _position.Z; } + set + { + _position.Z = value; + Write(0x18, _position.Z); + CreateTransformMatrix(); + } + } + + [Category(categoryName), Description("0 = Normal\n4 = Play from Entity")] + public int SoundEffectFlags + { + get => ReadInt(0x1C); + set => Write(0x1C, value); + } + } +} \ No newline at end of file diff --git a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetPLAT.cs b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetPLAT.cs index 2a95f260..63bd3099 100644 --- a/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetPLAT.cs +++ b/IndustrialPark/Assets/ObjectAssets/ClickableAssets/PlaceableAssets/AssetPLAT.cs @@ -89,20 +89,14 @@ public override float PositionZ [Category("Platform")] public PlatType PlatformType { - get => (PlatType)ReadByte(0x09); + get => (PlatType)ReadByte(0x54 + Offset); set { - Write(0x09, (byte)value); - ChoosePlatSpecific(); - } - } + if ((int)value > 3) + TypeFlag = (byte)value; + else + TypeFlag = 0; - [Category("Platform")] - public PlatTypeSpecific PlatformSubtype - { - get => (PlatTypeSpecific)ReadByte(0x54 + Offset); - set - { Write(0x54 + Offset, (byte)value); ChoosePlatSpecific(); } @@ -125,7 +119,7 @@ public short PlatFlags private void ChoosePlatSpecific() { - switch (PlatformType) + switch ((PlatType)TypeFlag) { case PlatType.ConveyorBelt: PlatSpecific = new PlatSpecific_ConveryorBelt(this); @@ -153,33 +147,29 @@ private void ChoosePlatSpecific() break; } - switch (PlatformSubtype) + switch (PlatformType) { - case PlatTypeSpecific.ExtendRetract: + case PlatType.ExtendRetract: Motion = new Motion_ExtendRetract(this); break; - case PlatTypeSpecific.Orbit: + case PlatType.Orbit: Motion = new Motion_Orbit(this); break; - case PlatTypeSpecific.Spline: + case PlatType.Spline: Motion = new Motion_Spline(this); break; - case PlatTypeSpecific.Pendulum: + case PlatType.Pendulum: Motion = new Motion_Pendulum(this); break; - case PlatTypeSpecific.MovePoint: + case PlatType.MovePoint: Motion = new Motion_MovePoint(this, Position); break; default: Motion = new Motion_Mechanism(this); break; } - - PlatSpecificChosen?.Invoke(); } - public Action PlatSpecificChosen; - public override Matrix LocalWorld() { if (movementPreview) @@ -193,7 +183,7 @@ public override Matrix LocalWorld() return base.LocalWorld() * Matrix.Translation(-Position) * Matrix.Translation(skyTranslation); } - if (PlatformSubtype == PlatTypeSpecific.MovePoint) + if (PlatformType == PlatType.MovePoint) return Matrix.Scaling(_scale) * Matrix.RotationYawPitchRoll(_yaw, _pitch, _roll) * PlatLocalTranslation(); diff --git a/IndustrialPark/Assets/Shared/AssetWithMotion.cs b/IndustrialPark/Assets/Shared/AssetWithMotion.cs index aed162bb..81223dc7 100644 --- a/IndustrialPark/Assets/Shared/AssetWithMotion.cs +++ b/IndustrialPark/Assets/Shared/AssetWithMotion.cs @@ -60,7 +60,7 @@ public override Matrix LocalWorld() if (found) { - return PlatLocalRotation() * PlatLocalTranslation() + return PlatLocalTranslation() * PlatLocalRotation() * Matrix.Scaling(_scale) * Matrix.RotationYawPitchRoll(_yaw, _pitch, _roll) * Matrix.Translation(Position - driver.Position) @@ -68,7 +68,7 @@ public override Matrix LocalWorld() * Matrix.Translation((Vector3)Vector3.Transform(Vector3.Zero, driver.LocalWorld())); } - return PlatLocalRotation() * PlatLocalTranslation() + return PlatLocalTranslation() * PlatLocalRotation() * Matrix.Scaling(_scale) * Matrix.RotationYawPitchRoll(_yaw, _pitch, _roll) * Matrix.Translation(Position); diff --git a/IndustrialPark/Assets/Shared/Enums/PlatType.cs b/IndustrialPark/Assets/Shared/Enums/PlatType.cs index 3834efb7..2191a8e2 100644 --- a/IndustrialPark/Assets/Shared/Enums/PlatType.cs +++ b/IndustrialPark/Assets/Shared/Enums/PlatType.cs @@ -1,11 +1,11 @@ namespace IndustrialPark -{ +{ public enum PlatType : byte { - Platform = 0, - Type1 = 1, - Type2 = 2, - Type3 = 3, + ExtendRetract = 0, + Orbit = 1, + Spline = 2, + MovePoint = 3, Mechanism = 4, Pendulum = 5, ConveyorBelt = 6, diff --git a/IndustrialPark/Assets/Shared/Enums/PlatTypeSpecific.cs b/IndustrialPark/Assets/Shared/Enums/PlatTypeSpecific.cs deleted file mode 100644 index f509ecb0..00000000 --- a/IndustrialPark/Assets/Shared/Enums/PlatTypeSpecific.cs +++ /dev/null @@ -1,262 +0,0 @@ -namespace IndustrialPark -{ - public enum PlatTypeSpecific : byte - { - ExtendRetract = 0, - Orbit = 1, - Spline = 2, - MovePoint = 3, - Mechanism = 4, - Pendulum = 5, - ConveyorBelt = 6, - Type7 = 7, - Type8 = 8, - BreakawayPlatform = 9, - Springboard = 10, - TeeterTotter = 11, - Paddle = 12, - FullyManipulable = 13, - Type14 = 14, - Type15 = 15, - Type16 = 16, - Type17 = 17, - Type18 = 18, - Type19 = 19, - Type20 = 20, - Type21 = 21, - Type22 = 22, - Type23 = 23, - Type24 = 24, - Type25 = 25, - Type26 = 26, - Type27 = 27, - Type28 = 28, - Type29 = 29, - Type30 = 30, - Type31 = 31, - Type32 = 32, - Type33 = 33, - Type34 = 34, - Type35 = 35, - Type36 = 36, - Type37 = 37, - Type38 = 38, - Type39 = 39, - Type40 = 40, - Type41 = 41, - Type42 = 42, - Type43 = 43, - Type44 = 44, - Type45 = 45, - Type46 = 46, - Type47 = 47, - Type48 = 48, - Type49 = 49, - Type50 = 50, - Type51 = 51, - Type52 = 52, - Type53 = 53, - Type54 = 54, - Type55 = 55, - Type56 = 56, - Type57 = 57, - Type58 = 58, - Type59 = 59, - Type60 = 60, - Type61 = 61, - Type62 = 62, - Type63 = 63, - Type64 = 64, - Type65 = 65, - Type66 = 66, - Type67 = 67, - Type68 = 68, - Type69 = 69, - Type70 = 70, - Type71 = 71, - Type72 = 72, - Type73 = 73, - Type74 = 74, - Type75 = 75, - Type76 = 76, - Type77 = 77, - Type78 = 78, - Type79 = 79, - Type80 = 80, - Type81 = 81, - Type82 = 82, - Type83 = 83, - Type84 = 84, - Type85 = 85, - Type86 = 86, - Type87 = 87, - Type88 = 88, - Type89 = 89, - Type90 = 90, - Type91 = 91, - Type92 = 92, - Type93 = 93, - Type94 = 94, - Type95 = 95, - Type96 = 96, - Type97 = 97, - Type98 = 98, - Type99 = 99, - Type100 = 100, - Type101 = 101, - Type102 = 102, - Type103 = 103, - Type104 = 104, - Type105 = 105, - Type106 = 106, - Type107 = 107, - Type108 = 108, - Type109 = 109, - Type110 = 110, - Type111 = 111, - Type112 = 112, - Type113 = 113, - Type114 = 114, - Type115 = 115, - Type116 = 116, - Type117 = 117, - Type118 = 118, - Type119 = 119, - Type120 = 120, - Type121 = 121, - Type122 = 122, - Type123 = 123, - Type124 = 124, - Type125 = 125, - Type126 = 126, - Type127 = 127, - Type128 = 128, - Type129 = 129, - Type130 = 130, - Type131 = 131, - Type132 = 132, - Type133 = 133, - Type134 = 134, - Type135 = 135, - Type136 = 136, - Type137 = 137, - Type138 = 138, - Type139 = 139, - Type140 = 140, - Type141 = 141, - Type142 = 142, - Type143 = 143, - Type144 = 144, - Type145 = 145, - Type146 = 146, - Type147 = 147, - Type148 = 148, - Type149 = 149, - Type150 = 150, - Type151 = 151, - Type152 = 152, - Type153 = 153, - Type154 = 154, - Type155 = 155, - Type156 = 156, - Type157 = 157, - Type158 = 158, - Type159 = 159, - Type160 = 160, - Type161 = 161, - Type162 = 162, - Type163 = 163, - Type164 = 164, - Type165 = 165, - Type166 = 166, - Type167 = 167, - Type168 = 168, - Type169 = 169, - Type170 = 170, - Type171 = 171, - Type172 = 172, - Type173 = 173, - Type174 = 174, - Type175 = 175, - Type176 = 176, - Type177 = 177, - Type178 = 178, - Type179 = 179, - Type180 = 180, - Type181 = 181, - Type182 = 182, - Type183 = 183, - Type184 = 184, - Type185 = 185, - Type186 = 186, - Type187 = 187, - Type188 = 188, - Type189 = 189, - Type190 = 190, - Type191 = 191, - Type192 = 192, - Type193 = 193, - Type194 = 194, - Type195 = 195, - Type196 = 196, - Type197 = 197, - Type198 = 198, - Type199 = 199, - Type200 = 200, - Type201 = 201, - Type202 = 202, - Type203 = 203, - Type204 = 204, - Type205 = 205, - Type206 = 206, - Type207 = 207, - Type208 = 208, - Type209 = 209, - Type210 = 210, - Type211 = 211, - Type212 = 212, - Type213 = 213, - Type214 = 214, - Type215 = 215, - Type216 = 216, - Type217 = 217, - Type218 = 218, - Type219 = 219, - Type220 = 220, - Type221 = 221, - Type222 = 222, - Type223 = 223, - Type224 = 224, - Type225 = 225, - Type226 = 226, - Type227 = 227, - Type228 = 228, - Type229 = 229, - Type230 = 230, - Type231 = 231, - Type232 = 232, - Type233 = 233, - Type234 = 234, - Type235 = 235, - Type236 = 236, - Type237 = 237, - Type238 = 238, - Type239 = 239, - Type240 = 240, - Type241 = 241, - Type242 = 242, - Type243 = 243, - Type244 = 244, - Type245 = 245, - Type246 = 246, - Type247 = 247, - Type248 = 248, - Type249 = 249, - Type250 = 250, - Type251 = 251, - Type252 = 252, - Type253 = 253, - Type254 = 254, - Type255 = 255 - } -} \ No newline at end of file diff --git a/IndustrialPark/IndustrialPark.csproj b/IndustrialPark/IndustrialPark.csproj index fc7dcbdf..069b304f 100644 --- a/IndustrialPark/IndustrialPark.csproj +++ b/IndustrialPark/IndustrialPark.csproj @@ -184,6 +184,7 @@ + @@ -238,7 +239,7 @@ - + @@ -353,7 +354,6 @@ - diff --git a/IndustrialPark/MainForm/MainForm.Designer.cs b/IndustrialPark/MainForm/MainForm.Designer.cs index b6d4fe3a..94e014e8 100644 --- a/IndustrialPark/MainForm/MainForm.Designer.cs +++ b/IndustrialPark/MainForm/MainForm.Designer.cs @@ -72,6 +72,7 @@ private void InitializeComponent() this.toolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.saveAllOpenHIPsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.runGameF5ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.stopSoundToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator(); this.manageUserTemplatesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.templatesPersistentShiniesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -127,7 +128,7 @@ private void InitializeComponent() this.toolStripMenuItem_Templates = new System.Windows.Forms.ToolStripMenuItem(); this.userTemplateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripComboBoxUserTemplate = new System.Windows.Forms.ToolStripComboBox(); - this.stopSoundToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.sDFXToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.menuStrip1.SuspendLayout(); this.statusStrip1.SuspendLayout(); this.contextMenuStripMain.SuspendLayout(); @@ -469,6 +470,13 @@ private void InitializeComponent() this.runGameF5ToolStripMenuItem.Text = "Run Game (F5)"; this.runGameF5ToolStripMenuItem.Click += new System.EventHandler(this.runGameF5ToolStripMenuItem_Click); // + // stopSoundToolStripMenuItem + // + this.stopSoundToolStripMenuItem.Name = "stopSoundToolStripMenuItem"; + this.stopSoundToolStripMenuItem.Size = new System.Drawing.Size(271, 22); + this.stopSoundToolStripMenuItem.Text = "Stop Sound"; + this.stopSoundToolStripMenuItem.Click += new System.EventHandler(this.stopSoundToolStripMenuItem_Click); + // // toolStripSeparator8 // this.toolStripSeparator8.Name = "toolStripSeparator8"; @@ -564,6 +572,7 @@ private void InitializeComponent() this.pKUPToolStripMenuItem, this.pLATToolStripMenuItem, this.pLYRToolStripMenuItem, + this.sDFXToolStripMenuItem, this.sFXToolStripMenuItem, this.sIMPToolStripMenuItem, this.tRIGToolStripMenuItem, @@ -797,14 +806,14 @@ private void InitializeComponent() // assetIDGeneratorToolStripMenuItem // this.assetIDGeneratorToolStripMenuItem.Name = "assetIDGeneratorToolStripMenuItem"; - this.assetIDGeneratorToolStripMenuItem.Size = new System.Drawing.Size(171, 22); + this.assetIDGeneratorToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.assetIDGeneratorToolStripMenuItem.Text = "Asset ID Generator"; this.assetIDGeneratorToolStripMenuItem.Click += new System.EventHandler(this.assetIDGeneratorToolStripMenuItem_Click); // // eventSearchToolStripMenuItem // this.eventSearchToolStripMenuItem.Name = "eventSearchToolStripMenuItem"; - this.eventSearchToolStripMenuItem.Size = new System.Drawing.Size(171, 22); + this.eventSearchToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.eventSearchToolStripMenuItem.Text = "Event Search"; this.eventSearchToolStripMenuItem.Click += new System.EventHandler(this.eventSearchToolStripMenuItem_Click); // @@ -936,12 +945,14 @@ private void InitializeComponent() this.toolStripComboBoxUserTemplate.Size = new System.Drawing.Size(160, 23); this.toolStripComboBoxUserTemplate.SelectedIndexChanged += new System.EventHandler(this.toolStripComboBoxUserTemplate_SelectedIndexChanged); // - // stopSoundToolStripMenuItem + // sDFXToolStripMenuItem // - this.stopSoundToolStripMenuItem.Name = "stopSoundToolStripMenuItem"; - this.stopSoundToolStripMenuItem.Size = new System.Drawing.Size(271, 22); - this.stopSoundToolStripMenuItem.Text = "Stop Sound"; - this.stopSoundToolStripMenuItem.Click += new System.EventHandler(this.stopSoundToolStripMenuItem_Click); + this.sDFXToolStripMenuItem.Checked = true; + this.sDFXToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; + this.sDFXToolStripMenuItem.Name = "sDFXToolStripMenuItem"; + this.sDFXToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.sDFXToolStripMenuItem.Text = "SDFX"; + this.sDFXToolStripMenuItem.Click += new System.EventHandler(this.sDFXToolStripMenuItem_Click); // // MainForm // @@ -1073,6 +1084,7 @@ private void InitializeComponent() private ToolStripMenuItem refreshTexturesToolStripMenuItem; private ToolStripMenuItem downloadVgmstreamToolStripMenuItem; private ToolStripMenuItem stopSoundToolStripMenuItem; + private ToolStripMenuItem sDFXToolStripMenuItem; } } diff --git a/IndustrialPark/MainForm/MainForm.cs b/IndustrialPark/MainForm/MainForm.cs index 5d0efcb5..385cfb0e 100644 --- a/IndustrialPark/MainForm/MainForm.cs +++ b/IndustrialPark/MainForm/MainForm.cs @@ -334,6 +334,7 @@ public ProjectJson FromCurrentInstance() dontRenderPKUP = AssetPKUP.dontRender, dontRenderPLAT = AssetPLAT.dontRender, dontRenderPLYR = AssetPLYR.dontRender, + dontRenderSDFX = AssetSDFX.dontRender, dontRenderSFX = AssetSFX.dontRender, dontRenderSIMP = AssetSIMP.dontRender, dontRenderTRIG = AssetTRIG.dontRender, @@ -465,6 +466,9 @@ private void ApplySettings(ProjectJson ipSettings) sFXToolStripMenuItem.Checked = !ipSettings.dontRenderSFX; AssetSFX.dontRender = ipSettings.dontRenderSFX; + sDFXToolStripMenuItem.Checked = !ipSettings.dontRenderSDFX; + AssetSDFX.dontRender = ipSettings.dontRenderSDFX; + sIMPToolStripMenuItem.Checked = !ipSettings.dontRenderSIMP; AssetSIMP.dontRender = ipSettings.dontRenderSIMP; @@ -998,6 +1002,12 @@ private void sFXToolStripMenuItem_Click(object sender, EventArgs e) AssetSFX.dontRender = !sFXToolStripMenuItem.Checked; } + private void sDFXToolStripMenuItem_Click(object sender, EventArgs e) + { + sDFXToolStripMenuItem.Checked = !sDFXToolStripMenuItem.Checked; + AssetSDFX.dontRender = !sDFXToolStripMenuItem.Checked; + } + private void dYNAToolStripMenuItem_Click(object sender, EventArgs e) { dYNAToolStripMenuItem.Checked = !dYNAToolStripMenuItem.Checked; diff --git a/IndustrialPark/Other/ProjectJson.cs b/IndustrialPark/Other/ProjectJson.cs index ec01da19..93010707 100644 --- a/IndustrialPark/Other/ProjectJson.cs +++ b/IndustrialPark/Other/ProjectJson.cs @@ -52,6 +52,7 @@ public class ProjectJson public bool dontRenderPKUP; public bool dontRenderPLAT; public bool dontRenderPLYR; + public bool dontRenderSDFX; public bool dontRenderSFX; public bool dontRenderSIMP; public bool dontRenderTRIG; @@ -106,6 +107,7 @@ public ProjectJson() dontRenderPKUP = false; dontRenderPLAT = false; dontRenderPLYR = false; + dontRenderSDFX = false; dontRenderSFX = false; dontRenderSIMP = false; dontRenderTRIG = false;