Audio.rel.xml updates (#183)

* Audio.rel.xml updates

* Update RelFile.cs

* Audioconfig.dat4 changes + fix for config game crash

Credits to alexguirre for type & fieldname changes to ERSettings (prev UnkER) and Vector3 (prev Orientation)
This commit is contained in:
Monkeypolice188 2023-08-21 06:27:13 +01:00 committed by GitHub
parent 5760d56134
commit 023cc1eb47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 1149 additions and 1078 deletions

File diff suppressed because it is too large Load Diff

View File

@ -113,12 +113,12 @@ namespace CodeWalker.World
public Vector3 InnerPos { get; set; } public Vector3 InnerPos { get; set; }
public Vector3 InnerMin { get; set; } public Vector3 InnerMin { get; set; }
public Vector3 InnerMax { get; set; } public Vector3 InnerMax { get; set; }
public float InnerRad { get; set; } public float InnerRadius { get; set; }
public Quaternion InnerOri { get; set; } public Quaternion InnerOri { get; set; }
public Vector3 OuterPos { get; set; } public Vector3 OuterPos { get; set; }
public Vector3 OuterMin { get; set; } public Vector3 OuterMin { get; set; }
public Vector3 OuterMax { get; set; } public Vector3 OuterMax { get; set; }
public float OuterRad { get; set; } public float OuterRadius { get; set; }
public Quaternion OuterOri { get; set; } public Quaternion OuterOri { get; set; }
public Vector3 Position { get; set; } public Vector3 Position { get; set; }
public Vector3 HitboxMin { get; set; } public Vector3 HitboxMin { get; set; }
@ -170,8 +170,8 @@ namespace CodeWalker.World
case Dat151ZoneShape.Sphere: case Dat151ZoneShape.Sphere:
InnerPos = zone.PlaybackZonePosition; InnerPos = zone.PlaybackZonePosition;
InnerOri = Quaternion.Identity; InnerOri = Quaternion.Identity;
InnerRad = zone.PlaybackZoneSize.X; InnerRadius = zone.PlaybackZoneSize.X;
OuterRad = zone.ActivationZoneSize.X; OuterRadius = zone.ActivationZoneSize.X;
break; break;
case Dat151ZoneShape.Line: case Dat151ZoneShape.Line:
InnerPos = zone.PlaybackZonePosition; InnerPos = zone.PlaybackZonePosition;
@ -194,7 +194,7 @@ namespace CodeWalker.World
HitboxMin = useouter ? OuterMin : InnerMin; HitboxMin = useouter ? OuterMin : InnerMin;
Orientation = useouter ? OuterOri : InnerOri; Orientation = useouter ? OuterOri : InnerOri;
OrientationInv = Quaternion.Invert(Orientation); OrientationInv = Quaternion.Invert(Orientation);
HitSphereRad = InnerRad; HitSphereRad = InnerRadius;
if (zone.Shape == Dat151ZoneShape.Sphere) if (zone.Shape == Dat151ZoneShape.Sphere)
{ {
Position = InnerPos; Position = InnerPos;
@ -215,16 +215,16 @@ namespace CodeWalker.World
OrientationInv = Quaternion.Identity; OrientationInv = Quaternion.Identity;
InnerPos = emitter.Position; InnerPos = emitter.Position;
OuterPos = InnerPos; OuterPos = InnerPos;
InnerRad = emitter.InnerRad; InnerRadius = emitter.InnerRadius;
OuterRad = emitter.OuterRad; OuterRadius = emitter.OuterRadius;
bool useouter = (InnerRad == 0); bool useouter = (InnerRadius == 0);
if (useouter) if (useouter)
{ {
InnerRad = 1; InnerRadius = 1;
} }
Position = InnerPos; Position = InnerPos;
HitSphereRad = InnerRad;// useouter ? OuterRad : InnerRad; HitSphereRad = InnerRadius;// useouter ? OuterRadius : InnerRadius;
} }

View File

@ -39,7 +39,7 @@
this.Unk09UpDown = new System.Windows.Forms.NumericUpDown(); this.Unk09UpDown = new System.Windows.Forms.NumericUpDown();
this.Unk07UpDown = new System.Windows.Forms.NumericUpDown(); this.Unk07UpDown = new System.Windows.Forms.NumericUpDown();
this.Unk08UpDown = new System.Windows.Forms.NumericUpDown(); this.Unk08UpDown = new System.Windows.Forms.NumericUpDown();
this.Unk06UpDown = new System.Windows.Forms.NumericUpDown(); this.FrequencyUpDown = new System.Windows.Forms.NumericUpDown();
this.EndTimeUpDown = new System.Windows.Forms.NumericUpDown(); this.EndTimeUpDown = new System.Windows.Forms.NumericUpDown();
this.StartTimeUpDown = new System.Windows.Forms.NumericUpDown(); this.StartTimeUpDown = new System.Windows.Forms.NumericUpDown();
this.label23 = new System.Windows.Forms.Label(); this.label23 = new System.Windows.Forms.Label();
@ -53,7 +53,7 @@
this.label21 = new System.Windows.Forms.Label(); this.label21 = new System.Windows.Forms.Label();
this.Flags2TextBox = new System.Windows.Forms.TextBox(); this.Flags2TextBox = new System.Windows.Forms.TextBox();
this.label20 = new System.Windows.Forms.Label(); this.label20 = new System.Windows.Forms.Label();
this.ExtParamsTextBox = new CodeWalker.WinForms.TextBoxFix(); this.VariablesTextBox = new CodeWalker.WinForms.TextBoxFix();
this.label15 = new System.Windows.Forms.Label(); this.label15 = new System.Windows.Forms.Label();
this.label17 = new System.Windows.Forms.Label(); this.label17 = new System.Windows.Forms.Label();
this.label18 = new System.Windows.Forms.Label(); this.label18 = new System.Windows.Forms.Label();
@ -66,7 +66,7 @@
this.label6 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label();
this.label10 = new System.Windows.Forms.Label(); this.label10 = new System.Windows.Forms.Label();
this.OuterRadTextBox = new System.Windows.Forms.TextBox(); this.OuterRadiusTextBox = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label();
this.Unk01TextBox = new System.Windows.Forms.TextBox(); this.Unk01TextBox = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label();
@ -74,7 +74,7 @@
this.label2 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label();
this.ChildSoundTextBox = new System.Windows.Forms.TextBox(); this.ChildSoundTextBox = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.InnerRadTextBox = new System.Windows.Forms.TextBox(); this.InnerRadiusTextBox = new System.Windows.Forms.TextBox();
this.label16 = new System.Windows.Forms.Label(); this.label16 = new System.Windows.Forms.Label();
this.PositionTextBox = new System.Windows.Forms.TextBox(); this.PositionTextBox = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label();
@ -89,7 +89,7 @@
((System.ComponentModel.ISupportInitialize)(this.Unk09UpDown)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.Unk09UpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.Unk07UpDown)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.Unk07UpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.Unk08UpDown)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.Unk08UpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.Unk06UpDown)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.FrequencyUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.EndTimeUpDown)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.EndTimeUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.StartTimeUpDown)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.StartTimeUpDown)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
@ -129,7 +129,7 @@
this.tabPage1.Controls.Add(this.Unk09UpDown); this.tabPage1.Controls.Add(this.Unk09UpDown);
this.tabPage1.Controls.Add(this.Unk07UpDown); this.tabPage1.Controls.Add(this.Unk07UpDown);
this.tabPage1.Controls.Add(this.Unk08UpDown); this.tabPage1.Controls.Add(this.Unk08UpDown);
this.tabPage1.Controls.Add(this.Unk06UpDown); this.tabPage1.Controls.Add(this.FrequencyUpDown);
this.tabPage1.Controls.Add(this.EndTimeUpDown); this.tabPage1.Controls.Add(this.EndTimeUpDown);
this.tabPage1.Controls.Add(this.StartTimeUpDown); this.tabPage1.Controls.Add(this.StartTimeUpDown);
this.tabPage1.Controls.Add(this.label23); this.tabPage1.Controls.Add(this.label23);
@ -143,7 +143,7 @@
this.tabPage1.Controls.Add(this.label21); this.tabPage1.Controls.Add(this.label21);
this.tabPage1.Controls.Add(this.Flags2TextBox); this.tabPage1.Controls.Add(this.Flags2TextBox);
this.tabPage1.Controls.Add(this.label20); this.tabPage1.Controls.Add(this.label20);
this.tabPage1.Controls.Add(this.ExtParamsTextBox); this.tabPage1.Controls.Add(this.VariablesTextBox);
this.tabPage1.Controls.Add(this.label15); this.tabPage1.Controls.Add(this.label15);
this.tabPage1.Controls.Add(this.label17); this.tabPage1.Controls.Add(this.label17);
this.tabPage1.Controls.Add(this.label18); this.tabPage1.Controls.Add(this.label18);
@ -156,7 +156,7 @@
this.tabPage1.Controls.Add(this.label6); this.tabPage1.Controls.Add(this.label6);
this.tabPage1.Controls.Add(this.label7); this.tabPage1.Controls.Add(this.label7);
this.tabPage1.Controls.Add(this.label10); this.tabPage1.Controls.Add(this.label10);
this.tabPage1.Controls.Add(this.OuterRadTextBox); this.tabPage1.Controls.Add(this.OuterRadiusTextBox);
this.tabPage1.Controls.Add(this.label4); this.tabPage1.Controls.Add(this.label4);
this.tabPage1.Controls.Add(this.Unk01TextBox); this.tabPage1.Controls.Add(this.Unk01TextBox);
this.tabPage1.Controls.Add(this.label3); this.tabPage1.Controls.Add(this.label3);
@ -164,7 +164,7 @@
this.tabPage1.Controls.Add(this.label2); this.tabPage1.Controls.Add(this.label2);
this.tabPage1.Controls.Add(this.ChildSoundTextBox); this.tabPage1.Controls.Add(this.ChildSoundTextBox);
this.tabPage1.Controls.Add(this.label1); this.tabPage1.Controls.Add(this.label1);
this.tabPage1.Controls.Add(this.InnerRadTextBox); this.tabPage1.Controls.Add(this.InnerRadiusTextBox);
this.tabPage1.Controls.Add(this.label16); this.tabPage1.Controls.Add(this.label16);
this.tabPage1.Controls.Add(this.PositionTextBox); this.tabPage1.Controls.Add(this.PositionTextBox);
this.tabPage1.Location = new System.Drawing.Point(4, 22); this.tabPage1.Location = new System.Drawing.Point(4, 22);
@ -266,18 +266,18 @@
this.Unk08UpDown.TabIndex = 53; this.Unk08UpDown.TabIndex = 53;
this.Unk08UpDown.ValueChanged += new System.EventHandler(this.Unk08UpDown_ValueChanged); this.Unk08UpDown.ValueChanged += new System.EventHandler(this.Unk08UpDown_ValueChanged);
// //
// Unk06UpDown // FrequencyUpDown
// //
this.Unk06UpDown.Location = new System.Drawing.Point(84, 227); this.FrequencyUpDown.Location = new System.Drawing.Point(84, 227);
this.Unk06UpDown.Maximum = new decimal(new int[] { this.FrequencyUpDown.Maximum = new decimal(new int[] {
65535, 65535,
0, 0,
0, 0,
0}); 0});
this.Unk06UpDown.Name = "Unk06UpDown"; this.FrequencyUpDown.Name = "FrequencyUpDown";
this.Unk06UpDown.Size = new System.Drawing.Size(102, 20); this.FrequencyUpDown.Size = new System.Drawing.Size(102, 20);
this.Unk06UpDown.TabIndex = 49; this.FrequencyUpDown.TabIndex = 49;
this.Unk06UpDown.ValueChanged += new System.EventHandler(this.Unk06UpDown_ValueChanged); this.FrequencyUpDown.ValueChanged += new System.EventHandler(this.FrequencyUpDown_ValueChanged);
// //
// EndTimeUpDown // EndTimeUpDown
// //
@ -413,17 +413,17 @@
this.label20.TabIndex = 82; this.label20.TabIndex = 82;
this.label20.Text = "Ext params:\r\nName (hash), Value (float), Flags"; this.label20.Text = "Ext params:\r\nName (hash), Value (float), Flags";
// //
// ExtParamsTextBox // VariablesTextBox
// //
this.ExtParamsTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.VariablesTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.ExtParamsTextBox.Location = new System.Drawing.Point(282, 271); this.VariablesTextBox.Location = new System.Drawing.Point(282, 271);
this.ExtParamsTextBox.Multiline = true; this.VariablesTextBox.Multiline = true;
this.ExtParamsTextBox.Name = "ExtParamsTextBox"; this.VariablesTextBox.Name = "VariablesTextBox";
this.ExtParamsTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both; this.VariablesTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.ExtParamsTextBox.Size = new System.Drawing.Size(262, 140); this.VariablesTextBox.Size = new System.Drawing.Size(262, 140);
this.ExtParamsTextBox.TabIndex = 83; this.VariablesTextBox.TabIndex = 83;
this.ExtParamsTextBox.WordWrap = false; this.VariablesTextBox.WordWrap = false;
this.ExtParamsTextBox.TextChanged += new System.EventHandler(this.ExtParamsTextBox_TextChanged); this.VariablesTextBox.TextChanged += new System.EventHandler(this.VariablesTextBox_TextChanged);
// //
// label15 // label15
// //
@ -536,15 +536,15 @@
this.label10.TabIndex = 35; this.label10.TabIndex = 35;
this.label10.Text = "Outer radius:"; this.label10.Text = "Outer radius:";
// //
// OuterRadTextBox // OuterRadiusTextBox
// //
this.OuterRadTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) this.OuterRadiusTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.OuterRadTextBox.Location = new System.Drawing.Point(84, 78); this.OuterRadiusTextBox.Location = new System.Drawing.Point(84, 78);
this.OuterRadTextBox.Name = "OuterRadTextBox"; this.OuterRadiusTextBox.Name = "OuterRadiusTextBox";
this.OuterRadTextBox.Size = new System.Drawing.Size(237, 20); this.OuterRadiusTextBox.Size = new System.Drawing.Size(237, 20);
this.OuterRadTextBox.TabIndex = 36; this.OuterRadiusTextBox.TabIndex = 36;
this.OuterRadTextBox.TextChanged += new System.EventHandler(this.OuterRadTextBox_TextChanged); this.OuterRadiusTextBox.TextChanged += new System.EventHandler(this.OuterRadiusTextBox_TextChanged);
// //
// label4 // label4
// //
@ -612,15 +612,15 @@
this.label1.TabIndex = 33; this.label1.TabIndex = 33;
this.label1.Text = "Inner radius:"; this.label1.Text = "Inner radius:";
// //
// InnerRadTextBox // InnerRadiusTextBox
// //
this.InnerRadTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) this.InnerRadiusTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.InnerRadTextBox.Location = new System.Drawing.Point(84, 54); this.InnerRadiusTextBox.Location = new System.Drawing.Point(84, 54);
this.InnerRadTextBox.Name = "InnerRadTextBox"; this.InnerRadiusTextBox.Name = "InnerRadiusTextBox";
this.InnerRadTextBox.Size = new System.Drawing.Size(237, 20); this.InnerRadiusTextBox.Size = new System.Drawing.Size(237, 20);
this.InnerRadTextBox.TabIndex = 34; this.InnerRadiusTextBox.TabIndex = 34;
this.InnerRadTextBox.TextChanged += new System.EventHandler(this.InnerRadTextBox_TextChanged); this.InnerRadiusTextBox.TextChanged += new System.EventHandler(this.InnerRadiusTextBox_TextChanged);
// //
// label16 // label16
// //
@ -688,7 +688,7 @@
((System.ComponentModel.ISupportInitialize)(this.Unk09UpDown)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.Unk09UpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.Unk07UpDown)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.Unk07UpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.Unk08UpDown)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.Unk08UpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.Unk06UpDown)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.FrequencyUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.EndTimeUpDown)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.EndTimeUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.StartTimeUpDown)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.StartTimeUpDown)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
@ -705,7 +705,7 @@
private System.Windows.Forms.Label label21; private System.Windows.Forms.Label label21;
private System.Windows.Forms.TextBox Flags2TextBox; private System.Windows.Forms.TextBox Flags2TextBox;
private System.Windows.Forms.Label label20; private System.Windows.Forms.Label label20;
private WinForms.TextBoxFix ExtParamsTextBox; private WinForms.TextBoxFix VariablesTextBox;
private System.Windows.Forms.Label label15; private System.Windows.Forms.Label label15;
private System.Windows.Forms.Label label17; private System.Windows.Forms.Label label17;
private System.Windows.Forms.Label label18; private System.Windows.Forms.Label label18;
@ -718,7 +718,7 @@
private System.Windows.Forms.Label label6; private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label7; private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label10; private System.Windows.Forms.Label label10;
private System.Windows.Forms.TextBox OuterRadTextBox; private System.Windows.Forms.TextBox OuterRadiusTextBox;
private System.Windows.Forms.Label label4; private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox Unk01TextBox; private System.Windows.Forms.TextBox Unk01TextBox;
private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label3;
@ -726,7 +726,7 @@
private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox ChildSoundTextBox; private System.Windows.Forms.TextBox ChildSoundTextBox;
private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox InnerRadTextBox; private System.Windows.Forms.TextBox InnerRadiusTextBox;
private System.Windows.Forms.Label label16; private System.Windows.Forms.Label label16;
private System.Windows.Forms.TextBox PositionTextBox; private System.Windows.Forms.TextBox PositionTextBox;
private System.Windows.Forms.Label label23; private System.Windows.Forms.Label label23;
@ -735,7 +735,7 @@
private System.Windows.Forms.TextBox Flags4TextBox; private System.Windows.Forms.TextBox Flags4TextBox;
private System.Windows.Forms.Label label19; private System.Windows.Forms.Label label19;
private System.Windows.Forms.TextBox Flags3TextBox; private System.Windows.Forms.TextBox Flags3TextBox;
private System.Windows.Forms.NumericUpDown Unk06UpDown; private System.Windows.Forms.NumericUpDown FrequencyUpDown;
private System.Windows.Forms.NumericUpDown EndTimeUpDown; private System.Windows.Forms.NumericUpDown EndTimeUpDown;
private System.Windows.Forms.NumericUpDown StartTimeUpDown; private System.Windows.Forms.NumericUpDown StartTimeUpDown;
private System.Windows.Forms.NumericUpDown Unk07UpDown; private System.Windows.Forms.NumericUpDown Unk07UpDown;

