Update Ambient Zones, Rules and Static Emitters

This commit is contained in:
ook3d 2023-12-21 15:35:34 -05:00
parent 50c10da04d
commit af32c5ab32
8 changed files with 1501 additions and 1722 deletions

File diff suppressed because it is too large Load Diff

View File

@ -162,29 +162,29 @@ namespace CodeWalker.World
switch (zone.Shape)
{
case Dat151ZoneShape.Box:
InnerPos = zone.PlaybackZonePosition;
InnerMax = zone.PlaybackZoneSize * 0.5f;
InnerPos = zone.PositioningZoneCentre;
InnerMax = zone.PositioningZoneSize * 0.5f;
InnerMin = -InnerMax;
InnerOri = Quaternion.RotationAxis(Vector3.UnitZ, zone.PlaybackZoneAngle * deg2rad);
InnerOri = Quaternion.RotationAxis(Vector3.UnitZ, zone.PositioningZoneRotationAngle * deg2rad);
break;
case Dat151ZoneShape.Sphere:
InnerPos = zone.PlaybackZonePosition;
InnerPos = zone.PositioningZoneCentre;
InnerOri = Quaternion.Identity;
InnerRadius = zone.PlaybackZoneSize.X;
InnerRadius = zone.PositioningZoneSize.X;
OuterRadius = zone.ActivationZoneSize.X;
break;
case Dat151ZoneShape.Line:
InnerPos = zone.PlaybackZonePosition;
InnerPos = zone.PositioningZoneCentre;
InnerMin = new Vector3(-1.0f, -1.0f, 0.0f);
InnerMax = new Vector3(1.0f, 1.0f, (zone.PlaybackZoneSize - zone.PlaybackZonePosition).Length());
InnerOri = Quaternion.Invert(Quaternion.LookAtLH(zone.PlaybackZonePosition, zone.PlaybackZoneSize, Vector3.UnitZ));
InnerMax = new Vector3(1.0f, 1.0f, (zone.PositioningZoneSize - zone.PositioningZoneCentre).Length());
InnerOri = Quaternion.Invert(Quaternion.LookAtLH(zone.PositioningZoneCentre, zone.PositioningZoneSize, Vector3.UnitZ));
break;
}
OuterPos = zone.ActivationZonePosition;
OuterPos = zone.ActivationZoneCentre;
OuterMax = zone.ActivationZoneSize * 0.5f;
OuterMin = -OuterMax;
OuterOri = Quaternion.RotationAxis(Vector3.UnitZ, zone.ActivationZoneAngle * deg2rad);
OuterOri = Quaternion.RotationAxis(Vector3.UnitZ, zone.ActivationZoneRotationAngle * deg2rad);
bool useouter = ((InnerMax.X == 0) || (InnerMax.Y == 0) || (InnerMax.Z == 0));
if (useouter && (zone.Shape != Dat151ZoneShape.Sphere))
@ -215,8 +215,8 @@ namespace CodeWalker.World
OrientationInv = Quaternion.Identity;
InnerPos = emitter.Position;
OuterPos = InnerPos;
InnerRadius = emitter.InnerRadius;
OuterRadius = emitter.OuterRadius;
InnerRadius = emitter.MinDist;
OuterRadius = emitter.MaxDist;
bool useouter = (InnerRadius == 0);
if (useouter)
@ -239,8 +239,8 @@ namespace CodeWalker.World
if (AudioZone != null)
{
AudioZone.PlaybackZonePosition = InnerPos;
AudioZone.ActivationZonePosition = OuterPos;
AudioZone.PositioningZoneCentre = InnerPos;
AudioZone.ActivationZoneCentre = OuterPos;
}
if (AudioEmitter != null)
{
@ -266,8 +266,8 @@ namespace CodeWalker.World
OuterOri = Orientation;
if (AudioZone != null)
{
AudioZone.PlaybackZoneAngle = uangl;
AudioZone.ActivationZoneAngle = uangl;
AudioZone.PositioningZoneRotationAngle = (ushort)uangl;
AudioZone.ActivationZoneRotationAngle = (ushort)uangl;
}
}
else
@ -280,7 +280,7 @@ namespace CodeWalker.World
OuterOri = Orientation;
if (AudioZone != null)
{
AudioZone.ActivationZoneAngle = uangl;
AudioZone.ActivationZoneRotationAngle = (ushort)uangl;
}
}
else
@ -288,7 +288,7 @@ namespace CodeWalker.World
InnerOri = Orientation;
if (AudioZone != null)
{
AudioZone.PlaybackZoneAngle = uangl;
AudioZone.PositioningZoneRotationAngle = (ushort)uangl;
}
}
}

View File