View File

@ -51,14 +51,14 @@ namespace CodeWalker.Project.Panels
populatingui = true; populatingui = true;
NameTextBox.Text = string.Empty; NameTextBox.Text = string.Empty;
PositionTextBox.Text = string.Empty; PositionTextBox.Text = string.Empty;
InnerRadTextBox.Text = string.Empty; InnerRadiusTextBox.Text = string.Empty;
OuterRadTextBox.Text = string.Empty; OuterRadiusTextBox.Text = string.Empty;
ChildSoundTextBox.Text = string.Empty; ChildSoundTextBox.Text = string.Empty;
CategoryTextBox.Text = string.Empty; CategoryTextBox.Text = string.Empty;
Unk01TextBox.Text = string.Empty; Unk01TextBox.Text = string.Empty;
StartTimeUpDown.Value = 0; StartTimeUpDown.Value = 0;
EndTimeUpDown.Value = 0; EndTimeUpDown.Value = 0;
Unk06UpDown.Value = 0; FrequencyUpDown.Value = 0;
Unk07UpDown.Value = 0; Unk07UpDown.Value = 0;
Unk08UpDown.Value = 0; Unk08UpDown.Value = 0;
Unk09UpDown.Value = 0; Unk09UpDown.Value = 0;
@ -72,7 +72,7 @@ namespace CodeWalker.Project.Panels
Flags3TextBox.Text = string.Empty; Flags3TextBox.Text = string.Empty;
Flags4TextBox.Text = string.Empty; Flags4TextBox.Text = string.Empty;
Flags5TextBox.Text = string.Empty; Flags5TextBox.Text = string.Empty;
ExtParamsTextBox.Text = string.Empty; VariablesTextBox.Text = string.Empty;
populatingui = false; populatingui = false;
} }
else else
@ -84,14 +84,14 @@ namespace CodeWalker.Project.Panels
var e = CurrentEmitter.AudioEmitter; var e = CurrentEmitter.AudioEmitter;
NameTextBox.Text = e.NameHash.ToString(); NameTextBox.Text = e.NameHash.ToString();
PositionTextBox.Text = FloatUtil.GetVector3String(e.Position); PositionTextBox.Text = FloatUtil.GetVector3String(e.Position);
InnerRadTextBox.Text = FloatUtil.ToString(e.InnerRad); InnerRadiusTextBox.Text = FloatUtil.ToString(e.InnerRadius);
OuterRadTextBox.Text = FloatUtil.ToString(e.OuterRad); OuterRadiusTextBox.Text = FloatUtil.ToString(e.OuterRadius);
ChildSoundTextBox.Text = e.ChildSound.ToString(); ChildSoundTextBox.Text = e.ChildSound.ToString();
CategoryTextBox.Text = e.Category.ToString(); CategoryTextBox.Text = e.Category.ToString();
Unk01TextBox.Text = FloatUtil.ToString(e.Unk01); Unk01TextBox.Text = FloatUtil.ToString(e.Unk01);
StartTimeUpDown.Value = e.StartTime; StartTimeUpDown.Value = e.StartTime;
EndTimeUpDown.Value = e.EndTime; EndTimeUpDown.Value = e.EndTime;
Unk06UpDown.Value = e.Unk06.Value; FrequencyUpDown.Value = e.Frequency.Value;
Unk07UpDown.Value = e.Unk07.Value; Unk07UpDown.Value = e.Unk07.Value;
Unk08UpDown.Value = e.Unk08.Value; Unk08UpDown.Value = e.Unk08.Value;
Unk09UpDown.Value = e.Unk09.Value; Unk09UpDown.Value = e.Unk09.Value;
@ -107,11 +107,11 @@ namespace CodeWalker.Project.Panels
Flags5TextBox.Text = e.Flags5.Hex; Flags5TextBox.Text = e.Flags5.Hex;
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
if (e.ExtParams != null) if (e.Variables != null)
{ {
foreach (var extparam in e.ExtParams) foreach (var extparam in e.Variables)
{ {
sb.Append(extparam.Hash.ToString()); sb.Append(extparam.Name.ToString());
sb.Append(", "); sb.Append(", ");
sb.Append(FloatUtil.ToString(extparam.Value)); sb.Append(FloatUtil.ToString(extparam.Value));
sb.Append(", "); sb.Append(", ");
@ -119,7 +119,7 @@ namespace CodeWalker.Project.Panels
sb.AppendLine(); sb.AppendLine();
} }
} }
ExtParamsTextBox.Text = sb.ToString(); VariablesTextBox.Text = sb.ToString();
populatingui = false; populatingui = false;
@ -189,29 +189,29 @@ namespace CodeWalker.Project.Panels
} }
} }
private void InnerRadTextBox_TextChanged(object sender, EventArgs e) private void InnerRadiusTextBox_TextChanged(object sender, EventArgs e)
{ {
if (populatingui) return; if (populatingui) return;
if (CurrentEmitter?.AudioEmitter == null) return; if (CurrentEmitter?.AudioEmitter == null) return;
float rad = FloatUtil.Parse(InnerRadTextBox.Text); float rad = FloatUtil.Parse(InnerRadiusTextBox.Text);
if (CurrentEmitter.AudioEmitter.InnerRad != rad) if (CurrentEmitter.AudioEmitter.InnerRadius != rad)
{ {
CurrentEmitter.AudioEmitter.InnerRad = rad; CurrentEmitter.AudioEmitter.InnerRadius = rad;
ProjectItemChanged(); ProjectItemChanged();
} }
} }
private void OuterRadTextBox_TextChanged(object sender, EventArgs e) private void OuterRadiusTextBox_TextChanged(object sender, EventArgs e)
{ {
if (populatingui) return; if (populatingui) return;
if (CurrentEmitter?.AudioEmitter == null) return; if (CurrentEmitter?.AudioEmitter == null) return;
float rad = FloatUtil.Parse(OuterRadTextBox.Text); float rad = FloatUtil.Parse(OuterRadiusTextBox.Text);
if (CurrentEmitter.AudioEmitter.OuterRad != rad) if (CurrentEmitter.AudioEmitter.OuterRadius != rad)
{ {
CurrentEmitter.AudioEmitter.OuterRad = rad; CurrentEmitter.AudioEmitter.OuterRadius = rad;
ProjectItemChanged(); ProjectItemChanged();
} }
@ -303,15 +303,15 @@ namespace CodeWalker.Project.Panels
} }
} }
private void Unk06UpDown_ValueChanged(object sender, EventArgs e) private void FrequencyUpDown_ValueChanged(object sender, EventArgs e)
{ {
if (populatingui) return; if (populatingui) return;
if (CurrentEmitter?.AudioEmitter == null) return; if (CurrentEmitter?.AudioEmitter == null) return;
ushort unk = (ushort)Unk06UpDown.Value; ushort unk = (ushort)FrequencyUpDown.Value;
if (CurrentEmitter.AudioEmitter.Unk06.Value != unk) if (CurrentEmitter.AudioEmitter.Frequency.Value != unk)
{ {
CurrentEmitter.AudioEmitter.Unk06 = unk; CurrentEmitter.AudioEmitter.Frequency = unk;
ProjectItemChanged(); ProjectItemChanged();
} }
@ -517,21 +517,21 @@ namespace CodeWalker.Project.Panels
} }
} }
private void ExtParamsTextBox_TextChanged(object sender, EventArgs e) private void VariablesTextBox_TextChanged(object sender, EventArgs e)
{ {
if (populatingui) return; if (populatingui) return;
if (CurrentEmitter?.AudioEmitter == null) return; if (CurrentEmitter?.AudioEmitter == null) return;
var paramstrs = ExtParamsTextBox.Text.Split(new[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries); var paramstrs = VariablesTextBox.Text.Split(new[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
if (paramstrs?.Length > 0) if (paramstrs?.Length > 0)
{ {
var paramlist = new List<Dat151AmbientRule.ExtParam>(); var paramlist = new List<Dat151AmbientRule.Variable>();
foreach (var paramstr in paramstrs) foreach (var paramstr in paramstrs)
{ {
var paramvals = paramstr.Split(','); var paramvals = paramstr.Split(',');
if (paramvals?.Length == 3) if (paramvals?.Length == 3)
{ {
var param = new Dat151AmbientRule.ExtParam(); var param = new Dat151AmbientRule.Variable();
var hashstr = paramvals[0].Trim(); var hashstr = paramvals[0].Trim();
var valstr = paramvals[1].Trim(); var valstr = paramvals[1].Trim();
var flgstr = paramvals[2].Trim(); var flgstr = paramvals[2].Trim();
@ -543,15 +543,15 @@ namespace CodeWalker.Project.Panels
} }
uint flags = 0; uint flags = 0;
uint.TryParse(flgstr, out flags); uint.TryParse(flgstr, out flags);
param.Hash = hash; param.Name = hash;
param.Value = FloatUtil.Parse(valstr); param.Value = FloatUtil.Parse(valstr);
param.Flags = flags; param.Flags = flags;
paramlist.Add(param); paramlist.Add(param);
} }
} }
CurrentEmitter.AudioEmitter.ExtParams = paramlist.ToArray(); CurrentEmitter.AudioEmitter.Variables = paramlist.ToArray();
CurrentEmitter.AudioEmitter.ExtParamsCount = (ushort)paramlist.Count; CurrentEmitter.AudioEmitter.VariablesCount = (ushort)paramlist.Count;
ProjectItemChanged(); ProjectItemChanged();
} }

View File

@ -35,11 +35,11 @@
this.HashesTextBox = new CodeWalker.WinForms.TextBoxFix(); this.HashesTextBox = new CodeWalker.WinForms.TextBoxFix();
this.DeleteButton = new System.Windows.Forms.Button(); this.DeleteButton = new System.Windows.Forms.Button();
this.label21 = new System.Windows.Forms.Label(); this.label21 = new System.Windows.Forms.Label();
this.Flags2TextBox = new System.Windows.Forms.TextBox(); this.TunnelTextBox = new System.Windows.Forms.TextBox();
this.label14 = new System.Windows.Forms.Label(); this.label14 = new System.Windows.Forms.Label();
this.Flags1TextBox = new System.Windows.Forms.TextBox(); this.WallaTextBox = new System.Windows.Forms.TextBox();
this.label13 = new System.Windows.Forms.Label(); this.label13 = new System.Windows.Forms.Label();
this.Flags0TextBox = new System.Windows.Forms.TextBox(); this.FlagsTextBox = new System.Windows.Forms.TextBox();
this.SuspendLayout(); this.SuspendLayout();
// //
// label12 // label12
@ -102,15 +102,15 @@
this.label21.Name = "label21"; this.label21.Name = "label21";
this.label21.Size = new System.Drawing.Size(44, 13); this.label21.Size = new System.Drawing.Size(44, 13);
this.label21.TabIndex = 13; this.label21.TabIndex = 13;
this.label21.Text = "Flags 2:"; this.label21.Text = "Tunnel:";
// //
// Flags2TextBox // TunnelTextBox
// //
this.Flags2TextBox.Location = new System.Drawing.Point(108, 84); this.TunnelTextBox.Location = new System.Drawing.Point(108, 84);
this.Flags2TextBox.Name = "Flags2TextBox"; this.TunnelTextBox.Name = "TunnelTextBox";
this.Flags2TextBox.Size = new System.Drawing.Size(155, 20); this.TunnelTextBox.Size = new System.Drawing.Size(155, 20);
this.Flags2TextBox.TabIndex = 14; this.TunnelTextBox.TabIndex = 14;
this.Flags2TextBox.TextChanged += new System.EventHandler(this.Flags2TextBox_TextChanged); this.TunnelTextBox.TextChanged += new System.EventHandler(this.TunnelTextBox_TextChanged);
// //
// label14 // label14
// //
@ -119,15 +119,15 @@
this.label14.Name = "label14"; this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(44, 13); this.label14.Size = new System.Drawing.Size(44, 13);
this.label14.TabIndex = 11; this.label14.TabIndex = 11;
this.label14.Text = "Flags 1:"; this.label14.Text = "Walla:";
// //
// Flags1TextBox // WallaTextBox
// //
this.Flags1TextBox.Location = new System.Drawing.Point(108, 60); this.WallaTextBox.Location = new System.Drawing.Point(108, 60);
this.Flags1TextBox.Name = "Flags1TextBox"; this.WallaTextBox.Name = "WallaTextBox";
this.Flags1TextBox.Size = new System.Drawing.Size(155, 20); this.WallaTextBox.Size = new System.Drawing.Size(155, 20);
this.Flags1TextBox.TabIndex = 12; this.WallaTextBox.TabIndex = 12;
this.Flags1TextBox.TextChanged += new System.EventHandler(this.Flags1TextBox_TextChanged); this.WallaTextBox.TextChanged += new System.EventHandler(this.WallaTextBox_TextChanged);
// //
// label13 // label13
// //
@ -136,15 +136,15 @@
this.label13.Name = "label13"; this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(44, 13); this.label13.Size = new System.Drawing.Size(44, 13);
this.label13.TabIndex = 9; this.label13.TabIndex = 9;
this.label13.Text = "Flags 0:"; this.label13.Text = "Flags:";
// //
// Flags0TextBox // FlagsTextBox
// //
this.Flags0TextBox.Location = new System.Drawing.Point(108, 36); this.FlagsTextBox.Location = new System.Drawing.Point(108, 36);
this.Flags0TextBox.Name = "Flags0TextBox"; this.FlagsTextBox.Name = "FlagsTextBox";
this.Flags0TextBox.Size = new System.Drawing.Size(155, 20); this.FlagsTextBox.Size = new System.Drawing.Size(155, 20);
this.Flags0TextBox.TabIndex = 10; this.FlagsTextBox.TabIndex = 10;
this.Flags0TextBox.TextChanged += new System.EventHandler(this.Flags0TextBox_TextChanged); this.FlagsTextBox.TextChanged += new System.EventHandler(this.FlagsTextBox_TextChanged);
// //
// EditAudioInteriorPanel // EditAudioInteriorPanel
// //
@ -153,11 +153,11 @@
this.ClientSize = new System.Drawing.Size(562, 450); this.ClientSize = new System.Drawing.Size(562, 450);
this.Controls.Add(this.DeleteButton); this.Controls.Add(this.DeleteButton);
this.Controls.Add(this.label21); this.Controls.Add(this.label21);
this.Controls.Add(this.Flags2TextBox); this.Controls.Add(this.TunnelTextBox);
this.Controls.Add(this.label14); this.Controls.Add(this.label14);
this.Controls.Add(this.Flags1TextBox); this.Controls.Add(this.WallaTextBox);
this.Controls.Add(this.label13); this.Controls.Add(this.label13);
this.Controls.Add(this.Flags0TextBox); this.Controls.Add(this.FlagsTextBox);
this.Controls.Add(this.label12); this.Controls.Add(this.label12);
this.Controls.Add(this.NameTextBox); this.Controls.Add(this.NameTextBox);
this.Controls.Add(this.label19); this.Controls.Add(this.label19);
@ -178,10 +178,10 @@
private WinForms.TextBoxFix HashesTextBox; private WinForms.TextBoxFix HashesTextBox;
private System.Windows.Forms.Button DeleteButton; private System.Windows.Forms.Button DeleteButton;
private System.Windows.Forms.Label label21; private System.Windows.Forms.Label label21;
private System.Windows.Forms.TextBox Flags2TextBox; private System.Windows.Forms.TextBox TunnelTextBox;
private System.Windows.Forms.Label label14; private System.Windows.Forms.Label label14;
private System.Windows.Forms.TextBox Flags1TextBox; private System.Windows.Forms.TextBox WallaTextBox;
private System.Windows.Forms.Label label13; private System.Windows.Forms.Label label13;
private System.Windows.Forms.TextBox Flags0TextBox; private System.Windows.Forms.TextBox FlagsTextBox;
} }
} }