@ -32,6 +32,12 @@
this.GoToButton = new System.Windows.Forms.Button();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.label25 = new System.Windows.Forms.Label();
this.label24 = new System.Windows.Forms.Label();
this.label11 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.Unk13UpDown = new System.Windows.Forms.NumericUpDown();
this.Unk12UpDown = new System.Windows.Forms.NumericUpDown();
this.Unk11UpDown = new System.Windows.Forms.NumericUpDown();
@ -46,8 +52,6 @@
this.Flags5TextBox = new System.Windows.Forms.TextBox();
this.label22 = new System.Windows.Forms.Label();
this.Flags4TextBox = new System.Windows.Forms.TextBox();
this.label19 = new System.Windows.Forms.Label();
this.Flags3TextBox = new System.Windows.Forms.TextBox();
this.DeleteButton = new System.Windows.Forms.Button();
this.AddToProjectButton = new System.Windows.Forms.Button();
this.label21 = new System.Windows.Forms.Label();
@ -57,10 +61,6 @@
this.label15 = new System.Windows.Forms.Label();
this.label17 = new System.Windows.Forms.Label();
this.label18 = new System.Windows.Forms.Label();
this.label14 = new System.Windows.Forms.Label();
this.Flags1TextBox = new System.Windows.Forms.TextBox();
this.label13 = new System.Windows.Forms.Label();
this.Flags0TextBox = new System.Windows.Forms.TextBox();
this.label12 = new System.Windows.Forms.Label();
this.NameTextBox = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
@ -77,9 +77,6 @@
this.InnerRadiusTextBox = new System.Windows.Forms.TextBox();
this.label16 = new System.Windows.Forms.Label();
this.PositionTextBox = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.Unk13UpDown)).BeginInit();
@ -119,6 +116,9 @@
//
// tabPage1
//
this.tabPage1.Controls.Add(this.label25);
this.tabPage1.Controls.Add(this.label24);
this.tabPage1.Controls.Add(this.label11);
this.tabPage1.Controls.Add(this.label9);
this.tabPage1.Controls.Add(this.label8);
this.tabPage1.Controls.Add(this.label5);
@ -136,8 +136,6 @@
this.tabPage1.Controls.Add(this.Flags5TextBox);
this.tabPage1.Controls.Add(this.label22);
this.tabPage1.Controls.Add(this.Flags4TextBox);
this.tabPage1.Controls.Add(this.label19);
this.tabPage1.Controls.Add(this.Flags3TextBox);
this.tabPage1.Controls.Add(this.DeleteButton);
this.tabPage1.Controls.Add(this.AddToProjectButton);
this.tabPage1.Controls.Add(this.label21);
@ -147,10 +145,6 @@
this.tabPage1.Controls.Add(this.label15);
this.tabPage1.Controls.Add(this.label17);
this.tabPage1.Controls.Add(this.label18);
this.tabPage1.Controls.Add(this.label14);
this.tabPage1.Controls.Add(this.Flags1TextBox);
this.tabPage1.Controls.Add(this.label13);
this.tabPage1.Controls.Add(this.Flags0TextBox);
this.tabPage1.Controls.Add(this.label12);
this.tabPage1.Controls.Add(this.NameTextBox);
this.tabPage1.Controls.Add(this.label6);
@ -175,9 +169,63 @@
this.tabPage1.Text = "Ambient Emitter";
this.tabPage1.UseVisualStyleBackColor = true;
//
// label25
//
this.label25.AutoSize = true;
this.label25.Location = new System.Drawing.Point(354, 109);
this.label25.Name = "label25";
this.label25.Size = new System.Drawing.Size(81, 13);
this.label25.TabIndex = 88;
this.label25.Text = "Position Usage:";
//
// label24
//
this.label24.AutoSize = true;
this.label24.Location = new System.Drawing.Point(7, 380);
this.label24.Name = "label24";
this.label24.Size = new System.Drawing.Size(112, 13);
this.label24.TabIndex = 87;
this.label24.Text = "Max Global Instances:";
//
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(7, 354);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(87, 13);
this.label11.TabIndex = 86;
this.label11.Text = "Max Path Depth:";
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(192, 178);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(78, 13);
this.label9.TabIndex = 45;
this.label9.Text = "(game minutes)";
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(7, 203);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(55, 13);
this.label8.TabIndex = 46;
this.label8.Text = "End Time:";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(7, 253);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(94, 13);
this.label5.TabIndex = 50;
this.label5.Text = "Max Repeat Time:";
//
// Unk13UpDown
//
this.Unk13UpDown.Location = new System.Drawing.Point(138, 325);
this.Unk13UpDown.Location = new System.Drawing.Point(126, 352);
this.Unk13UpDown.Maximum = new decimal(new int[] {
255,
0,
@ -190,7 +238,7 @@
//
// Unk12UpDown
//
this.Unk12UpDown.Location = new System.Drawing.Point(84, 325);
this.Unk12UpDown.Location = new System.Drawing.Point(126, 326);
this.Unk12UpDown.Maximum = new decimal(new int[] {
255,
0,
@ -203,7 +251,7 @@
//
// Unk11UpDown
//
this.Unk11UpDown.Location = new System.Drawing.Point(138, 301);
this.Unk11UpDown.Location = new System.Drawing.Point(126, 378);
this.Unk11UpDown.Maximum = new decimal(new int[] {
255,
0,
@ -216,7 +264,7 @@
//
// Unk10UpDown
//
this.Unk10UpDown.Location = new System.Drawing.Point(84, 301);
this.Unk10UpDown.Location = new System.Drawing.Point(126, 302);
this.Unk10UpDown.Maximum = new decimal(new int[] {
255,
0,
@ -229,7 +277,7 @@
//
// Unk09UpDown
//
this.Unk09UpDown.Location = new System.Drawing.Point(138, 277);
this.Unk09UpDown.Location = new System.Drawing.Point(451, 107);
this.Unk09UpDown.Maximum = new decimal(new int[] {
255,
0,
@ -242,7 +290,7 @@
//
// Unk07UpDown
//
this.Unk07UpDown.Location = new System.Drawing.Point(84, 251);
this.Unk07UpDown.Location = new System.Drawing.Point(104, 253);
this.Unk07UpDown.Maximum = new decimal(new int[] {
65535,
0,
@ -255,7 +303,7 @@
//
// Unk08UpDown
//
this.Unk08UpDown.Location = new System.Drawing.Point(84, 277);
this.Unk08UpDown.Location = new System.Drawing.Point(126, 278);
this.Unk08UpDown.Maximum = new decimal(new int[] {
255,
0,
@ -268,7 +316,7 @@
//
// FrequencyUpDown
//
this.FrequencyUpDown.Location = new System.Drawing.Point(84, 227);
this.FrequencyUpDown.Location = new System.Drawing.Point(104, 228);
this.FrequencyUpDown.Maximum = new decimal(new int[] {
65535,
0,
@ -309,16 +357,16 @@
//
this.label23.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label23.AutoSize = true;
this.label23.Location = new System.Drawing.Point(340, 178);
this.label23.Location = new System.Drawing.Point(339, 84);
this.label23.Name = "label23";
this.label23.Size = new System.Drawing.Size(44, 13);
this.label23.Size = new System.Drawing.Size(49, 13);
this.label23.TabIndex = 80;
this.label23.Text = "Flags 5:";
this.label23.Text = "Bank ID:";
//
// Flags5TextBox
//
this.Flags5TextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.Flags5TextBox.Location = new System.Drawing.Point(390, 175);
this.Flags5TextBox.Location = new System.Drawing.Point(389, 81);
this.Flags5TextBox.Name = "Flags5TextBox";
this.Flags5TextBox.Size = new System.Drawing.Size(155, 20);
this.Flags5TextBox.TabIndex = 81;
@ -328,40 +376,21 @@
//
this.label22.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label22.AutoSize = true;
this.label22.Location = new System.Drawing.Point(340, 154);
this.label22.Location = new System.Drawing.Point(326, 60);
this.label22.Name = "label22";
this.label22.Size = new System.Drawing.Size(44, 13);
this.label22.Size = new System.Drawing.Size(65, 13);
this.label22.TabIndex = 78;
this.label22.Text = "Flags 4:";
this.label22.Text = "Last Played:";
//
// Flags4TextBox
//
this.Flags4TextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.Flags4TextBox.Location = new System.Drawing.Point(390, 151);
this.Flags4TextBox.Location = new System.Drawing.Point(389, 57);
this.Flags4TextBox.Name = "Flags4TextBox";
this.Flags4TextBox.Size = new System.Drawing.Size(155, 20);
this.Flags4TextBox.TabIndex = 79;
this.Flags4TextBox.TextChanged += new System.EventHandler(this.Flags4TextBox_TextChanged);
//
// label19
//
this.label19.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label19.AutoSize = true;
this.label19.Location = new System.Drawing.Point(340, 130);
this.label19.Name = "label19";
this.label19.Size = new System.Drawing.Size(44, 13);
this.label19.TabIndex = 76;
this.label19.Text = "Flags 3:";
//
// Flags3TextBox
//
this.Flags3TextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.Flags3TextBox.Location = new System.Drawing.Point(390, 127);
this.Flags3TextBox.Name = "Flags3TextBox";
this.Flags3TextBox.Size = new System.Drawing.Size(155, 20);
this.Flags3TextBox.TabIndex = 77;
this.Flags3TextBox.TextChanged += new System.EventHandler(this.Flags3TextBox_TextChanged);
//
// DeleteButton
//
this.DeleteButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
@ -388,16 +417,16 @@
//
this.label21.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label21.AutoSize = true;
this.label21.Location = new System.Drawing.Point(340, 106);
this.label21.Location = new System.Drawing.Point(339, 33);
this.label21.Name = "label21";
this.label21.Size = new System.Drawing.Size(44, 13);
this.label21.Size = new System.Drawing.Size(35, 13);
this.label21.TabIndex = 74;
this.label21.Text = "Flags 2:";
this.label21.Text = "Flags:";
//
// Flags2TextBox
//
this.Flags2TextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.Flags2TextBox.Location = new System.Drawing.Point(390, 103);
this.Flags2TextBox.Location = new System.Drawing.Point(389, 30);
this.Flags2TextBox.Name = "Flags2TextBox";
this.Flags2TextBox.Size = new System.Drawing.Size(155, 20);
this.Flags2TextBox.TabIndex = 75;
@ -407,11 +436,11 @@
//
this.label20.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label20.AutoSize = true;
this.label20.Location = new System.Drawing.Point(305, 241);
this.label20.Location = new System.Drawing.Point(293, 253);
this.label20.Name = "label20";
this.label20.Size = new System.Drawing.Size(160, 26);
this.label20.Size = new System.Drawing.Size(59, 13);
this.label20.TabIndex = 82;
this.label20.Text = "Ext params:\r\nName (hash), Value (float), Flags";
this.label20.Text = "Conditions:";
//
// VariablesTextBox
//
@ -430,65 +459,27 @@
this.label15.AutoSize = true;
this.label15.Location = new System.Drawing.Point(7, 328);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(63, 13);
this.label15.Size = new System.Drawing.Size(96, 13);
this.label15.TabIndex = 58;
this.label15.Text = "Unk 12, 13:";
this.label15.Text = "Blockability Factor:";
//
// label17
//
this.label17.AutoSize = true;
this.label17.Location = new System.Drawing.Point(7, 304);
this.label17.Name = "label17";
this.label17.Size = new System.Drawing.Size(63, 13);
this.label17.Size = new System.Drawing.Size(108, 13);
this.label17.TabIndex = 55;
this.label17.Text = "Unk 10, 11:";
this.label17.Text = "Max Local Instances:";
//
// label18
//
this.label18.AutoSize = true;
this.label18.Location = new System.Drawing.Point(7, 280);
this.label18.Name = "label18";
this.label18.Size = new System.Drawing.Size(51, 13);
this.label18.Size = new System.Drawing.Size(77, 13);
this.label18.TabIndex = 52;
this.label18.Text = "Unk 8, 9:";
//
// label14
//
this.label14.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label14.AutoSize = true;
this.label14.Location = new System.Drawing.Point(340, 82);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(44, 13);
this.label14.TabIndex = 72;
this.label14.Text = "Flags 1:";
//
// Flags1TextBox
//
this.Flags1TextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.Flags1TextBox.Location = new System.Drawing.Point(390, 79);
this.Flags1TextBox.Name = "Flags1TextBox";
this.Flags1TextBox.Size = new System.Drawing.Size(155, 20);
this.Flags1TextBox.TabIndex = 73;
this.Flags1TextBox.TextChanged += new System.EventHandler(this.Flags1TextBox_TextChanged);
//
// label13
//
this.label13.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label13.AutoSize = true;
this.label13.Location = new System.Drawing.Point(340, 58);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(44, 13);
this.label13.TabIndex = 70;
this.label13.Text = "Flags 0:";
//
// Flags0TextBox
//
this.Flags0TextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.Flags0TextBox.Location = new System.Drawing.Point(390, 55);
this.Flags0TextBox.Name = "Flags0TextBox";
this.Flags0TextBox.Size = new System.Drawing.Size(155, 20);
this.Flags0TextBox.TabIndex = 71;
this.Flags0TextBox.TextChanged += new System.EventHandler(this.Flags0TextBox_TextChanged);
this.label18.Text = "Spawn Height:";
//
// label12
//
@ -514,9 +505,9 @@
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(7, 230);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(39, 13);
this.label6.Size = new System.Drawing.Size(91, 13);
this.label6.TabIndex = 48;
this.label6.Text = "Unk 6:";
this.label6.Text = "Min Repeat Time:";
//
// label7
//
@ -551,9 +542,9 @@
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(7, 154);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(39, 13);
this.label4.Size = new System.Drawing.Size(44, 13);
this.label4.TabIndex = 41;
this.label4.Text = "Unk 1:";
this.label4.Text = "Weight:";
//
// Unk01TextBox
//
@ -570,9 +561,9 @@
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(7, 130);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(44, 13);
this.label3.Size = new System.Drawing.Size(52, 13);
this.label3.TabIndex = 39;
this.label3.Text = "Hash 2:";
this.label3.Text = "Category:";
//
// CategoryTextBox
//
@ -589,9 +580,9 @@
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(7, 106);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(44, 13);
this.label2.Size = new System.Drawing.Size(67, 13);
this.label2.TabIndex = 37;
this.label2.Text = "Hash 1:";
this.label2.Text = "Child Sound:";
//
// ChildSoundTextBox
//
@ -641,33 +632,6 @@
this.PositionTextBox.TabIndex = 32;
this.PositionTextBox.TextChanged += new System.EventHandler(this.PositionTextBox_TextChanged);
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(7, 253);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(39, 13);
this.label5.TabIndex = 50;
this.label5.Text = "Unk 7:";
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(7, 203);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(55, 13);
this.label8.TabIndex = 46;
this.label8.Text = "End Time:";
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(192, 178);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(78, 13);
this.label9.TabIndex = 45;
this.label9.Text = "(game minutes)";
//
// EditAudioEmitterPanel
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -709,10 +673,6 @@
private System.Windows.Forms.Label label15;
private System.Windows.Forms.Label label17;
private System.Windows.Forms.Label label18;
private System.Windows.Forms.Label label14;
private System.Windows.Forms.TextBox Flags1TextBox;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.TextBox Flags0TextBox;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.TextBox NameTextBox;
private System.Windows.Forms.Label label6;
@ -733,8 +693,6 @@
private System.Windows.Forms.TextBox Flags5TextBox;
private System.Windows.Forms.Label label22;
private System.Windows.Forms.TextBox Flags4TextBox;
private System.Windows.Forms.Label label19;
private System.Windows.Forms.TextBox Flags3TextBox;
private System.Windows.Forms.NumericUpDown FrequencyUpDown;
private System.Windows.Forms.NumericUpDown EndTimeUpDown;
private System.Windows.Forms.NumericUpDown StartTimeUpDown;
@ -748,5 +706,8 @@
private System.Windows.Forms.Label label9;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.Label label25;
private System.Windows.Forms.Label label24;
}
}

View File

@ -66,10 +66,7 @@ namespace CodeWalker.Project.Panels
Unk11UpDown.Value = 0;
Unk12UpDown.Value = 0;
Unk13UpDown.Value = 0;
Flags0TextBox.Text = string.Empty;
Flags1TextBox.Text = string.Empty;
Flags2TextBox.Text = string.Empty;
Flags3TextBox.Text = string.Empty;
Flags4TextBox.Text = string.Empty;
Flags5TextBox.Text = string.Empty;
VariablesTextBox.Text = string.Empty;
@ -84,38 +81,35 @@ namespace CodeWalker.Project.Panels
var e = CurrentEmitter.AudioEmitter;
NameTextBox.Text = e.NameHash.ToString();
PositionTextBox.Text = FloatUtil.GetVector3String(e.Position);
InnerRadiusTextBox.Text = FloatUtil.ToString(e.InnerRadius);
OuterRadiusTextBox.Text = FloatUtil.ToString(e.OuterRadius);
InnerRadiusTextBox.Text = FloatUtil.ToString(e.MinDist);
OuterRadiusTextBox.Text = FloatUtil.ToString(e.MaxDist);
ChildSoundTextBox.Text = e.ChildSound.ToString();
CategoryTextBox.Text = e.Category.ToString();
Unk01TextBox.Text = FloatUtil.ToString(e.Unk01);
StartTimeUpDown.Value = e.StartTime;
EndTimeUpDown.Value = e.EndTime;
FrequencyUpDown.Value = e.Frequency.Value;
Unk07UpDown.Value = e.Unk07.Value;
Unk08UpDown.Value = e.Unk08.Value;
Unk09UpDown.Value = e.Unk09.Value;
Unk10UpDown.Value = e.Unk10.Value;
Unk11UpDown.Value = e.Unk11.Value;
Unk12UpDown.Value = e.Unk12.Value;
Unk13UpDown.Value = e.Unk13.Value;
Flags0TextBox.Text = e.Flags0.Hex;
Flags1TextBox.Text = e.Flags1.Hex;
Flags2TextBox.Text = e.Flags2.Hex;
Flags3TextBox.Text = e.Flags3.Hex;
Flags4TextBox.Text = e.Flags4.Hex;
Flags5TextBox.Text = e.Flags5.Hex;
Unk01TextBox.Text = FloatUtil.ToString(e.Weight);
StartTimeUpDown.Value = e.MinTimeMinutes;
EndTimeUpDown.Value = e.MaxTimeMinutes;
FrequencyUpDown.Value = e.MinRepeatTime;
Unk07UpDown.Value = e.MinRepeatTimeVariance;
Unk08UpDown.Value = e.SpawnHeight;
Unk09UpDown.Value = e.PositionUsage;
Unk10UpDown.Value = e.MaxLocalInstances;
Unk11UpDown.Value = e.MaxGlobalInstances;
Unk12UpDown.Value = e.BlockabilityFactor;
Unk13UpDown.Value = e.MaxPathDepth;
Flags2TextBox.Text = e.Flags.Hex;
Flags4TextBox.Text = FloatUtil.ToString(e.LastPlayTime);
Flags5TextBox.Text = FloatUtil.ToString(e.DynamicBankID);
StringBuilder sb = new StringBuilder();
if (e.Variables != null)
if (e.Conditions != null)
{
foreach (var extparam in e.Variables)
foreach (var extparam in e.Conditions)
{
sb.Append(extparam.Name.ToString());
sb.Append(", ");
sb.Append(FloatUtil.ToString(extparam.Value));
sb.Append(", ");
sb.Append(extparam.Flags.ToString());
sb.Append(extparam.ConditionType.ToString());
sb.AppendLine();
}
}
@ -195,9 +189,9 @@ namespace CodeWalker.Project.Panels
if (CurrentEmitter?.AudioEmitter == null) return;
float rad = FloatUtil.Parse(InnerRadiusTextBox.Text);
if (CurrentEmitter.AudioEmitter.InnerRadius != rad)
if (CurrentEmitter.AudioEmitter.MinDist != rad)
{
CurrentEmitter.AudioEmitter.InnerRadius = rad;
CurrentEmitter.AudioEmitter.MinDist = rad;
ProjectItemChanged();
}
@ -209,9 +203,9 @@ namespace CodeWalker.Project.Panels
if (CurrentEmitter?.AudioEmitter == null) return;
float rad = FloatUtil.Parse(OuterRadiusTextBox.Text);
if (CurrentEmitter.AudioEmitter.OuterRadius != rad)
if (CurrentEmitter.AudioEmitter.MaxDist != rad)
{
CurrentEmitter.AudioEmitter.OuterRadius = rad;
CurrentEmitter.AudioEmitter.MaxDist = rad;
ProjectItemChanged();
}
@ -267,9 +261,9 @@ namespace CodeWalker.Project.Panels
if (CurrentEmitter?.AudioEmitter == null) return;
float unk = FloatUtil.Parse(Unk01TextBox.Text);
if (CurrentEmitter.AudioEmitter.Unk01 != unk)
if (CurrentEmitter.AudioEmitter.Weight != unk)
{
CurrentEmitter.AudioEmitter.Unk01 = unk;
CurrentEmitter.AudioEmitter.Weight = unk;
ProjectItemChanged();
}
@ -281,9 +275,9 @@ namespace CodeWalker.Project.Panels
if (CurrentEmitter?.AudioEmitter == null) return;
ushort unk = (ushort)StartTimeUpDown.Value;
if (CurrentEmitter.AudioEmitter.StartTime != unk)
if (CurrentEmitter.AudioEmitter.MinTimeMinutes != unk)
{
CurrentEmitter.AudioEmitter.StartTime = unk;
CurrentEmitter.AudioEmitter.MinTimeMinutes = unk;
ProjectItemChanged();
}
@ -295,9 +289,9 @@ namespace CodeWalker.Project.Panels
if (CurrentEmitter?.AudioEmitter == null) return;
ushort unk = (ushort)EndTimeUpDown.Value;
if (CurrentEmitter.AudioEmitter.EndTime != unk)
if (CurrentEmitter.AudioEmitter.MaxTimeMinutes != unk)
{
CurrentEmitter.AudioEmitter.EndTime = unk;
CurrentEmitter.AudioEmitter.MaxTimeMinutes = unk;
ProjectItemChanged();
}
@ -309,9 +303,9 @@ namespace CodeWalker.Project.Panels
if (CurrentEmitter?.AudioEmitter == null) return;
ushort unk = (ushort)FrequencyUpDown.Value;
if (CurrentEmitter.AudioEmitter.Frequency.Value != unk)
if (CurrentEmitter.AudioEmitter.MinRepeatTime != unk)
{
CurrentEmitter.AudioEmitter.Frequency = unk;
CurrentEmitter.AudioEmitter.MinRepeatTime = unk;
ProjectItemChanged();
}
@ -323,9 +317,9 @@ namespace CodeWalker.Project.Panels
if (CurrentEmitter?.AudioEmitter == null) return;
ushort unk = (ushort)Unk07UpDown.Value;
if (CurrentEmitter.AudioEmitter.Unk07.Value != unk)
if (CurrentEmitter.AudioEmitter.MinRepeatTimeVariance != unk)
{
CurrentEmitter.AudioEmitter.Unk07 = unk;
CurrentEmitter.AudioEmitter.MinRepeatTimeVariance = unk;
ProjectItemChanged();
}
@ -337,9 +331,9 @@ namespace CodeWalker.Project.Panels
if (CurrentEmitter?.AudioEmitter == null) return;
byte unk = (byte)Unk08UpDown.Value;
if (CurrentEmitter.AudioEmitter.Unk08.Value != unk)
if (CurrentEmitter.AudioEmitter.SpawnHeight != unk)
{
CurrentEmitter.AudioEmitter.Unk08 = unk;
CurrentEmitter.AudioEmitter.SpawnHeight = unk;
ProjectItemChanged();
}
@ -351,9 +345,9 @@ namespace CodeWalker.Project.Panels
if (CurrentEmitter?.AudioEmitter == null) return;
byte unk = (byte)Unk09UpDown.Value;
if (CurrentEmitter.AudioEmitter.Unk09.Value != unk)
if (CurrentEmitter.AudioEmitter.PositionUsage != unk)
{
CurrentEmitter.AudioEmitter.Unk09 = unk;
CurrentEmitter.AudioEmitter.PositionUsage = unk;
ProjectItemChanged();
}
@ -365,9 +359,9 @@ namespace CodeWalker.Project.Panels
if (CurrentEmitter?.AudioEmitter == null) return;
byte unk = (byte)Unk10UpDown.Value;
if (CurrentEmitter.AudioEmitter.Unk10.Value != unk)
if (CurrentEmitter.AudioEmitter.MaxLocalInstances != unk)
{
CurrentEmitter.AudioEmitter.Unk10 = unk;
CurrentEmitter.AudioEmitter.MaxLocalInstances = unk;
ProjectItemChanged();
}
@ -379,9 +373,9 @@ namespace CodeWalker.Project.Panels
if (CurrentEmitter?.AudioEmitter == null) return;
byte unk = (byte)Unk11UpDown.Value;
if (CurrentEmitter.AudioEmitter.Unk11.Value != unk)
if (CurrentEmitter.AudioEmitter.MaxGlobalInstances != unk)
{
CurrentEmitter.AudioEmitter.Unk11 = unk;
CurrentEmitter.AudioEmitter.MaxGlobalInstances = unk;
ProjectItemChanged();
}
@ -393,9 +387,9 @@ namespace CodeWalker.Project.Panels
if (CurrentEmitter?.AudioEmitter == null) return;
byte unk = (byte)Unk12UpDown.Value;
if (CurrentEmitter.AudioEmitter.Unk12.Value != unk)
if (CurrentEmitter.AudioEmitter.BlockabilityFactor != unk)
{
CurrentEmitter.AudioEmitter.Unk12 = unk;
CurrentEmitter.AudioEmitter.BlockabilityFactor = unk;
ProjectItemChanged();
}
@ -407,48 +401,14 @@ namespace CodeWalker.Project.Panels
if (CurrentEmitter?.AudioEmitter == null) return;
byte unk = (byte)Unk13UpDown.Value;
if (CurrentEmitter.AudioEmitter.Unk13.Value != unk)
if (CurrentEmitter.AudioEmitter.MaxPathDepth != unk)
{
CurrentEmitter.AudioEmitter.Unk13 = unk;
CurrentEmitter.AudioEmitter.MaxPathDepth = unk;
ProjectItemChanged();
}
}
private void Flags0TextBox_TextChanged(object sender, EventArgs e)
{
if (populatingui) return;
if (CurrentEmitter?.AudioEmitter == null) return;
uint flags = 0;
if (uint.TryParse(Flags0TextBox.Text, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out flags))
{
if (CurrentEmitter.AudioEmitter.Flags0 != flags)
{
CurrentEmitter.AudioEmitter.Flags0 = flags;
ProjectItemChanged();
}
}
}
private void Flags1TextBox_TextChanged(object sender, EventArgs e)
{
if (populatingui) return;
if (CurrentEmitter?.AudioEmitter == null) return;
uint flags = 0;
if (uint.TryParse(Flags1TextBox.Text, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out flags))
{
if (CurrentEmitter.AudioEmitter.Flags1 != flags)
{
CurrentEmitter.AudioEmitter.Flags1 = flags;
ProjectItemChanged();
}
}
}
private void Flags2TextBox_TextChanged(object sender, EventArgs e)
{
if (populatingui) return;
@ -457,26 +417,9 @@ namespace CodeWalker.Project.Panels
uint flags = 0;
if (uint.TryParse(Flags2TextBox.Text, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out flags))
{
if (CurrentEmitter.AudioEmitter.Flags2 != flags)
if (CurrentEmitter.AudioEmitter.Flags != flags)
{
CurrentEmitter.AudioEmitter.Flags2 = flags;
ProjectItemChanged();
}
}
}
private void Flags3TextBox_TextChanged(object sender, EventArgs e)
{
if (populatingui) return;
if (CurrentEmitter?.AudioEmitter == null) return;
uint flags = 0;
if (uint.TryParse(Flags3TextBox.Text, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out flags))
{
if (CurrentEmitter.AudioEmitter.Flags3 != flags)
{
CurrentEmitter.AudioEmitter.Flags3 = flags;
CurrentEmitter.AudioEmitter.Flags = flags;
ProjectItemChanged();
}
@ -491,9 +434,9 @@ namespace CodeWalker.Project.Panels
uint flags = 0;
if (uint.TryParse(Flags4TextBox.Text, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out flags))
{
if (CurrentEmitter.AudioEmitter.Flags4 != flags)
if (CurrentEmitter.AudioEmitter.LastPlayTime != flags)
{
CurrentEmitter.AudioEmitter.Flags4 = flags;
CurrentEmitter.AudioEmitter.LastPlayTime = flags;
ProjectItemChanged();
}
@ -508,9 +451,9 @@ namespace CodeWalker.Project.Panels
uint flags = 0;
if (uint.TryParse(Flags5TextBox.Text, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out flags))
{
if (CurrentEmitter.AudioEmitter.Flags5 != flags)
if (CurrentEmitter.AudioEmitter.DynamicBankID != flags)
{
CurrentEmitter.AudioEmitter.Flags5 = flags;
CurrentEmitter.AudioEmitter.DynamicBankID = (int)flags;
ProjectItemChanged();
}
@ -525,13 +468,13 @@ namespace CodeWalker.Project.Panels
var paramstrs = VariablesTextBox.Text.Split(new[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
if (paramstrs?.Length > 0)
{
var paramlist = new List<Dat151AmbientRule.Variable>();
var paramlist = new List<Dat151AmbientRule.Condition>();
foreach (var paramstr in paramstrs)
{
var paramvals = paramstr.Split(',');
if (paramvals?.Length == 3)
{
var param = new Dat151AmbientRule.Variable();
var param = new Dat151AmbientRule.Condition();
var hashstr = paramvals[0].Trim();
var valstr = paramvals[1].Trim();
var flgstr = paramvals[2].Trim();
@ -545,13 +488,13 @@ namespace CodeWalker.Project.Panels
uint.TryParse(flgstr, out flags);
param.Name = hash;
param.Value = FloatUtil.Parse(valstr);
param.Flags = flags;
param.ConditionType = (byte)flags;
paramlist.Add(param);
}
}
CurrentEmitter.AudioEmitter.Variables = paramlist.ToArray();
CurrentEmitter.AudioEmitter.VariablesCount = (ushort)paramlist.Count;
CurrentEmitter.AudioEmitter.Conditions = paramlist.ToArray();
CurrentEmitter.AudioEmitter.NumConditions = (ushort)paramlist.Count;
ProjectItemChanged();
}
@ -561,7 +504,7 @@ namespace CodeWalker.Project.Panels
{
if (CurrentEmitter == null) return;
if (ProjectForm.WorldForm == null) return;
ProjectForm.WorldForm.GoToPosition(CurrentEmitter.Position, CurrentEmitter.AudioZone.PlaybackZoneSize);
ProjectForm.WorldForm.GoToPosition(CurrentEmitter.Position, CurrentEmitter.AudioZone.PositioningZoneSize);
}
private void AddToProjectButton_Click(object sender, EventArgs e)

File diff suppressed because it is too large Load Diff

View File

@ -1,16 +1,9 @@
using CodeWalker.GameFiles;
using CodeWalker.World;
using SharpDX;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace CodeWalker.Project.Panels
{
@ -53,29 +46,34 @@ namespace CodeWalker.Project.Panels
populatingui = true;
NameTextBox.Text = string.Empty;
ShapeComboBox.Text = string.Empty;
InnerPosTextBox.Text = string.Empty;
InnerSizeTextBox.Text = string.Empty;
InnerAngleTextBox.Text = string.Empty;
InnerVec1TextBox.Text = string.Empty;
InnerVec2TextBox.Text = string.Empty;
InnerVec3TextBox.Text = string.Empty;
OuterPosTextBox.Text = string.Empty;
OuterSizeTextBox.Text = string.Empty;
OuterAngleTextBox.Text = string.Empty;
OuterVec1TextBox.Text = string.Empty;
OuterVec2TextBox.Text = string.Empty;
OuterVec3TextBox.Text = string.Empty;
UnkVec1TextBox.Text = string.Empty;
UnkVec2TextBox.Text = string.Empty;
UnkVec3TextBox.Text = string.Empty;
UnkBytesTextBox.Text = string.Empty;
Flags0TextBox.Text = string.Empty;
Flags1TextBox.Text = string.Empty;
Unk13TextBox.Text = string.Empty;
Hash0TextBox.Text = string.Empty;
SceneTextBox.Text = string.Empty;
HashesTextBox.Text = string.Empty;
DependentAmbiencesTextBox.Text = string.Empty;
FlagsTextBox.Text = string.Empty;
ActivationZoneCentreTextBox.Text = string.Empty;
ActivationSizeTextBox.Text = string.Empty;
ActivationRotationOffsetTextBox.Text = string.Empty;
ActivationSizeScaleTextBox.Text = string.Empty;
PositioningCentreTextBox.Text = string.Empty;
PositioningSizeTextBox.Text = string.Empty;
PositioningRotationOffsetTextBox.Text = string.Empty;
PositioningSizeScaleTextBox.Text = string.Empty;
BuiltUpFactorTextBox.Text = string.Empty;
MinPedDensityTextBox.Text = string.Empty;
MaxPedDensityTextBox.Text = string.Empty;
PedDensityTODTextBox.Text = string.Empty;
PedDensityScalarTextBox.Text = string.Empty;
ZoneWaterCalculationTextBox.Text = string.Empty;
PositioningRotationAngleTextBox.Text = string.Empty;
ActivationZoneRotationAngleTextBox.Text = string.Empty;
MinWindInfluenceTextBox.Text = string.Empty;
WindElevationSoundsTextBox.Text = string.Empty;
RandomRadioSettingsTextBox.Text = string.Empty;
EnviromentRuleTextBox.Text = string.Empty;
AudioSceneTextBox.Text = string.Empty;
RulesTextBox.Text = string.Empty;
DirAmbiencesTextBox.Text = string.Empty;
populatingui = false;
}
else
@ -87,27 +85,31 @@ namespace CodeWalker.Project.Panels
var z = CurrentZone.AudioZone;
NameTextBox.Text = z.NameHash.ToString();
ShapeComboBox.Text = z.Shape.ToString();
InnerPosTextBox.Text = FloatUtil.GetVector3String(z.PlaybackZonePosition);
InnerSizeTextBox.Text = FloatUtil.GetVector3String(z.PlaybackZoneSize);
InnerAngleTextBox.Text = z.PlaybackZoneAngle.ToString();
InnerVec1TextBox.Text = FloatUtil.GetVector4String(z.PlaybackZoneVec1);
InnerVec2TextBox.Text = FloatUtil.GetVector4String(z.PlaybackZoneVec2);
InnerVec3TextBox.Text = FloatUtil.GetVector3String(z.PlaybackZoneVec3);
OuterPosTextBox.Text = FloatUtil.GetVector3String(z.ActivationZonePosition);
OuterSizeTextBox.Text = FloatUtil.GetVector3String(z.ActivationZoneSize);
OuterAngleTextBox.Text = z.ActivationZoneAngle.ToString();
OuterVec1TextBox.Text = FloatUtil.GetVector4String(z.ActivationZoneVec1);
OuterVec2TextBox.Text = FloatUtil.GetVector4String(z.ActivationZoneVec2);
OuterVec3TextBox.Text = FloatUtil.GetVector3String(z.ActivationZoneVec3);
UnkVec1TextBox.Text = FloatUtil.GetVector4String(z.UnkVec1);
UnkVec2TextBox.Text = FloatUtil.GetVector4String(z.UnkVec2);
UnkVec3TextBox.Text = FloatUtil.GetVector2String(z.UnkVec3);
UnkBytesTextBox.Text = string.Format("{0}, {1}, {2}", z.Unk14, z.Unk15, z.Unk16);
Flags0TextBox.Text = z.Flags0.Hex;
Flags1TextBox.Text = z.Flags1.Hex;
Unk13TextBox.Text = z.Unk13.Hex;
Hash0TextBox.Text = z.UnkHash0.ToString();
SceneTextBox.Text = z.Scene.ToString();
FlagsTextBox.Text = z.Flags.Hex;
ActivationZoneCentreTextBox.Text = FloatUtil.GetVector3String(z.ActivationZoneCentre);
ActivationSizeTextBox.Text = FloatUtil.GetVector3String(z.ActivationZoneSize);
ActivationRotationOffsetTextBox.Text = FloatUtil.GetVector3String(z.ActivationZonePostRotationOffset);
ActivationRotationOffsetTextBox.Text = FloatUtil.GetVector3String(z.ActivationZoneSizeScale);
PositioningCentreTextBox.Text = FloatUtil.GetVector3String(z.PositioningZoneCentre);
PositioningSizeTextBox.Text = FloatUtil.GetVector3String(z.PositioningZoneSize);
PositioningRotationOffsetTextBox.Text = FloatUtil.GetVector3String(z.PositioningZonePostRotationOffset);
PositioningSizeScaleTextBox.Text = FloatUtil.GetVector3String(z.PositioningZoneSizeScale);
BuiltUpFactorTextBox.Text = z.BuiltUpFactor.ToString();
MinPedDensityTextBox.Text = z.MinPedDensity.ToString();
MaxPedDensityTextBox.Text = z.MaxPedDensity.ToString();
PedDensityTODTextBox.Text = z.PedDensityTOD.ToString();
PedDensityScalarTextBox.Text = z.PedDensityScalar.ToString();
ZoneWaterCalculationTextBox.Text = z.ZoneWaterCalculation.ToString();
PositioningRotationAngleTextBox.Text = z.PositioningZoneRotationAngle.ToString();
ActivationZoneRotationAngleTextBox.Text = z.ActivationZoneRotationAngle.ToString();
MinWindInfluenceTextBox.Text = z.MinWindInfluence.ToString();
WindElevationSoundsTextBox.Text = z.WindElevationSounds.ToString();
RandomRadioSettingsTextBox.Text = z.RandomisedRadioSettings.ToString();
EnviromentRuleTextBox.Text = z.EnviromentRule.ToString();
AudioSceneTextBox.Text = z.AudioScene.ToString();
StringBuilder sb = new StringBuilder();
if (z.Rules != null)
@ -117,20 +119,20 @@ namespace CodeWalker.Project.Panels
sb.AppendLine(hash.ToString());
}
}
HashesTextBox.Text = sb.ToString();
RulesTextBox.Text = sb.ToString();
sb.Clear();
if (z.DependentAmbiences != null)
if (z.DirAmbiences != null)
{
foreach (var extparam in z.DependentAmbiences)
foreach (var extparam in z.DirAmbiences)
{
sb.Append(extparam.Name.ToString());
sb.Append(", ");
sb.Append(FloatUtil.ToString(extparam.Value));
sb.Append(FloatUtil.ToString(extparam.Volume));
sb.AppendLine();
}
}
DependentAmbiencesTextBox.Text = sb.ToString();
DirAmbiencesTextBox.Text = sb.ToString();
populatingui = false;
@ -198,99 +200,18 @@ namespace CodeWalker.Project.Panels
}
private void InnerPosTextBox_TextChanged(object sender, EventArgs e)
private void PositioningCentreTextBoxTextChanged(object sender, EventArgs e)
{
if (populatingui) return;
if (CurrentZone?.AudioZone == null) return;
var vec = FloatUtil.ParseVector3String(InnerPosTextBox.Text);
if (CurrentZone.AudioZone.PlaybackZonePosition != vec)
var vec = FloatUtil.ParseVector3String(PositioningCentreTextBox.Text);
if (CurrentZone.AudioZone.PositioningZoneCentre != vec)
{
CurrentZone.AudioZone.PlaybackZonePosition = vec;
CurrentZone.AudioZone.PositioningZoneCentre = vec;
ProjectItemChanged();
//var wf = ProjectForm.WorldForm;
//if (wf != null)
//{
// wf.BeginInvoke(new Action(() =>
// {
// wf.SetWidgetPosition(CurrentZone.Position, true);
// }));
//}
}
}
private void InnerSizeTextBox_TextChanged(object sender, EventArgs e)
{
if (populatingui) return;
if (CurrentZone?.AudioZone == null) return;
var vec = FloatUtil.ParseVector3String(InnerSizeTextBox.Text);
if (CurrentZone.AudioZone.PlaybackZoneSize != vec)
{
CurrentZone.AudioZone.PlaybackZoneSize = vec;
ProjectItemChanged();
}
}
private void InnerAngleTextBox_TextChanged(object sender, EventArgs e)
{
if (populatingui) return;
if (CurrentZone?.AudioZone == null) return;
uint ang = 0;
if (uint.TryParse(InnerAngleTextBox.Text, out ang))
{
if (CurrentZone.AudioZone.PlaybackZoneAngle != ang)
{
CurrentZone.AudioZone.PlaybackZoneAngle = ang;
ProjectItemChanged();
}
}
}
private void InnerVec1TextBox_TextChanged(object sender, EventArgs e)
{
if (populatingui) return;
if (CurrentZone?.AudioZone == null) return;
var vec = FloatUtil.ParseVector4String(InnerVec1TextBox.Text);
if (CurrentZone.AudioZone.PlaybackZoneVec1 != vec)
{
CurrentZone.AudioZone.PlaybackZoneVec1 = vec;
ProjectItemChanged();
}
}
private void InnerVec2TextBox_TextChanged(object sender, EventArgs e)
{
if (populatingui) return;
if (CurrentZone?.AudioZone == null) return;
var vec = FloatUtil.ParseVector4String(InnerVec2TextBox.Text);
if (CurrentZone.AudioZone.PlaybackZoneVec2 != vec)
{
CurrentZone.AudioZone.PlaybackZoneVec2 = vec;
ProjectItemChanged();
}
}
private void InnerVec3TextBox_TextChanged(object sender, EventArgs e)
{
if (populatingui) return;
if (CurrentZone?.AudioZone == null) return;
var vec = FloatUtil.ParseVector3String(InnerVec3TextBox.Text);
if (CurrentZone.AudioZone.PlaybackZoneVec3 != vec)
{
CurrentZone.AudioZone.PlaybackZoneVec3 = vec;
ProjectItemChanged();
}
}
@ -299,159 +220,43 @@ namespace CodeWalker.Project.Panels
if (populatingui) return;
if (CurrentZone?.AudioZone == null) return;
var vec = FloatUtil.ParseVector3String(OuterPosTextBox.Text);
if (CurrentZone.AudioZone.ActivationZonePosition != vec)
var vec = FloatUtil.ParseVector3String(PositioningCentreTextBox.Text);
if (CurrentZone.AudioZone.ActivationZoneCentre != vec)
{
CurrentZone.AudioZone.ActivationZonePosition = vec;
CurrentZone.AudioZone.ActivationZoneCentre = vec;
ProjectItemChanged();
}
}
private void OuterSizeTextBox_TextChanged(object sender, EventArgs e)
private void ActivationZoneRotationAngleTextBox_TextChanged(object sender, EventArgs e)
{
if (populatingui) return;
if (CurrentZone?.AudioZone == null) return;
var vec = FloatUtil.ParseVector3String(OuterSizeTextBox.Text);
if (CurrentZone.AudioZone.ActivationZoneSize != vec)
uint ang;
if (uint.TryParse(ActivationZoneRotationAngleTextBox.Text, out ang))
{
CurrentZone.AudioZone.ActivationZoneSize = vec;
ProjectItemChanged();
}
}
private void OuterAngleTextBox_TextChanged(object sender, EventArgs e)
{
if (populatingui) return;
if (CurrentZone?.AudioZone == null) return;
uint ang = 0;
if (uint.TryParse(OuterAngleTextBox.Text, out ang))
{
if (CurrentZone.AudioZone.ActivationZoneAngle != ang)
if (CurrentZone.AudioZone.ActivationZoneRotationAngle != ang)
{
CurrentZone.AudioZone.ActivationZoneAngle = ang;
CurrentZone.AudioZone.ActivationZoneRotationAngle = (ushort)ang;
ProjectItemChanged();
}
}
}
private void OuterVec1TextBox_TextChanged(object sender, EventArgs e)
{
if (populatingui) return;
if (CurrentZone?.AudioZone == null) return;
var vec = FloatUtil.ParseVector4String(OuterVec1TextBox.Text);
if (CurrentZone.AudioZone.ActivationZoneVec1 != vec)
{
CurrentZone.AudioZone.ActivationZoneVec1 = vec;
ProjectItemChanged();
}
}
private void OuterVec2TextBox_TextChanged(object sender, EventArgs e)
{
if (populatingui) return;
if (CurrentZone?.AudioZone == null) return;
var vec = FloatUtil.ParseVector4String(OuterVec2TextBox.Text);
if (CurrentZone.AudioZone.ActivationZoneVec2 != vec)
{
CurrentZone.AudioZone.ActivationZoneVec2 = vec;
ProjectItemChanged();
}
}
private void OuterVec3TextBox_TextChanged(object sender, EventArgs e)
{
if (populatingui) return;
if (CurrentZone?.AudioZone == null) return;
var vec = FloatUtil.ParseVector3String(OuterVec3TextBox.Text);
if (CurrentZone.AudioZone.ActivationZoneVec3 != vec)
{
CurrentZone.AudioZone.ActivationZoneVec3 = vec;
ProjectItemChanged();
}
}
private void UnkVec1TextBox_TextChanged(object sender, EventArgs e)
{
if (populatingui) return;
if (CurrentZone?.AudioZone == null) return;
var vec = FloatUtil.ParseVector4String(UnkVec1TextBox.Text);
if (CurrentZone.AudioZone.UnkVec1 != vec)
{
CurrentZone.AudioZone.UnkVec1 = vec;
ProjectItemChanged();
}
}
private void UnkVec2TextBox_TextChanged(object sender, EventArgs e)
{
if (populatingui) return;
if (CurrentZone?.AudioZone == null) return;
var vec = FloatUtil.ParseVector4String(UnkVec2TextBox.Text);
if (CurrentZone.AudioZone.UnkVec2 != vec)
{
CurrentZone.AudioZone.UnkVec2 = vec;
ProjectItemChanged();
}
}
private void UnkVec3TextBox_TextChanged(object sender, EventArgs e)
{
if (populatingui) return;
if (CurrentZone?.AudioZone == null) return;
var vec = FloatUtil.ParseVector2String(UnkVec3TextBox.Text);
if (CurrentZone.AudioZone.UnkVec3 != vec)
{
CurrentZone.AudioZone.UnkVec3 = vec;
ProjectItemChanged();
}
}
private void UnkBytesTextBox_TextChanged(object sender, EventArgs e)
{
var vals = UnkBytesTextBox.Text.Split(',');
if (vals?.Length == 3)
{
byte val0 = 0, val1 = 0, val2 = 0;
byte.TryParse(vals[0].Trim(), out val0);
byte.TryParse(vals[1].Trim(), out val1);
byte.TryParse(vals[2].Trim(), out val2);
CurrentZone.AudioZone.Unk14 = val0;
CurrentZone.AudioZone.Unk15 = val1;
CurrentZone.AudioZone.Unk16 = val2;
ProjectItemChanged();
}
}
private void Flags0TextBox_TextChanged(object sender, EventArgs e)
private void FlagsTextBox_TextChanged(object sender, EventArgs e)
{
if (populatingui) return;
if (CurrentZone?.AudioZone == null) return;
uint flags = 0;
if (uint.TryParse(Flags0TextBox.Text, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out flags))
if (uint.TryParse(FlagsTextBox.Text, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out flags))
{
if (CurrentZone.AudioZone.Flags0 != flags)
if (CurrentZone.AudioZone.Flags != flags)
{
CurrentZone.AudioZone.Flags0 = flags;
CurrentZone.AudioZone.Flags = flags;
ProjectItemChanged();
}
@ -459,29 +264,12 @@ namespace CodeWalker.Project.Panels
}
private void Flags1TextBox_TextChanged(object sender, EventArgs e)
private void RandomisedRadioSettings_TextChanged(object sender, EventArgs e)
{
if (populatingui) return;
if (CurrentZone?.AudioZone == null) return;
uint flags = 0;
if (uint.TryParse(Flags1TextBox.Text, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out flags))
{
if (CurrentZone.AudioZone.Flags1 != flags)
{
CurrentZone.AudioZone.Flags1 = flags;
ProjectItemChanged();
}
}
}
private void Unk13TextBox_TextChanged(object sender, EventArgs e)
{
if (populatingui) return;
if (CurrentZone?.AudioZone == null) return;
var hashstr = Unk13TextBox.Text;
var hashstr = RandomRadioSettingsTextBox.Text;
uint hash = 0;
if (!uint.TryParse(hashstr, out hash))//don't re-hash hashes
{
@ -489,20 +277,20 @@ namespace CodeWalker.Project.Panels
JenkIndex.Ensure(hashstr);
}
if (CurrentZone.AudioZone.Unk13 != hash)
if (CurrentZone.AudioZone.RandomisedRadioSettings != hash)
{
CurrentZone.AudioZone.Unk13 = hash;
CurrentZone.AudioZone.RandomisedRadioSettings = hash;
ProjectItemChanged();
}
}
private void Hash0TextBox_TextChanged(object sender, EventArgs e)
private void EnviromentRuleTextBox_TextChanged(object sender, EventArgs e)
{
if (populatingui) return;
if (CurrentZone?.AudioZone == null) return;
var hashstr = Hash0TextBox.Text;
var hashstr = EnviromentRuleTextBox.Text;
uint hash = 0;
if (!uint.TryParse(hashstr, out hash))//don't re-hash hashes
{
@ -510,20 +298,20 @@ namespace CodeWalker.Project.Panels
JenkIndex.Ensure(hashstr);
}
if (CurrentZone.AudioZone.UnkHash0 != hash)
if (CurrentZone.AudioZone.EnviromentRule != hash)
{
CurrentZone.AudioZone.UnkHash0 = hash;
CurrentZone.AudioZone.EnviromentRule = hash;
ProjectItemChanged();
}
}
private void SceneTextBox_TextChanged(object sender, EventArgs e)
private void AudioSceneTextBox_TextChanged(object sender, EventArgs e)
{
if (populatingui) return;
if (CurrentZone?.AudioZone == null) return;
var hashstr = SceneTextBox.Text;
var hashstr = AudioSceneTextBox.Text;
uint hash = 0;
if (!uint.TryParse(hashstr, out hash))//don't re-hash hashes
{
@ -531,20 +319,20 @@ namespace CodeWalker.Project.Panels
JenkIndex.Ensure(hashstr);
}
if (CurrentZone.AudioZone.Scene != hash)
if (CurrentZone.AudioZone.AudioScene != hash)
{
CurrentZone.AudioZone.Scene = hash;
CurrentZone.AudioZone.AudioScene = hash;
ProjectItemChanged();
}
}
private void HashesTextBox_TextChanged(object sender, EventArgs e)
private void RulesTextBox_TextChanged(object sender, EventArgs e)
{
if (populatingui) return;
if (CurrentZone?.AudioZone == null) return;
var hashstrs = HashesTextBox.Text.Split(new[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
var hashstrs = RulesTextBox.Text.Split(new[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
if (hashstrs?.Length > 0)
{
var hashlist = new List<MetaHash>();
@ -560,27 +348,27 @@ namespace CodeWalker.Project.Panels
}
CurrentZone.AudioZone.Rules = hashlist.ToArray();
CurrentZone.AudioZone.RulesCount = (byte)hashlist.Count;
CurrentZone.AudioZone.NumRules = (byte)hashlist.Count;
ProjectItemChanged();
}
}
private void DependentAmbiencesTextBox_TextChanged(object sender, EventArgs e)
private void DirAmbiencesTextBox_TextChanged(object sender, EventArgs e)
{
if (populatingui) return;
if (CurrentZone?.AudioZone == null) return;
var paramstrs = DependentAmbiencesTextBox.Text.Split(new[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
var paramstrs = DirAmbiencesTextBox.Text.Split(new[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
if (paramstrs?.Length > 0)
{
var paramlist = new List<Dat151AmbientZone.DependentAmbience>();
var paramlist = new List<Dat151AmbientZone.DirAmbience>();
foreach (var paramstr in paramstrs)
{
var paramvals = paramstr.Split(',');
if (paramvals?.Length == 2)
{
var param = new Dat151AmbientZone.DependentAmbience();
var param = new Dat151AmbientZone.DirAmbience();
var hashstr = paramvals[0].Trim();
var valstr = paramvals[1].Trim();
uint hash = 0;
@ -590,13 +378,13 @@ namespace CodeWalker.Project.Panels
JenkIndex.Ensure(hashstr);
}
param.Name = hash;
param.Value = FloatUtil.Parse(valstr);
param.Volume = FloatUtil.Parse(valstr);
paramlist.Add(param);
}
}
CurrentZone.AudioZone.DependentAmbiences = paramlist.ToArray();
CurrentZone.AudioZone.DependentAmbiencesCount = (uint)paramlist.Count;
CurrentZone.AudioZone.DirAmbiences = paramlist.ToArray();
CurrentZone.AudioZone.NumDirAmbiences = (byte)paramlist.Count;
ProjectItemChanged();
}
@ -606,7 +394,7 @@ namespace CodeWalker.Project.Panels
{
if (CurrentZone == null) return;
if (ProjectForm.WorldForm == null) return;
ProjectForm.WorldForm.GoToPosition(CurrentZone.Position, CurrentZone.AudioZone.PlaybackZoneSize);
ProjectForm.WorldForm.GoToPosition(CurrentZone.Position, CurrentZone.AudioZone.PositioningZoneSize);
}
private void AddToProjectButton_Click(object sender, EventArgs e)
@ -620,5 +408,232 @@ namespace CodeWalker.Project.Panels
ProjectForm.SetProjectItem(CurrentZone);
ProjectForm.DeleteAudioZone();
}
private void BuiltUpFactorTextBox_TextChanged(object sender, EventArgs e)
{
if (populatingui) return;
if (CurrentZone?.AudioZone == null) return;
var vec = FloatUtil.Parse(BuiltUpFactorTextBox.Text);
if (CurrentZone.AudioZone.BuiltUpFactor != vec)
{
CurrentZone.AudioZone.BuiltUpFactor = vec;
ProjectItemChanged();
}
}
private void PedDensityTODTextBox_TextChanged(object sender, EventArgs e)
{
if (populatingui) return;
if (CurrentZone?.AudioZone == null) return;
var vec = FloatUtil.Parse(PedDensityTODTextBox.Text);
if (CurrentZone.AudioZone.PedDensityTOD != vec)
{
CurrentZone.AudioZone.PedDensityTOD = (uint)vec;
ProjectItemChanged();
}
}
private void MinPedDensityTextBox_TextChanged(object sender, EventArgs e)
{
if (populatingui) return;
if (CurrentZone?.AudioZone == null) return;
var vec = FloatUtil.Parse(MinPedDensityTextBox.Text);
if (CurrentZone.AudioZone.MinPedDensity != vec)
{
CurrentZone.AudioZone.MinPedDensity = vec;
ProjectItemChanged();
}
}
private void PedDensityScalarTextBox_TextChanged(object sender, EventArgs e)
{
if (populatingui) return;
if (CurrentZone?.AudioZone == null) return;
var vec = FloatUtil.Parse(PedDensityScalarTextBox.Text);
if (CurrentZone.AudioZone.PedDensityScalar != vec)
{
CurrentZone.AudioZone.PedDensityScalar = vec;
ProjectItemChanged();
}
}
private void MaxPedDensityTextBox_TextChanged(object sender, EventArgs e)
{
if (populatingui) return;
if (CurrentZone?.AudioZone == null) return;
var vec = FloatUtil.Parse(MaxPedDensityTextBox.Text);
if (CurrentZone.AudioZone.MaxPedDensity != vec)
{
CurrentZone.AudioZone.MaxPedDensity = vec;
ProjectItemChanged();
}
}
private void ZoneWaterCalculationTextBox_TextChanged(object sender, EventArgs e)
{
if (populatingui) return;
if (CurrentZone?.AudioZone == null) return;
var vec = FloatUtil.Parse(ZoneWaterCalculationTextBox.Text);
if (CurrentZone.AudioZone.ZoneWaterCalculation != vec)
{
CurrentZone.AudioZone.ZoneWaterCalculation = (byte)vec;
ProjectItemChanged();
}
}
private void PositioningSizeTextBox_TextChanged(object sender, EventArgs e)
{
if (populatingui) return;
if (CurrentZone?.AudioZone == null) return;
var vec = FloatUtil.ParseVector3String(PositioningSizeTextBox.Text);
if (CurrentZone.AudioZone.PositioningZoneSize != vec)
{
CurrentZone.AudioZone.PositioningZoneSize = vec;
ProjectItemChanged();
}
}
private void PositioningRotationAngleTextBox_TextChanged(object sender, EventArgs e)
{
if (populatingui) return;
if (CurrentZone?.AudioZone == null) return;
uint ang = 0;
if (uint.TryParse(PositioningRotationAngleTextBox.Text, out ang))
{
if (CurrentZone.AudioZone.PositioningZoneRotationAngle != ang)
{
CurrentZone.AudioZone.PositioningZoneRotationAngle = (ushort)ang;
ProjectItemChanged();
}
}
}
private void PositioningRotationOffsetTextBox_TextChanged(object sender, EventArgs e)
{
if (populatingui) return;
if (CurrentZone?.AudioZone == null) return;
var vec = FloatUtil.ParseVector3String(PositioningRotationOffsetTextBox.Text);
if (CurrentZone.AudioZone.PositioningZonePostRotationOffset != vec)
{
CurrentZone.AudioZone.PositioningZonePostRotationOffset = vec;
ProjectItemChanged();
}
}
private void PositioningSizeScaleTextBox_TextChanged(object sender, EventArgs e)
{
if (populatingui) return;
if (CurrentZone?.AudioZone == null) return;
var vec = FloatUtil.ParseVector3String(PositioningSizeTextBox.Text);
if (CurrentZone.AudioZone.PositioningZoneSizeScale != vec)
{
CurrentZone.AudioZone.PositioningZoneSizeScale = vec;
ProjectItemChanged();
}
}
private void ActivationSizeTextBox_TextChanged(object sender, EventArgs e)
{
if (populatingui) return;
if (CurrentZone?.AudioZone == null) return;
var vec = FloatUtil.ParseVector3String(ActivationSizeTextBox.Text);
if (CurrentZone.AudioZone.ActivationZoneSize != vec)
{
CurrentZone.AudioZone.ActivationZoneSize = vec;
ProjectItemChanged();
}
}
private void ActivationRotationOffsetTextBox_TextChanged(object sender, EventArgs e)
{
if (populatingui) return;
if (CurrentZone?.AudioZone == null) return;
var vec = FloatUtil.ParseVector3String(ActivationRotationOffsetTextBox.Text);
if (CurrentZone.AudioZone.ActivationZonePostRotationOffset != vec)
{
CurrentZone.AudioZone.ActivationZonePostRotationOffset = vec;
ProjectItemChanged();
}
}
private void ActivationSizeScaleTextBox_TextChanged(object sender, EventArgs e)
{
if (populatingui) return;
if (CurrentZone?.AudioZone == null) return;
var vec = FloatUtil.ParseVector3String(ActivationSizeScaleTextBox.Text);
if (CurrentZone.AudioZone.ActivationZoneSizeScale != vec)
{
CurrentZone.AudioZone.ActivationZoneSizeScale = vec;
ProjectItemChanged();
}
}
private void MinWindInfluenceTextBox_TextChanged(object sender, EventArgs e)
{
if (populatingui) return;
if (CurrentZone?.AudioZone == null) return;
var vec = FloatUtil.Parse(MinWindInfluenceTextBox.Text);
if (CurrentZone.AudioZone.MinWindInfluence != vec)
{
CurrentZone.AudioZone.MinWindInfluence = vec;
ProjectItemChanged();
}
}
private void MaxWindInfluenceTextBox_TextChanged(object sender, EventArgs e)
{
if (populatingui) return;
if (CurrentZone?.AudioZone == null) return;
var vec = FloatUtil.Parse(MaxWindInfluenceTextBox.Text);
if (CurrentZone.AudioZone.MaxWindInfluence != vec)
{
CurrentZone.AudioZone.MaxWindInfluence = vec;
ProjectItemChanged();
}
}
private void WindElevationSoundsTextBox_TextChanged(object sender, EventArgs e)
{
if (populatingui) return;
if (CurrentZone?.AudioZone == null) return;
var vec = FloatUtil.Parse(WindElevationSoundsTextBox.Text);
if (CurrentZone.AudioZone.WindElevationSounds != vec)
{
CurrentZone.AudioZone.WindElevationSounds = (uint)vec;
ProjectItemChanged();
}
}
}
}

View File

@ -117,6 +117,12 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="label18.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="label27.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>

View File

@ -6422,32 +6422,35 @@ namespace CodeWalker.Project
//AA800424 box, line
//AA800420 sphere
zone.Flags0 = cp ? copy.AudioZone.Flags0.Value : 0xAA800424;
zone.Flags1 = cp ? copy.AudioZone.Flags1 : 0;
zone.Flags = cp ? copy.AudioZone.Flags.Value : 0xAA800424;
zone.Shape = cp ? copy.AudioZone.Shape : Dat151ZoneShape.Box;
zone.PlaybackZoneSize = cp ? copy.AudioZone.PlaybackZoneSize : Vector3.One * 10.0f;
zone.PlaybackZoneAngle = cp ? copy.AudioZone.PlaybackZoneAngle : 0;
zone.PlaybackZoneVec1 = cp ? copy.AudioZone.PlaybackZoneVec1 : Vector4.Zero;
zone.PlaybackZoneVec2 = cp ? copy.AudioZone.PlaybackZoneVec2 : new Vector4(1, 1, 1, 0);
zone.PlaybackZoneVec3 = cp ? copy.AudioZone.PlaybackZoneVec3 : Vector3.Zero;
zone.PositioningZoneSize = cp ? copy.AudioZone.PositioningZoneSize : Vector3.One * 10.0f;
zone.PositioningZoneRotationAngle = (ushort)(cp ? copy.AudioZone.PositioningZoneRotationAngle : 0);
zone.PositioningZonePostRotationOffset = cp ? copy.AudioZone.PositioningZonePostRotationOffset : Vector3.Zero;
zone.PositioningZoneSizeScale = cp ? copy.AudioZone.PositioningZoneSizeScale : new Vector3(1, 1, 1);
zone.ActivationZoneSize = cp ? copy.AudioZone.ActivationZoneSize : Vector3.One * 15.0f;
zone.ActivationZoneAngle = cp ? copy.AudioZone.ActivationZoneAngle : 0;
zone.ActivationZoneVec1 = cp ? copy.AudioZone.ActivationZoneVec1 : Vector4.Zero;
zone.ActivationZoneVec2 = cp ? copy.AudioZone.ActivationZoneVec2 : new Vector4(1, 1, 1, 0);
zone.ActivationZoneVec3 = cp ? copy.AudioZone.ActivationZoneVec3 : Vector3.Zero;
zone.UnkVec1 = cp ? copy.AudioZone.UnkVec1 : new Vector4(0, 0, 1, 0);
zone.UnkVec2 = cp ? copy.AudioZone.UnkVec2 : new Vector4(1, -1, -1, 0);
zone.UnkHash0 = cp ? copy.AudioZone.UnkHash0 : 0;
zone.Scene = cp ? copy.AudioZone.Scene : 0;
zone.UnkVec3 = cp ? copy.AudioZone.UnkVec3 : new Vector2(-1, 0);
zone.Unk13 = cp ? copy.AudioZone.Unk13 : 0;
zone.Unk14 = cp ? copy.AudioZone.Unk14 : (byte)4;
zone.Unk15 = cp ? copy.AudioZone.Unk15 : (byte)1;
zone.Unk16 = cp ? copy.AudioZone.Unk16 : (byte)0;
zone.RulesCount = cp ? copy.AudioZone.RulesCount : (byte)0;
zone.ActivationZoneRotationAngle = (ushort)(cp ? copy.AudioZone.ActivationZoneRotationAngle : 0);
zone.ActivationZonePostRotationOffset = cp ? copy.AudioZone.ActivationZonePostRotationOffset : Vector3.Zero;
zone.ActivationZoneSizeScale = cp ? copy.AudioZone.ActivationZoneSizeScale : new Vector3(1, 1, 1);
zone.BuiltUpFactor = cp ? copy.AudioZone.BuiltUpFactor : 0;
zone.MinPedDensity = cp ? copy.AudioZone.MinPedDensity : 0;
zone.MaxPedDensity = cp ? copy.AudioZone.MaxPedDensity : 0;
zone.PedDensityTOD = cp ? copy.AudioZone.PedDensityTOD : 0;
zone.PedDensityScalar = cp ? copy.AudioZone.PedDensityScalar : 0;
zone.MaxWindInfluence = cp ? copy.AudioZone.MaxWindInfluence : 0;
zone.MinWindInfluence = cp ? copy.AudioZone.MinWindInfluence : 0;
zone.WindElevationSounds = cp ? copy.AudioZone.WindElevationSounds : 0;
zone.EnviromentRule = cp ? copy.AudioZone.EnviromentRule : 0;
zone.AudioScene = cp ? copy.AudioZone.AudioScene : 0;
zone.UnderwaterCreakFactor = cp ? copy.AudioZone.UnderwaterCreakFactor : 0;
zone.PedWallaSettings = cp ? copy.AudioZone.PedWallaSettings : 0;
zone.RandomisedRadioSettings = cp ? copy.AudioZone.RandomisedRadioSettings : 0;
zone.NumRulesToPlay = cp ? copy.AudioZone.NumRulesToPlay : (byte)4;
zone.ZoneWaterCalculation = cp ? copy.AudioZone.ZoneWaterCalculation : (byte)1;
zone.NumDirAmbiences = cp ? copy.AudioZone.NumDirAmbiences : (byte)0;
zone.NumRules = cp ? copy.AudioZone.NumRules : (byte)0;
zone.Rules = cp ? copy.AudioZone.Rules : null;
zone.DependentAmbiencesCount = cp ? copy.AudioZone.DependentAmbiencesCount : 0;
zone.DependentAmbiences = cp ? copy.AudioZone.DependentAmbiences : null;
zone.DirAmbiences = cp ? copy.AudioZone.DirAmbiences : null;
zone.Name = "zone1";
zone.NameHash = JenkHash.GenHash(zone.Name);
@ -6547,21 +6550,20 @@ namespace CodeWalker.Project
var emitter = new Dat151AmbientRule(CurrentAudioFile);
emitter.Flags0 = cp ? copy.AudioEmitter.Flags0.Value : 0xAA001100;
emitter.Flags5 = cp ? copy.AudioEmitter.Flags5.Value : 0xFFFFFFFF;
emitter.InnerRadius = cp ? copy.AudioEmitter.InnerRadius : 0.0f;
emitter.OuterRadius = cp ? copy.AudioEmitter.OuterRadius : 20.0f;
emitter.Unk01 = cp ? copy.AudioEmitter.Unk01 : 1.0f;
emitter.StartTime = cp ? copy.AudioEmitter.StartTime : (ushort)0;
emitter.EndTime = cp ? copy.AudioEmitter.EndTime : (ushort)1440;
emitter.Frequency = cp ? copy.AudioEmitter.Frequency.Value : (ushort)0;
emitter.Unk07 = cp ? copy.AudioEmitter.Unk07.Value : (ushort)0;
emitter.Unk08 = cp ? copy.AudioEmitter.Unk08.Value : (byte)0;
emitter.Unk09 = cp ? copy.AudioEmitter.Unk09.Value : (byte)1;
emitter.Unk10 = cp ? copy.AudioEmitter.Unk10.Value : (byte)1;
emitter.Unk11 = cp ? copy.AudioEmitter.Unk11.Value : (byte)1;
emitter.Unk12 = cp ? copy.AudioEmitter.Unk12.Value : (byte)100;
emitter.Unk13 = cp ? copy.AudioEmitter.Unk13.Value : (byte)3;
emitter.DynamicBankID = cp ? copy.AudioEmitter.DynamicBankID : 0;
emitter.MinDist = cp ? copy.AudioEmitter.MinDist : 0.0f;
emitter.MaxDist = cp ? copy.AudioEmitter.MaxDist : 20.0f;
emitter.Weight = cp ? copy.AudioEmitter.Weight : 1.0f;
emitter.MinTimeMinutes = cp ? copy.AudioEmitter.MinTimeMinutes : (ushort)0;
emitter.MaxTimeMinutes = cp ? copy.AudioEmitter.MaxTimeMinutes : (ushort)1440;
emitter.MinRepeatTime = cp ? copy.AudioEmitter.MinRepeatTime : (ushort)0;
emitter.MinRepeatTimeVariance = cp ? copy.AudioEmitter.MinRepeatTimeVariance : (ushort)0;
emitter.SpawnHeight = cp ? copy.AudioEmitter.SpawnHeight : (byte)0;
emitter.PositionUsage = cp ? copy.AudioEmitter.PositionUsage : (byte)1;
emitter.MaxLocalInstances = cp ? copy.AudioEmitter.MaxLocalInstances : (byte)1;
emitter.MaxGlobalInstances = cp ? copy.AudioEmitter.MaxGlobalInstances : (byte)1;
emitter.BlockabilityFactor = cp ? copy.AudioEmitter.BlockabilityFactor : (byte)100;
emitter.MaxPathDepth = cp ? copy.AudioEmitter.MaxPathDepth : (byte)3;
emitter.Name = "emitter1";