View File

@ -49,9 +49,9 @@ namespace CodeWalker.Project.Panels
populatingui = true; populatingui = true;
NameTextBox.Text = string.Empty; NameTextBox.Text = string.Empty;
Flags0TextBox.Text = string.Empty; FlagsTextBox.Text = string.Empty;
Flags1TextBox.Text = string.Empty; WallaTextBox.Text = string.Empty;
Flags2TextBox.Text = string.Empty; TunnelTextBox.Text = string.Empty;
HashesTextBox.Text = string.Empty; HashesTextBox.Text = string.Empty;
populatingui = false; populatingui = false;
} }
@ -65,9 +65,9 @@ namespace CodeWalker.Project.Panels
NameTextBox.Text = ci.NameHash.ToString(); NameTextBox.Text = ci.NameHash.ToString();
Flags0TextBox.Text = ci.Unk0.Hex; FlagsTextBox.Text = ci.Flags.Hex;
Flags1TextBox.Text = ci.Unk1.Hex; WallaTextBox.Text = ci.Walla.ToString();
Flags2TextBox.Text = ci.Unk2.Hex; TunnelTextBox.Text = ci.Tunnel.ToString();
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
if (ci.Rooms != null) if (ci.Rooms != null)
@ -120,56 +120,64 @@ namespace CodeWalker.Project.Panels
} }
} }
private void Flags0TextBox_TextChanged(object sender, EventArgs e) private void FlagsTextBox_TextChanged(object sender, EventArgs e)
{ {
if (populatingui) return; if (populatingui) return;
if (CurrentInterior == null) return; if (CurrentInterior == null) return;
uint flags = 0; 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 (CurrentInterior.Unk0 != flags) if (CurrentInterior.Flags != flags)
{ {
CurrentInterior.Unk0 = flags; CurrentInterior.Flags = flags;
ProjectItemChanged(); ProjectItemChanged();
} }
} }
} }
private void Flags1TextBox_TextChanged(object sender, EventArgs e) private void WallaTextBox_TextChanged(object sender, EventArgs e)
{ {
if (populatingui) return; if (populatingui) return;
if (CurrentInterior == null) return; if (CurrentInterior == null) return;
uint flags = 0; uint hash = 0;
if (uint.TryParse(Flags1TextBox.Text, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out flags)) string name = WallaTextBox.Text;
if (!uint.TryParse(name, out hash))//don't re-hash hashes
{ {
if (CurrentInterior.Unk1 != flags) hash = JenkHash.GenHash(name);
JenkIndex.Ensure(name);
}
if (CurrentInterior.Walla != hash)
{ {
CurrentInterior.Unk1 = flags; CurrentInterior.Walla = hash;
ProjectItemChanged(); ProjectItemChanged();
} }
} }
}
private void Flags2TextBox_TextChanged(object sender, EventArgs e) private void TunnelTextBox_TextChanged(object sender, EventArgs e)
{ {
if (populatingui) return; if (populatingui) return;
if (CurrentInterior == null) return; if (CurrentInterior == null) return;
uint flags = 0; uint hash = 0;
if (uint.TryParse(Flags2TextBox.Text, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out flags)) string name = TunnelTextBox.Text;
if (!uint.TryParse(name, out hash))//don't re-hash hashes
{ {
if (CurrentInterior.Unk2 != flags) hash = JenkHash.GenHash(name);
JenkIndex.Ensure(name);
}
if (CurrentInterior.Tunnel != hash)
{ {
CurrentInterior.Unk2 = flags; CurrentInterior.Tunnel = hash;
ProjectItemChanged(); ProjectItemChanged();
} }
} }
}
private void HashesTextBox_TextChanged(object sender, EventArgs e) private void HashesTextBox_TextChanged(object sender, EventArgs e)
{ {

View File

@ -36,9 +36,9 @@
this.DeleteButton = new System.Windows.Forms.Button(); this.DeleteButton = new System.Windows.Forms.Button();
this.AddToProjectButton = new System.Windows.Forms.Button(); this.AddToProjectButton = new System.Windows.Forms.Button();
this.label21 = new System.Windows.Forms.Label(); this.label21 = new System.Windows.Forms.Label();
this.Flags2TextBox = new System.Windows.Forms.TextBox(); this.Unk13TextBox = new System.Windows.Forms.TextBox();
this.label20 = new System.Windows.Forms.Label(); this.label20 = new System.Windows.Forms.Label();
this.ExtParamsTextBox = new CodeWalker.WinForms.TextBoxFix(); this.DependentAmbiencesTextBox = new CodeWalker.WinForms.TextBoxFix();
this.label19 = new System.Windows.Forms.Label(); this.label19 = new System.Windows.Forms.Label();
this.label15 = new System.Windows.Forms.Label(); this.label15 = new System.Windows.Forms.Label();
this.UnkVec3TextBox = new System.Windows.Forms.TextBox(); this.UnkVec3TextBox = new System.Windows.Forms.TextBox();
@ -111,9 +111,9 @@
this.tabPage1.Controls.Add(this.DeleteButton); this.tabPage1.Controls.Add(this.DeleteButton);
this.tabPage1.Controls.Add(this.AddToProjectButton); this.tabPage1.Controls.Add(this.AddToProjectButton);
this.tabPage1.Controls.Add(this.label21); this.tabPage1.Controls.Add(this.label21);
this.tabPage1.Controls.Add(this.Flags2TextBox); this.tabPage1.Controls.Add(this.Unk13TextBox);
this.tabPage1.Controls.Add(this.label20); this.tabPage1.Controls.Add(this.label20);
this.tabPage1.Controls.Add(this.ExtParamsTextBox); this.tabPage1.Controls.Add(this.DependentAmbiencesTextBox);
this.tabPage1.Controls.Add(this.label19); this.tabPage1.Controls.Add(this.label19);
this.tabPage1.Controls.Add(this.label15); this.tabPage1.Controls.Add(this.label15);
this.tabPage1.Controls.Add(this.UnkVec3TextBox); this.tabPage1.Controls.Add(this.UnkVec3TextBox);
@ -211,16 +211,16 @@
this.label21.Name = "label21"; this.label21.Name = "label21";
this.label21.Size = new System.Drawing.Size(44, 13); this.label21.Size = new System.Drawing.Size(44, 13);
this.label21.TabIndex = 70; this.label21.TabIndex = 70;
this.label21.Text = "Flags 2:"; this.label21.Text = "Unk13:";
// //
// Flags2TextBox // Unk13TextBox
// //
this.Flags2TextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.Unk13TextBox.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.Unk13TextBox.Location = new System.Drawing.Point(390, 103);
this.Flags2TextBox.Name = "Flags2TextBox"; this.Unk13TextBox.Name = "Unk13TextBox";
this.Flags2TextBox.Size = new System.Drawing.Size(155, 20); this.Unk13TextBox.Size = new System.Drawing.Size(155, 20);
this.Flags2TextBox.TabIndex = 71; this.Unk13TextBox.TabIndex = 71;
this.Flags2TextBox.TextChanged += new System.EventHandler(this.Flags2TextBox_TextChanged); this.Unk13TextBox.TextChanged += new System.EventHandler(this.Unk13TextBox_TextChanged);
// //
// label20 // label20
// //
@ -232,17 +232,17 @@
this.label20.TabIndex = 78; this.label20.TabIndex = 78;
this.label20.Text = "Ext params: Name (hash), Value (float)"; this.label20.Text = "Ext params: Name (hash), Value (float)";
// //
// ExtParamsTextBox // DependentAmbiencesTextBox
// //
this.ExtParamsTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.DependentAmbiencesTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.ExtParamsTextBox.Location = new System.Drawing.Point(335, 319); this.DependentAmbiencesTextBox.Location = new System.Drawing.Point(335, 319);
this.ExtParamsTextBox.Multiline = true; this.DependentAmbiencesTextBox.Multiline = true;
this.ExtParamsTextBox.Name = "ExtParamsTextBox"; this.DependentAmbiencesTextBox.Name = "DependentAmbiencesTextBox";
this.ExtParamsTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both; this.DependentAmbiencesTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.ExtParamsTextBox.Size = new System.Drawing.Size(209, 92); this.DependentAmbiencesTextBox.Size = new System.Drawing.Size(209, 92);
this.ExtParamsTextBox.TabIndex = 79; this.DependentAmbiencesTextBox.TabIndex = 79;
this.ExtParamsTextBox.WordWrap = false; this.DependentAmbiencesTextBox.WordWrap = false;
this.ExtParamsTextBox.TextChanged += new System.EventHandler(this.ExtParamsTextBox_TextChanged); this.DependentAmbiencesTextBox.TextChanged += new System.EventHandler(this.DependentAmbiencesTextBox_TextChanged);
// //
// label19 // label19
// //
@ -741,10 +741,10 @@
private System.Windows.Forms.Label label18; private System.Windows.Forms.Label label18;
private System.Windows.Forms.TextBox UnkVec1TextBox; private System.Windows.Forms.TextBox UnkVec1TextBox;
private System.Windows.Forms.Label label20; private System.Windows.Forms.Label label20;
private WinForms.TextBoxFix ExtParamsTextBox; private WinForms.TextBoxFix DependentAmbiencesTextBox;
private System.Windows.Forms.Label label19; private System.Windows.Forms.Label label19;
private System.Windows.Forms.Label label21; private System.Windows.Forms.Label label21;
private System.Windows.Forms.TextBox Flags2TextBox; private System.Windows.Forms.TextBox Unk13TextBox;
private System.Windows.Forms.Button AddToProjectButton; private System.Windows.Forms.Button AddToProjectButton;
private System.Windows.Forms.Button DeleteButton; private System.Windows.Forms.Button DeleteButton;
private System.Windows.Forms.Label label22; private System.Windows.Forms.Label label22;

View File

@ -71,11 +71,11 @@ namespace CodeWalker.Project.Panels
UnkBytesTextBox.Text = string.Empty; UnkBytesTextBox.Text = string.Empty;
Flags0TextBox.Text = string.Empty; Flags0TextBox.Text = string.Empty;
Flags1TextBox.Text = string.Empty; Flags1TextBox.Text = string.Empty;
Flags2TextBox.Text = string.Empty; Unk13TextBox.Text = string.Empty;
Hash0TextBox.Text = string.Empty; Hash0TextBox.Text = string.Empty;
SceneTextBox.Text = string.Empty; SceneTextBox.Text = string.Empty;
HashesTextBox.Text = string.Empty; HashesTextBox.Text = string.Empty;
ExtParamsTextBox.Text = string.Empty; DependentAmbiencesTextBox.Text = string.Empty;
populatingui = false; populatingui = false;
} }
else else
@ -105,7 +105,7 @@ namespace CodeWalker.Project.Panels
UnkBytesTextBox.Text = string.Format("{0}, {1}, {2}", z.Unk14, z.Unk15, z.Unk16); UnkBytesTextBox.Text = string.Format("{0}, {1}, {2}", z.Unk14, z.Unk15, z.Unk16);
Flags0TextBox.Text = z.Flags0.Hex; Flags0TextBox.Text = z.Flags0.Hex;
Flags1TextBox.Text = z.Flags1.Hex; Flags1TextBox.Text = z.Flags1.Hex;
Flags2TextBox.Text = z.Flags2.Hex; Unk13TextBox.Text = z.Unk13.Hex;
Hash0TextBox.Text = z.UnkHash0.ToString(); Hash0TextBox.Text = z.UnkHash0.ToString();
SceneTextBox.Text = z.Scene.ToString(); SceneTextBox.Text = z.Scene.ToString();
@ -120,9 +120,9 @@ namespace CodeWalker.Project.Panels
HashesTextBox.Text = sb.ToString(); HashesTextBox.Text = sb.ToString();
sb.Clear(); sb.Clear();
if (z.ExtParams != null) if (z.DependentAmbiences != null)
{ {
foreach (var extparam in z.ExtParams) foreach (var extparam in z.DependentAmbiences)
{ {
sb.Append(extparam.Name.ToString()); sb.Append(extparam.Name.ToString());
sb.Append(", "); sb.Append(", ");
@ -130,7 +130,7 @@ namespace CodeWalker.Project.Panels
sb.AppendLine(); sb.AppendLine();
} }
} }
ExtParamsTextBox.Text = sb.ToString(); DependentAmbiencesTextBox.Text = sb.ToString();
populatingui = false; populatingui = false;
@ -476,22 +476,26 @@ namespace CodeWalker.Project.Panels
} }
} }
private void Flags2TextBox_TextChanged(object sender, EventArgs e) private void Unk13TextBox_TextChanged(object sender, EventArgs e)
{ {
if (populatingui) return; if (populatingui) return;
if (CurrentZone?.AudioZone == null) return; if (CurrentZone?.AudioZone == null) return;
uint flags = 0; var hashstr = Unk13TextBox.Text;
if (uint.TryParse(Flags2TextBox.Text, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out flags)) uint hash = 0;
if (!uint.TryParse(hashstr, out hash))//don't re-hash hashes
{ {
if (CurrentZone.AudioZone.Flags2 != flags) hash = JenkHash.GenHash(hashstr);
JenkIndex.Ensure(hashstr);
}
if (CurrentZone.AudioZone.Unk13 != hash)
{ {
CurrentZone.AudioZone.Flags2 = flags; CurrentZone.AudioZone.Unk13 = hash;
ProjectItemChanged(); ProjectItemChanged();
} }
} }
}
private void Hash0TextBox_TextChanged(object sender, EventArgs e) private void Hash0TextBox_TextChanged(object sender, EventArgs e)
{ {
@ -562,21 +566,21 @@ namespace CodeWalker.Project.Panels
} }
} }
private void ExtParamsTextBox_TextChanged(object sender, EventArgs e) private void DependentAmbiencesTextBox_TextChanged(object sender, EventArgs e)
{ {
if (populatingui) return; if (populatingui) return;
if (CurrentZone?.AudioZone == null) return; if (CurrentZone?.AudioZone == null) return;
var paramstrs = ExtParamsTextBox.Text.Split(new[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries); var paramstrs = DependentAmbiencesTextBox.Text.Split(new[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
if (paramstrs?.Length > 0) if (paramstrs?.Length > 0)
{ {
var paramlist = new List<Dat151AmbientZone.ExtParam>(); var paramlist = new List<Dat151AmbientZone.DependentAmbience>();
foreach (var paramstr in paramstrs) foreach (var paramstr in paramstrs)
{ {
var paramvals = paramstr.Split(','); var paramvals = paramstr.Split(',');
if (paramvals?.Length == 2) if (paramvals?.Length == 2)
{ {
var param = new Dat151AmbientZone.ExtParam(); var param = new Dat151AmbientZone.DependentAmbience();
var hashstr = paramvals[0].Trim(); var hashstr = paramvals[0].Trim();
var valstr = paramvals[1].Trim(); var valstr = paramvals[1].Trim();
uint hash = 0; uint hash = 0;
@ -591,8 +595,8 @@ namespace CodeWalker.Project.Panels
} }
} }
CurrentZone.AudioZone.ExtParams = paramlist.ToArray(); CurrentZone.AudioZone.DependentAmbiences = paramlist.ToArray();
CurrentZone.AudioZone.ExtParamsCount = (uint)paramlist.Count; CurrentZone.AudioZone.DependentAmbiencesCount = (uint)paramlist.Count;
ProjectItemChanged(); ProjectItemChanged();
} }

View File

@ -6413,7 +6413,6 @@ namespace CodeWalker.Project
//AA800420 sphere //AA800420 sphere
zone.Flags0 = cp ? copy.AudioZone.Flags0.Value : 0xAA800424; zone.Flags0 = cp ? copy.AudioZone.Flags0.Value : 0xAA800424;
zone.Flags1 = cp ? copy.AudioZone.Flags1 : 0; zone.Flags1 = cp ? copy.AudioZone.Flags1 : 0;
zone.Flags2 = cp ? copy.AudioZone.Flags2 : 0;
zone.Shape = cp ? copy.AudioZone.Shape : Dat151ZoneShape.Box; zone.Shape = cp ? copy.AudioZone.Shape : Dat151ZoneShape.Box;
zone.PlaybackZoneSize = cp ? copy.AudioZone.PlaybackZoneSize : Vector3.One * 10.0f; zone.PlaybackZoneSize = cp ? copy.AudioZone.PlaybackZoneSize : Vector3.One * 10.0f;
zone.PlaybackZoneAngle = cp ? copy.AudioZone.PlaybackZoneAngle : 0; zone.PlaybackZoneAngle = cp ? copy.AudioZone.PlaybackZoneAngle : 0;
@ -6430,13 +6429,14 @@ namespace CodeWalker.Project
zone.UnkHash0 = cp ? copy.AudioZone.UnkHash0 : 0; zone.UnkHash0 = cp ? copy.AudioZone.UnkHash0 : 0;
zone.Scene = cp ? copy.AudioZone.Scene : 0; zone.Scene = cp ? copy.AudioZone.Scene : 0;
zone.UnkVec3 = cp ? copy.AudioZone.UnkVec3 : new Vector2(-1, 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.Unk14 = cp ? copy.AudioZone.Unk14 : (byte)4;
zone.Unk15 = cp ? copy.AudioZone.Unk15 : (byte)1; zone.Unk15 = cp ? copy.AudioZone.Unk15 : (byte)1;
zone.Unk16 = cp ? copy.AudioZone.Unk16 : (byte)0; zone.Unk16 = cp ? copy.AudioZone.Unk16 : (byte)0;
zone.RulesCount = cp ? copy.AudioZone.RulesCount : (byte)0; zone.RulesCount = cp ? copy.AudioZone.RulesCount : (byte)0;
zone.Rules = cp ? copy.AudioZone.Rules : null; zone.Rules = cp ? copy.AudioZone.Rules : null;
zone.ExtParamsCount = cp ? copy.AudioZone.ExtParamsCount : 0; zone.DependentAmbiencesCount = cp ? copy.AudioZone.DependentAmbiencesCount : 0;
zone.ExtParams = cp ? copy.AudioZone.ExtParams : null; zone.DependentAmbiences = cp ? copy.AudioZone.DependentAmbiences : null;
zone.Name = "zone1"; zone.Name = "zone1";
zone.NameHash = JenkHash.GenHash(zone.Name); zone.NameHash = JenkHash.GenHash(zone.Name);
@ -6538,12 +6538,12 @@ namespace CodeWalker.Project
emitter.Flags0 = cp ? copy.AudioEmitter.Flags0.Value : 0xAA001100; emitter.Flags0 = cp ? copy.AudioEmitter.Flags0.Value : 0xAA001100;
emitter.Flags5 = cp ? copy.AudioEmitter.Flags5.Value : 0xFFFFFFFF; emitter.Flags5 = cp ? copy.AudioEmitter.Flags5.Value : 0xFFFFFFFF;
emitter.InnerRad = cp ? copy.AudioEmitter.InnerRad : 0.0f; emitter.InnerRadius = cp ? copy.AudioEmitter.InnerRadius : 0.0f;
emitter.OuterRad = cp ? copy.AudioEmitter.OuterRad : 20.0f; emitter.OuterRadius = cp ? copy.AudioEmitter.OuterRadius : 20.0f;
emitter.Unk01 = cp ? copy.AudioEmitter.Unk01 : 1.0f; emitter.Unk01 = cp ? copy.AudioEmitter.Unk01 : 1.0f;
emitter.StartTime = cp ? copy.AudioEmitter.StartTime : (ushort)0; emitter.StartTime = cp ? copy.AudioEmitter.StartTime : (ushort)0;
emitter.EndTime = cp ? copy.AudioEmitter.EndTime : (ushort)1440; emitter.EndTime = cp ? copy.AudioEmitter.EndTime : (ushort)1440;
emitter.Unk06 = cp ? copy.AudioEmitter.Unk06.Value : (ushort)0; emitter.Frequency = cp ? copy.AudioEmitter.Frequency.Value : (ushort)0;
emitter.Unk07 = cp ? copy.AudioEmitter.Unk07.Value : (ushort)0; emitter.Unk07 = cp ? copy.AudioEmitter.Unk07.Value : (ushort)0;
emitter.Unk08 = cp ? copy.AudioEmitter.Unk08.Value : (byte)0; emitter.Unk08 = cp ? copy.AudioEmitter.Unk08.Value : (byte)0;
emitter.Unk09 = cp ? copy.AudioEmitter.Unk09.Value : (byte)1; emitter.Unk09 = cp ? copy.AudioEmitter.Unk09.Value : (byte)1;
@ -6782,8 +6782,9 @@ namespace CodeWalker.Project
interior.Name = "interior1"; interior.Name = "interior1";
interior.NameHash = JenkHash.GenHash(interior.Name); interior.NameHash = JenkHash.GenHash(interior.Name);
interior.Unk0 = 0xAAAAA844; interior.Flags = 0xAAAAA844;
interior.Unk1 = 0xD4855127; interior.Walla = 3565506855;
interior.Tunnel = (uint)MetaName.null_sound;
CurrentAudioFile.AddRelData(interior); CurrentAudioFile.AddRelData(interior);

View File

@ -1017,13 +1017,13 @@ namespace CodeWalker
if ((placement.InnerPos != Vector3.Zero) && (placement.OuterPos != Vector3.Zero)) if ((placement.InnerPos != Vector3.Zero) && (placement.OuterPos != Vector3.Zero))
{ {
ms.CamRelPos = placement.InnerPos - camera.Position; ms.CamRelPos = placement.InnerPos - camera.Position;
ms.Radius = placement.InnerRad; ms.Radius = placement.InnerRadius;
Renderer.HilightSpheres.Add(ms); Renderer.HilightSpheres.Add(ms);
if (renderaudioouterbounds) if (renderaudioouterbounds)
{ {
ms.CamRelPos = placement.OuterPos - camera.Position; ms.CamRelPos = placement.OuterPos - camera.Position;
ms.Radius = placement.OuterRad; ms.Radius = placement.OuterRadius;
Renderer.BoundingSpheres.Add(ms); Renderer.BoundingSpheres.Add(ms);
} }
@ -1605,7 +1605,7 @@ namespace CodeWalker
mode = BoundsShaderMode.Sphere; mode = BoundsShaderMode.Sphere;
MapSphere wsph = new MapSphere(); MapSphere wsph = new MapSphere();
wsph.CamRelPos = au.OuterPos - camera.Position; wsph.CamRelPos = au.OuterPos - camera.Position;
wsph.Radius = au.OuterRad; wsph.Radius = au.OuterRadius;
Renderer.WhiteSpheres.Add(wsph); Renderer.WhiteSpheres.Add(wsph);
} }
else else