mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2024-11-22 23:12:59 +08:00
Merge pull request #121 from Monkeypolice188/master
Various rel field name changes
This commit is contained in:
commit
73fd159af6
File diff suppressed because it is too large
Load Diff
@ -128,9 +128,9 @@ namespace CodeWalker.World
|
|||||||
placement = new AudioPlacement(relfile, reldata as Dat151AmbientZone);
|
placement = new AudioPlacement(relfile, reldata as Dat151AmbientZone);
|
||||||
if (addtoLists) Zones.Add(placement);
|
if (addtoLists) Zones.Add(placement);
|
||||||
}
|
}
|
||||||
else if (reldata is Dat151AmbientEmitter)
|
else if (reldata is Dat151AmbientRule)
|
||||||
{
|
{
|
||||||
placement = new AudioPlacement(relfile, reldata as Dat151AmbientEmitter);
|
placement = new AudioPlacement(relfile, reldata as Dat151AmbientRule);
|
||||||
if (addtoLists) Emitters.Add(placement);
|
if (addtoLists) Emitters.Add(placement);
|
||||||
}
|
}
|
||||||
if (placement != null)
|
if (placement != null)
|
||||||
@ -173,7 +173,7 @@ namespace CodeWalker.World
|
|||||||
public MetaHash NameHash { get; set; }
|
public MetaHash NameHash { get; set; }
|
||||||
public RelFile RelFile { get; set; }
|
public RelFile RelFile { get; set; }
|
||||||
public Dat151AmbientZone AudioZone { get; set; }
|
public Dat151AmbientZone AudioZone { get; set; }
|
||||||
public Dat151AmbientEmitter AudioEmitter { get; set; }
|
public Dat151AmbientRule AudioEmitter { get; set; }
|
||||||
public Dat151ZoneShape Shape { get; set; }
|
public Dat151ZoneShape Shape { get; set; }
|
||||||
public string ShortTypeName { get; set; }
|
public string ShortTypeName { get; set; }
|
||||||
public string FullTypeName { get; set; }
|
public string FullTypeName { get; set; }
|
||||||
@ -204,7 +204,7 @@ namespace CodeWalker.World
|
|||||||
|
|
||||||
UpdateFromZone();
|
UpdateFromZone();
|
||||||
}
|
}
|
||||||
public AudioPlacement(RelFile rel, Dat151AmbientEmitter emitter)
|
public AudioPlacement(RelFile rel, Dat151AmbientRule emitter)
|
||||||
{
|
{
|
||||||
RelFile = rel;
|
RelFile = rel;
|
||||||
AudioEmitter = emitter;
|
AudioEmitter = emitter;
|
||||||
@ -229,29 +229,29 @@ namespace CodeWalker.World
|
|||||||
switch (zone.Shape)
|
switch (zone.Shape)
|
||||||
{
|
{
|
||||||
case Dat151ZoneShape.Box:
|
case Dat151ZoneShape.Box:
|
||||||
InnerPos = zone.InnerPos;
|
InnerPos = zone.PlaybackZonePosition;
|
||||||
InnerMax = zone.InnerSize * 0.5f;
|
InnerMax = zone.PlaybackZoneSize * 0.5f;
|
||||||
InnerMin = -InnerMax;
|
InnerMin = -InnerMax;
|
||||||
InnerOri = Quaternion.RotationAxis(Vector3.UnitZ, zone.InnerAngle * deg2rad);
|
InnerOri = Quaternion.RotationAxis(Vector3.UnitZ, zone.PlaybackZoneAngle * deg2rad);
|
||||||
break;
|
break;
|
||||||
case Dat151ZoneShape.Sphere:
|
case Dat151ZoneShape.Sphere:
|
||||||
InnerPos = zone.InnerPos;
|
InnerPos = zone.PlaybackZonePosition;
|
||||||
InnerOri = Quaternion.Identity;
|
InnerOri = Quaternion.Identity;
|
||||||
InnerRad = zone.InnerSize.X;
|
InnerRad = zone.PlaybackZoneSize.X;
|
||||||
OuterRad = zone.OuterSize.X;
|
OuterRad = zone.ActivationZoneSize.X;
|
||||||
break;
|
break;
|
||||||
case Dat151ZoneShape.Line:
|
case Dat151ZoneShape.Line:
|
||||||
InnerPos = zone.InnerPos;
|
InnerPos = zone.PlaybackZonePosition;
|
||||||
InnerMin = new Vector3(-1.0f, -1.0f, 0.0f);
|
InnerMin = new Vector3(-1.0f, -1.0f, 0.0f);
|
||||||
InnerMax = new Vector3(1.0f, 1.0f, (zone.InnerSize - zone.InnerPos).Length());
|
InnerMax = new Vector3(1.0f, 1.0f, (zone.PlaybackZoneSize - zone.PlaybackZonePosition).Length());
|
||||||
InnerOri = Quaternion.Invert(Quaternion.LookAtLH(zone.InnerPos, zone.InnerSize, Vector3.UnitZ));
|
InnerOri = Quaternion.Invert(Quaternion.LookAtLH(zone.PlaybackZonePosition, zone.PlaybackZoneSize, Vector3.UnitZ));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
OuterPos = zone.OuterPos;
|
OuterPos = zone.ActivationZonePosition;
|
||||||
OuterMax = zone.OuterSize * 0.5f;
|
OuterMax = zone.ActivationZoneSize * 0.5f;
|
||||||
OuterMin = -OuterMax;
|
OuterMin = -OuterMax;
|
||||||
OuterOri = Quaternion.RotationAxis(Vector3.UnitZ, zone.OuterAngle * deg2rad);
|
OuterOri = Quaternion.RotationAxis(Vector3.UnitZ, zone.ActivationZoneAngle * deg2rad);
|
||||||
|
|
||||||
bool useouter = ((InnerMax.X == 0) || (InnerMax.Y == 0) || (InnerMax.Z == 0));
|
bool useouter = ((InnerMax.X == 0) || (InnerMax.Y == 0) || (InnerMax.Z == 0));
|
||||||
if (useouter && (zone.Shape != Dat151ZoneShape.Sphere))
|
if (useouter && (zone.Shape != Dat151ZoneShape.Sphere))
|
||||||
@ -306,8 +306,8 @@ namespace CodeWalker.World
|
|||||||
|
|
||||||
if (AudioZone != null)
|
if (AudioZone != null)
|
||||||
{
|
{
|
||||||
AudioZone.InnerPos = InnerPos;
|
AudioZone.PlaybackZonePosition = InnerPos;
|
||||||
AudioZone.OuterPos = OuterPos;
|
AudioZone.ActivationZonePosition = OuterPos;
|
||||||
}
|
}
|
||||||
if (AudioEmitter != null)
|
if (AudioEmitter != null)
|
||||||
{
|
{
|
||||||
@ -333,8 +333,8 @@ namespace CodeWalker.World
|
|||||||
OuterOri = Orientation;
|
OuterOri = Orientation;
|
||||||
if (AudioZone != null)
|
if (AudioZone != null)
|
||||||
{
|
{
|
||||||
AudioZone.InnerAngle = uangl;
|
AudioZone.PlaybackZoneAngle = uangl;
|
||||||
AudioZone.OuterAngle = uangl;
|
AudioZone.ActivationZoneAngle = uangl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -347,7 +347,7 @@ namespace CodeWalker.World
|
|||||||
OuterOri = Orientation;
|
OuterOri = Orientation;
|
||||||
if (AudioZone != null)
|
if (AudioZone != null)
|
||||||
{
|
{
|
||||||
AudioZone.OuterAngle = uangl;
|
AudioZone.ActivationZoneAngle = uangl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -355,7 +355,7 @@ namespace CodeWalker.World
|
|||||||
InnerOri = Orientation;
|
InnerOri = Orientation;
|
||||||
if (AudioZone != null)
|
if (AudioZone != null)
|
||||||
{
|
{
|
||||||
AudioZone.InnerAngle = uangl;
|
AudioZone.PlaybackZoneAngle = uangl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ namespace CodeWalker.Project.Panels
|
|||||||
public partial class EditAudioEmitterListPanel : ProjectPanel
|
public partial class EditAudioEmitterListPanel : ProjectPanel
|
||||||
{
|
{
|
||||||
public ProjectForm ProjectForm;
|
public ProjectForm ProjectForm;
|
||||||
public Dat151AmbientEmitterList CurrentEmitterList { get; set; }
|
public Dat151StaticEmitterList CurrentEmitterList { get; set; }
|
||||||
|
|
||||||
private bool populatingui = false;
|
private bool populatingui = false;
|
||||||
|
|
||||||
@ -25,7 +25,7 @@ namespace CodeWalker.Project.Panels
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetEmitterList(Dat151AmbientEmitterList list)
|
public void SetEmitterList(Dat151StaticEmitterList list)
|
||||||
{
|
{
|
||||||
CurrentEmitterList = list;
|
CurrentEmitterList = list;
|
||||||
Tag = list;
|
Tag = list;
|
||||||
|
@ -557,13 +557,13 @@ namespace CodeWalker.Project.Panels
|
|||||||
var paramstrs = ExtParamsTextBox.Text.Split(new[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
|
var paramstrs = ExtParamsTextBox.Text.Split(new[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
|
||||||
if (paramstrs?.Length > 0)
|
if (paramstrs?.Length > 0)
|
||||||
{
|
{
|
||||||
var paramlist = new List<Dat151AmbientEmitter.ExtParam>();
|
var paramlist = new List<Dat151AmbientRule.ExtParam>();
|
||||||
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 Dat151AmbientEmitter.ExtParam();
|
var param = new Dat151AmbientRule.ExtParam();
|
||||||
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();
|
||||||
@ -593,7 +593,7 @@ namespace CodeWalker.Project.Panels
|
|||||||
{
|
{
|
||||||
if (CurrentEmitter == null) return;
|
if (CurrentEmitter == null) return;
|
||||||
if (ProjectForm.WorldForm == null) return;
|
if (ProjectForm.WorldForm == null) return;
|
||||||
ProjectForm.WorldForm.GoToPosition(CurrentEmitter.Position, CurrentEmitter.AudioZone.InnerSize);
|
ProjectForm.WorldForm.GoToPosition(CurrentEmitter.Position, CurrentEmitter.AudioZone.PlaybackZoneSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AddToProjectButton_Click(object sender, EventArgs e)
|
private void AddToProjectButton_Click(object sender, EventArgs e)
|
||||||
|
@ -87,18 +87,18 @@ namespace CodeWalker.Project.Panels
|
|||||||
var z = CurrentZone.AudioZone;
|
var z = CurrentZone.AudioZone;
|
||||||
NameTextBox.Text = z.NameHash.ToString();
|
NameTextBox.Text = z.NameHash.ToString();
|
||||||
ShapeComboBox.Text = z.Shape.ToString();
|
ShapeComboBox.Text = z.Shape.ToString();
|
||||||
InnerPosTextBox.Text = FloatUtil.GetVector3String(z.InnerPos);
|
InnerPosTextBox.Text = FloatUtil.GetVector3String(z.PlaybackZonePosition);
|
||||||
InnerSizeTextBox.Text = FloatUtil.GetVector3String(z.InnerSize);
|
InnerSizeTextBox.Text = FloatUtil.GetVector3String(z.PlaybackZoneSize);
|
||||||
InnerAngleTextBox.Text = z.InnerAngle.ToString();
|
InnerAngleTextBox.Text = z.PlaybackZoneAngle.ToString();
|
||||||
InnerVec1TextBox.Text = FloatUtil.GetVector4String(z.InnerVec1);
|
InnerVec1TextBox.Text = FloatUtil.GetVector4String(z.PlaybackZoneVec1);
|
||||||
InnerVec2TextBox.Text = FloatUtil.GetVector4String(z.InnerVec2);
|
InnerVec2TextBox.Text = FloatUtil.GetVector4String(z.PlaybackZoneVec2);
|
||||||
InnerVec3TextBox.Text = FloatUtil.GetVector3String(z.InnerVec3);
|
InnerVec3TextBox.Text = FloatUtil.GetVector3String(z.PlaybackZoneVec3);
|
||||||
OuterPosTextBox.Text = FloatUtil.GetVector3String(z.OuterPos);
|
OuterPosTextBox.Text = FloatUtil.GetVector3String(z.ActivationZonePosition);
|
||||||
OuterSizeTextBox.Text = FloatUtil.GetVector3String(z.OuterSize);
|
OuterSizeTextBox.Text = FloatUtil.GetVector3String(z.ActivationZoneSize);
|
||||||
OuterAngleTextBox.Text = z.OuterAngle.ToString();
|
OuterAngleTextBox.Text = z.ActivationZoneAngle.ToString();
|
||||||
OuterVec1TextBox.Text = FloatUtil.GetVector4String(z.OuterVec1);
|
OuterVec1TextBox.Text = FloatUtil.GetVector4String(z.ActivationZoneVec1);
|
||||||
OuterVec2TextBox.Text = FloatUtil.GetVector4String(z.OuterVec2);
|
OuterVec2TextBox.Text = FloatUtil.GetVector4String(z.ActivationZoneVec2);
|
||||||
OuterVec3TextBox.Text = FloatUtil.GetVector3String(z.OuterVec3);
|
OuterVec3TextBox.Text = FloatUtil.GetVector3String(z.ActivationZoneVec3);
|
||||||
UnkVec1TextBox.Text = FloatUtil.GetVector4String(z.UnkVec1);
|
UnkVec1TextBox.Text = FloatUtil.GetVector4String(z.UnkVec1);
|
||||||
UnkVec2TextBox.Text = FloatUtil.GetVector4String(z.UnkVec2);
|
UnkVec2TextBox.Text = FloatUtil.GetVector4String(z.UnkVec2);
|
||||||
UnkVec3TextBox.Text = FloatUtil.GetVector2String(z.UnkVec3);
|
UnkVec3TextBox.Text = FloatUtil.GetVector2String(z.UnkVec3);
|
||||||
@ -110,9 +110,9 @@ namespace CodeWalker.Project.Panels
|
|||||||
Hash1TextBox.Text = z.UnkHash1.ToString();
|
Hash1TextBox.Text = z.UnkHash1.ToString();
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
if (z.Hashes != null)
|
if (z.Rules != null)
|
||||||
{
|
{
|
||||||
foreach (var hash in z.Hashes)
|
foreach (var hash in z.Rules)
|
||||||
{
|
{
|
||||||
sb.AppendLine(hash.ToString());
|
sb.AppendLine(hash.ToString());
|
||||||
}
|
}
|
||||||
@ -204,9 +204,9 @@ namespace CodeWalker.Project.Panels
|
|||||||
if (CurrentZone?.AudioZone == null) return;
|
if (CurrentZone?.AudioZone == null) return;
|
||||||
|
|
||||||
var vec = FloatUtil.ParseVector3String(InnerPosTextBox.Text);
|
var vec = FloatUtil.ParseVector3String(InnerPosTextBox.Text);
|
||||||
if (CurrentZone.AudioZone.InnerPos != vec)
|
if (CurrentZone.AudioZone.PlaybackZonePosition != vec)
|
||||||
{
|
{
|
||||||
CurrentZone.AudioZone.InnerPos = vec;
|
CurrentZone.AudioZone.PlaybackZonePosition = vec;
|
||||||
|
|
||||||
ProjectItemChanged();
|
ProjectItemChanged();
|
||||||
|
|
||||||
@ -227,9 +227,9 @@ namespace CodeWalker.Project.Panels
|
|||||||
if (CurrentZone?.AudioZone == null) return;
|
if (CurrentZone?.AudioZone == null) return;
|
||||||
|
|
||||||
var vec = FloatUtil.ParseVector3String(InnerSizeTextBox.Text);
|
var vec = FloatUtil.ParseVector3String(InnerSizeTextBox.Text);
|
||||||
if (CurrentZone.AudioZone.InnerSize != vec)
|
if (CurrentZone.AudioZone.PlaybackZoneSize != vec)
|
||||||
{
|
{
|
||||||
CurrentZone.AudioZone.InnerSize = vec;
|
CurrentZone.AudioZone.PlaybackZoneSize = vec;
|
||||||
|
|
||||||
ProjectItemChanged();
|
ProjectItemChanged();
|
||||||
}
|
}
|
||||||
@ -243,9 +243,9 @@ namespace CodeWalker.Project.Panels
|
|||||||
uint ang = 0;
|
uint ang = 0;
|
||||||
if (uint.TryParse(InnerAngleTextBox.Text, out ang))
|
if (uint.TryParse(InnerAngleTextBox.Text, out ang))
|
||||||
{
|
{
|
||||||
if (CurrentZone.AudioZone.InnerAngle != ang)
|
if (CurrentZone.AudioZone.PlaybackZoneAngle != ang)
|
||||||
{
|
{
|
||||||
CurrentZone.AudioZone.InnerAngle = ang;
|
CurrentZone.AudioZone.PlaybackZoneAngle = ang;
|
||||||
|
|
||||||
ProjectItemChanged();
|
ProjectItemChanged();
|
||||||
}
|
}
|
||||||
@ -258,9 +258,9 @@ namespace CodeWalker.Project.Panels
|
|||||||
if (CurrentZone?.AudioZone == null) return;
|
if (CurrentZone?.AudioZone == null) return;
|
||||||
|
|
||||||
var vec = FloatUtil.ParseVector4String(InnerVec1TextBox.Text);
|
var vec = FloatUtil.ParseVector4String(InnerVec1TextBox.Text);
|
||||||
if (CurrentZone.AudioZone.InnerVec1 != vec)
|
if (CurrentZone.AudioZone.PlaybackZoneVec1 != vec)
|
||||||
{
|
{
|
||||||
CurrentZone.AudioZone.InnerVec1 = vec;
|
CurrentZone.AudioZone.PlaybackZoneVec1 = vec;
|
||||||
|
|
||||||
ProjectItemChanged();
|
ProjectItemChanged();
|
||||||
}
|
}
|
||||||
@ -272,9 +272,9 @@ namespace CodeWalker.Project.Panels
|
|||||||
if (CurrentZone?.AudioZone == null) return;
|
if (CurrentZone?.AudioZone == null) return;
|
||||||
|
|
||||||
var vec = FloatUtil.ParseVector4String(InnerVec2TextBox.Text);
|
var vec = FloatUtil.ParseVector4String(InnerVec2TextBox.Text);
|
||||||
if (CurrentZone.AudioZone.InnerVec2 != vec)
|
if (CurrentZone.AudioZone.PlaybackZoneVec2 != vec)
|
||||||
{
|
{
|
||||||
CurrentZone.AudioZone.InnerVec2 = vec;
|
CurrentZone.AudioZone.PlaybackZoneVec2 = vec;
|
||||||
|
|
||||||
ProjectItemChanged();
|
ProjectItemChanged();
|
||||||
}
|
}
|
||||||
@ -286,9 +286,9 @@ namespace CodeWalker.Project.Panels
|
|||||||
if (CurrentZone?.AudioZone == null) return;
|
if (CurrentZone?.AudioZone == null) return;
|
||||||
|
|
||||||
var vec = FloatUtil.ParseVector3String(InnerVec3TextBox.Text);
|
var vec = FloatUtil.ParseVector3String(InnerVec3TextBox.Text);
|
||||||
if (CurrentZone.AudioZone.InnerVec3 != vec)
|
if (CurrentZone.AudioZone.PlaybackZoneVec3 != vec)
|
||||||
{
|
{
|
||||||
CurrentZone.AudioZone.InnerVec3 = vec;
|
CurrentZone.AudioZone.PlaybackZoneVec3 = vec;
|
||||||
|
|
||||||
ProjectItemChanged();
|
ProjectItemChanged();
|
||||||
}
|
}
|
||||||
@ -300,9 +300,9 @@ namespace CodeWalker.Project.Panels
|
|||||||
if (CurrentZone?.AudioZone == null) return;
|
if (CurrentZone?.AudioZone == null) return;
|
||||||
|
|
||||||
var vec = FloatUtil.ParseVector3String(OuterPosTextBox.Text);
|
var vec = FloatUtil.ParseVector3String(OuterPosTextBox.Text);
|
||||||
if (CurrentZone.AudioZone.OuterPos != vec)
|
if (CurrentZone.AudioZone.ActivationZonePosition != vec)
|
||||||
{
|
{
|
||||||
CurrentZone.AudioZone.OuterPos = vec;
|
CurrentZone.AudioZone.ActivationZonePosition = vec;
|
||||||
|
|
||||||
ProjectItemChanged();
|
ProjectItemChanged();
|
||||||
}
|
}
|
||||||
@ -314,9 +314,9 @@ namespace CodeWalker.Project.Panels
|
|||||||
if (CurrentZone?.AudioZone == null) return;
|
if (CurrentZone?.AudioZone == null) return;
|
||||||
|
|
||||||
var vec = FloatUtil.ParseVector3String(OuterSizeTextBox.Text);
|
var vec = FloatUtil.ParseVector3String(OuterSizeTextBox.Text);
|
||||||
if (CurrentZone.AudioZone.OuterSize != vec)
|
if (CurrentZone.AudioZone.ActivationZoneSize != vec)
|
||||||
{
|
{
|
||||||
CurrentZone.AudioZone.OuterSize = vec;
|
CurrentZone.AudioZone.ActivationZoneSize = vec;
|
||||||
|
|
||||||
ProjectItemChanged();
|
ProjectItemChanged();
|
||||||
}
|
}
|
||||||
@ -330,9 +330,9 @@ namespace CodeWalker.Project.Panels
|
|||||||
uint ang = 0;
|
uint ang = 0;
|
||||||
if (uint.TryParse(OuterAngleTextBox.Text, out ang))
|
if (uint.TryParse(OuterAngleTextBox.Text, out ang))
|
||||||
{
|
{
|
||||||
if (CurrentZone.AudioZone.OuterAngle != ang)
|
if (CurrentZone.AudioZone.ActivationZoneAngle != ang)
|
||||||
{
|
{
|
||||||
CurrentZone.AudioZone.OuterAngle = ang;
|
CurrentZone.AudioZone.ActivationZoneAngle = ang;
|
||||||
|
|
||||||
ProjectItemChanged();
|
ProjectItemChanged();
|
||||||
}
|
}
|
||||||
@ -345,9 +345,9 @@ namespace CodeWalker.Project.Panels
|
|||||||
if (CurrentZone?.AudioZone == null) return;
|
if (CurrentZone?.AudioZone == null) return;
|
||||||
|
|
||||||
var vec = FloatUtil.ParseVector4String(OuterVec1TextBox.Text);
|
var vec = FloatUtil.ParseVector4String(OuterVec1TextBox.Text);
|
||||||
if (CurrentZone.AudioZone.OuterVec1 != vec)
|
if (CurrentZone.AudioZone.ActivationZoneVec1 != vec)
|
||||||
{
|
{
|
||||||
CurrentZone.AudioZone.OuterVec1 = vec;
|
CurrentZone.AudioZone.ActivationZoneVec1 = vec;
|
||||||
|
|
||||||
ProjectItemChanged();
|
ProjectItemChanged();
|
||||||
}
|
}
|
||||||
@ -359,9 +359,9 @@ namespace CodeWalker.Project.Panels
|
|||||||
if (CurrentZone?.AudioZone == null) return;
|
if (CurrentZone?.AudioZone == null) return;
|
||||||
|
|
||||||
var vec = FloatUtil.ParseVector4String(OuterVec2TextBox.Text);
|
var vec = FloatUtil.ParseVector4String(OuterVec2TextBox.Text);
|
||||||
if (CurrentZone.AudioZone.OuterVec2 != vec)
|
if (CurrentZone.AudioZone.ActivationZoneVec2 != vec)
|
||||||
{
|
{
|
||||||
CurrentZone.AudioZone.OuterVec2 = vec;
|
CurrentZone.AudioZone.ActivationZoneVec2 = vec;
|
||||||
|
|
||||||
ProjectItemChanged();
|
ProjectItemChanged();
|
||||||
}
|
}
|
||||||
@ -373,9 +373,9 @@ namespace CodeWalker.Project.Panels
|
|||||||
if (CurrentZone?.AudioZone == null) return;
|
if (CurrentZone?.AudioZone == null) return;
|
||||||
|
|
||||||
var vec = FloatUtil.ParseVector3String(OuterVec3TextBox.Text);
|
var vec = FloatUtil.ParseVector3String(OuterVec3TextBox.Text);
|
||||||
if (CurrentZone.AudioZone.OuterVec3 != vec)
|
if (CurrentZone.AudioZone.ActivationZoneVec3 != vec)
|
||||||
{
|
{
|
||||||
CurrentZone.AudioZone.OuterVec3 = vec;
|
CurrentZone.AudioZone.ActivationZoneVec3 = vec;
|
||||||
|
|
||||||
ProjectItemChanged();
|
ProjectItemChanged();
|
||||||
}
|
}
|
||||||
@ -555,8 +555,8 @@ namespace CodeWalker.Project.Panels
|
|||||||
hashlist.Add(hash);
|
hashlist.Add(hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
CurrentZone.AudioZone.Hashes = hashlist.ToArray();
|
CurrentZone.AudioZone.Rules = hashlist.ToArray();
|
||||||
CurrentZone.AudioZone.HashesCount = (byte)hashlist.Count;
|
CurrentZone.AudioZone.RulesCount = (byte)hashlist.Count;
|
||||||
|
|
||||||
ProjectItemChanged();
|
ProjectItemChanged();
|
||||||
}
|
}
|
||||||
@ -602,7 +602,7 @@ namespace CodeWalker.Project.Panels
|
|||||||
{
|
{
|
||||||
if (CurrentZone == null) return;
|
if (CurrentZone == null) return;
|
||||||
if (ProjectForm.WorldForm == null) return;
|
if (ProjectForm.WorldForm == null) return;
|
||||||
ProjectForm.WorldForm.GoToPosition(CurrentZone.Position, CurrentZone.AudioZone.InnerSize);
|
ProjectForm.WorldForm.GoToPosition(CurrentZone.Position, CurrentZone.AudioZone.PlaybackZoneSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AddToProjectButton_Click(object sender, EventArgs e)
|
private void AddToProjectButton_Click(object sender, EventArgs e)
|
||||||
|
@ -620,9 +620,9 @@ namespace CodeWalker.Project.Panels
|
|||||||
|
|
||||||
|
|
||||||
var zones = new List<Dat151AmbientZone>();
|
var zones = new List<Dat151AmbientZone>();
|
||||||
var emitters = new List<Dat151AmbientEmitter>();
|
var emitters = new List<Dat151AmbientRule>();
|
||||||
var zonelists = new List<Dat151AmbientZoneList>();
|
var zonelists = new List<Dat151AmbientZoneList>();
|
||||||
var emitterlists = new List<Dat151AmbientEmitterList>();
|
var emitterlists = new List<Dat151StaticEmitterList>();
|
||||||
var interiors = new List<Dat151Interior>();
|
var interiors = new List<Dat151Interior>();
|
||||||
var interiorrooms = new List<Dat151InteriorRoom>();
|
var interiorrooms = new List<Dat151InteriorRoom>();
|
||||||
|
|
||||||
@ -632,17 +632,17 @@ namespace CodeWalker.Project.Panels
|
|||||||
{
|
{
|
||||||
zones.Add(reldata as Dat151AmbientZone);
|
zones.Add(reldata as Dat151AmbientZone);
|
||||||
}
|
}
|
||||||
if (reldata is Dat151AmbientEmitter)
|
if (reldata is Dat151AmbientRule)
|
||||||
{
|
{
|
||||||
emitters.Add(reldata as Dat151AmbientEmitter);
|
emitters.Add(reldata as Dat151AmbientRule);
|
||||||
}
|
}
|
||||||
if (reldata is Dat151AmbientZoneList)
|
if (reldata is Dat151AmbientZoneList)
|
||||||
{
|
{
|
||||||
zonelists.Add(reldata as Dat151AmbientZoneList);
|
zonelists.Add(reldata as Dat151AmbientZoneList);
|
||||||
}
|
}
|
||||||
if (reldata is Dat151AmbientEmitterList)
|
if (reldata is Dat151StaticEmitterList)
|
||||||
{
|
{
|
||||||
emitterlists.Add(reldata as Dat151AmbientEmitterList);
|
emitterlists.Add(reldata as Dat151StaticEmitterList);
|
||||||
}
|
}
|
||||||
if (reldata is Dat151Interior)
|
if (reldata is Dat151Interior)
|
||||||
{
|
{
|
||||||
@ -1479,7 +1479,7 @@ namespace CodeWalker.Project.Panels
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
public TreeNode FindAudioEmitterListTreeNode(Dat151AmbientEmitterList list)
|
public TreeNode FindAudioEmitterListTreeNode(Dat151StaticEmitterList list)
|
||||||
{
|
{
|
||||||
if (list == null) return null;
|
if (list == null) return null;
|
||||||
TreeNode relnode = FindAudioRelTreeNode(list.Rel);
|
TreeNode relnode = FindAudioRelTreeNode(list.Rel);
|
||||||
@ -1990,7 +1990,7 @@ namespace CodeWalker.Project.Panels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void TrySelectAudioEmitterListTreeNode(Dat151AmbientEmitterList list)
|
public void TrySelectAudioEmitterListTreeNode(Dat151StaticEmitterList list)
|
||||||
{
|
{
|
||||||
TreeNode tnode = FindAudioEmitterListTreeNode(list);
|
TreeNode tnode = FindAudioEmitterListTreeNode(list);
|
||||||
if (tnode == null)
|
if (tnode == null)
|
||||||
@ -2210,7 +2210,7 @@ namespace CodeWalker.Project.Panels
|
|||||||
tn.Text = list.NameHash.ToString();
|
tn.Text = list.NameHash.ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void UpdateAudioEmitterListTreeNode(Dat151AmbientEmitterList list)
|
public void UpdateAudioEmitterListTreeNode(Dat151StaticEmitterList list)
|
||||||
{
|
{
|
||||||
var tn = FindAudioEmitterListTreeNode(list);
|
var tn = FindAudioEmitterListTreeNode(list);
|
||||||
if (tn != null)
|
if (tn != null)
|
||||||
@ -2429,12 +2429,12 @@ namespace CodeWalker.Project.Panels
|
|||||||
var tn = FindAudioEmitterTreeNode(emitter);
|
var tn = FindAudioEmitterTreeNode(emitter);
|
||||||
if ((tn != null) && (tn.Parent != null))
|
if ((tn != null) && (tn.Parent != null))
|
||||||
{
|
{
|
||||||
var emitters = new List<Dat151AmbientEmitter>();
|
var emitters = new List<Dat151AmbientRule>();
|
||||||
foreach (var reldata in emitter.RelFile.RelDatas)
|
foreach (var reldata in emitter.RelFile.RelDatas)
|
||||||
{
|
{
|
||||||
if (reldata is Dat151AmbientEmitter)
|
if (reldata is Dat151AmbientRule)
|
||||||
{
|
{
|
||||||
emitters.Add(reldata as Dat151AmbientEmitter);
|
emitters.Add(reldata as Dat151AmbientRule);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2460,17 +2460,17 @@ namespace CodeWalker.Project.Panels
|
|||||||
tn.Parent.Nodes.Remove(tn);
|
tn.Parent.Nodes.Remove(tn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void RemoveAudioEmitterListTreeNode(Dat151AmbientEmitterList list)
|
public void RemoveAudioEmitterListTreeNode(Dat151StaticEmitterList list)
|
||||||
{
|
{
|
||||||
var tn = FindAudioEmitterListTreeNode(list);
|
var tn = FindAudioEmitterListTreeNode(list);
|
||||||
if ((tn != null) && (tn.Parent != null))
|
if ((tn != null) && (tn.Parent != null))
|
||||||
{
|
{
|
||||||
var emitterlists = new List<Dat151AmbientEmitterList>();
|
var emitterlists = new List<Dat151StaticEmitterList>();
|
||||||
foreach (var reldata in list.Rel.RelDatas)
|
foreach (var reldata in list.Rel.RelDatas)
|
||||||
{
|
{
|
||||||
if (reldata is Dat151AmbientEmitterList)
|
if (reldata is Dat151StaticEmitterList)
|
||||||
{
|
{
|
||||||
emitterlists.Add(reldata as Dat151AmbientEmitterList);
|
emitterlists.Add(reldata as Dat151StaticEmitterList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ namespace CodeWalker.Project
|
|||||||
private AudioPlacement CurrentAudioZone;
|
private AudioPlacement CurrentAudioZone;
|
||||||
private AudioPlacement CurrentAudioEmitter;
|
private AudioPlacement CurrentAudioEmitter;
|
||||||
private Dat151AmbientZoneList CurrentAudioZoneList;
|
private Dat151AmbientZoneList CurrentAudioZoneList;
|
||||||
private Dat151AmbientEmitterList CurrentAudioEmitterList;
|
private Dat151StaticEmitterList CurrentAudioEmitterList;
|
||||||
private Dat151Interior CurrentAudioInterior;
|
private Dat151Interior CurrentAudioInterior;
|
||||||
private Dat151InteriorRoom CurrentAudioInteriorRoom;
|
private Dat151InteriorRoom CurrentAudioInteriorRoom;
|
||||||
|
|
||||||
@ -830,7 +830,7 @@ namespace CodeWalker.Project
|
|||||||
CurrentAudioZone = item as AudioPlacement;
|
CurrentAudioZone = item as AudioPlacement;
|
||||||
CurrentAudioEmitter = item as AudioPlacement;
|
CurrentAudioEmitter = item as AudioPlacement;
|
||||||
CurrentAudioZoneList = item as Dat151AmbientZoneList;
|
CurrentAudioZoneList = item as Dat151AmbientZoneList;
|
||||||
CurrentAudioEmitterList = item as Dat151AmbientEmitterList;
|
CurrentAudioEmitterList = item as Dat151StaticEmitterList;
|
||||||
CurrentAudioInterior = item as Dat151Interior;
|
CurrentAudioInterior = item as Dat151Interior;
|
||||||
CurrentAudioInteriorRoom = item as Dat151InteriorRoom;
|
CurrentAudioInteriorRoom = item as Dat151InteriorRoom;
|
||||||
CurrentMloRoom = item as MCMloRoomDef;
|
CurrentMloRoom = item as MCMloRoomDef;
|
||||||
@ -842,7 +842,7 @@ namespace CodeWalker.Project
|
|||||||
|
|
||||||
//need to create a temporary AudioPlacement wrapper for these, since AudioPlacements usually come from WorldForm
|
//need to create a temporary AudioPlacement wrapper for these, since AudioPlacements usually come from WorldForm
|
||||||
var daz = item as Dat151AmbientZone;
|
var daz = item as Dat151AmbientZone;
|
||||||
var dae = item as Dat151AmbientEmitter;
|
var dae = item as Dat151AmbientRule;
|
||||||
if (daz != null) CurrentAudioZone = new AudioPlacement(daz.Rel, daz);
|
if (daz != null) CurrentAudioZone = new AudioPlacement(daz.Rel, daz);
|
||||||
if (dae != null) CurrentAudioEmitter = new AudioPlacement(dae.Rel, dae);
|
if (dae != null) CurrentAudioEmitter = new AudioPlacement(dae.Rel, dae);
|
||||||
|
|
||||||
@ -6509,16 +6509,16 @@ namespace CodeWalker.Project
|
|||||||
zone.Flags1 = cp ? copy.AudioZone.Flags1 : 0;
|
zone.Flags1 = cp ? copy.AudioZone.Flags1 : 0;
|
||||||
zone.Flags2 = cp ? copy.AudioZone.Flags2 : 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.InnerSize = cp ? copy.AudioZone.InnerSize : Vector3.One * 10.0f;
|
zone.PlaybackZoneSize = cp ? copy.AudioZone.PlaybackZoneSize : Vector3.One * 10.0f;
|
||||||
zone.InnerAngle = cp ? copy.AudioZone.InnerAngle : 0;
|
zone.PlaybackZoneAngle = cp ? copy.AudioZone.PlaybackZoneAngle : 0;
|
||||||
zone.InnerVec1 = cp ? copy.AudioZone.InnerVec1 : Vector4.Zero;
|
zone.PlaybackZoneVec1 = cp ? copy.AudioZone.PlaybackZoneVec1 : Vector4.Zero;
|
||||||
zone.InnerVec2 = cp ? copy.AudioZone.InnerVec2 : new Vector4(1, 1, 1, 0);
|
zone.PlaybackZoneVec2 = cp ? copy.AudioZone.PlaybackZoneVec2 : new Vector4(1, 1, 1, 0);
|
||||||
zone.InnerVec3 = cp ? copy.AudioZone.InnerVec3 : Vector3.Zero;
|
zone.PlaybackZoneVec3 = cp ? copy.AudioZone.PlaybackZoneVec3 : Vector3.Zero;
|
||||||
zone.OuterSize = cp ? copy.AudioZone.OuterSize : Vector3.One * 15.0f;
|
zone.ActivationZoneSize = cp ? copy.AudioZone.ActivationZoneSize : Vector3.One * 15.0f;
|
||||||
zone.OuterAngle = cp ? copy.AudioZone.OuterAngle : 0;
|
zone.ActivationZoneAngle = cp ? copy.AudioZone.ActivationZoneAngle : 0;
|
||||||
zone.OuterVec1 = cp ? copy.AudioZone.OuterVec1 : Vector4.Zero;
|
zone.ActivationZoneVec1 = cp ? copy.AudioZone.ActivationZoneVec1 : Vector4.Zero;
|
||||||
zone.OuterVec2 = cp ? copy.AudioZone.OuterVec2 : new Vector4(1, 1, 1, 0);
|
zone.ActivationZoneVec2 = cp ? copy.AudioZone.ActivationZoneVec2 : new Vector4(1, 1, 1, 0);
|
||||||
zone.OuterVec3 = cp ? copy.AudioZone.OuterVec3 : Vector3.Zero;
|
zone.ActivationZoneVec3 = cp ? copy.AudioZone.ActivationZoneVec3 : Vector3.Zero;
|
||||||
zone.UnkVec1 = cp ? copy.AudioZone.UnkVec1 : new Vector4(0, 0, 1, 0);
|
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.UnkVec2 = cp ? copy.AudioZone.UnkVec2 : new Vector4(1, -1, -1, 0);
|
||||||
zone.UnkHash0 = cp ? copy.AudioZone.UnkHash0 : 0;
|
zone.UnkHash0 = cp ? copy.AudioZone.UnkHash0 : 0;
|
||||||
@ -6527,8 +6527,8 @@ namespace CodeWalker.Project
|
|||||||
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.HashesCount = cp ? copy.AudioZone.HashesCount: (byte)0;
|
zone.RulesCount = cp ? copy.AudioZone.RulesCount: (byte)0;
|
||||||
zone.Hashes = cp ? copy.AudioZone.Hashes : null;
|
zone.Rules = cp ? copy.AudioZone.Rules : null;
|
||||||
zone.ExtParamsCount = cp ? copy.AudioZone.ExtParamsCount : 0;
|
zone.ExtParamsCount = cp ? copy.AudioZone.ExtParamsCount : 0;
|
||||||
zone.ExtParams = cp ? copy.AudioZone.ExtParams : null;
|
zone.ExtParams = cp ? copy.AudioZone.ExtParams : null;
|
||||||
zone.Name = "zone1";
|
zone.Name = "zone1";
|
||||||
@ -6628,7 +6628,7 @@ namespace CodeWalker.Project
|
|||||||
|
|
||||||
bool cp = copyPosition && (copy != null);
|
bool cp = copyPosition && (copy != null);
|
||||||
|
|
||||||
var emitter = new Dat151AmbientEmitter(CurrentAudioFile);
|
var emitter = new Dat151AmbientRule(CurrentAudioFile);
|
||||||
|
|
||||||
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;
|
||||||
@ -6807,7 +6807,7 @@ namespace CodeWalker.Project
|
|||||||
if (CurrentAudioFile == null) return;
|
if (CurrentAudioFile == null) return;
|
||||||
|
|
||||||
|
|
||||||
var emlist = new Dat151AmbientEmitterList(CurrentAudioFile);
|
var emlist = new Dat151StaticEmitterList(CurrentAudioFile);
|
||||||
|
|
||||||
emlist.Name = "emitterlist1";
|
emlist.Name = "emitterlist1";
|
||||||
emlist.NameHash = JenkHash.GenHash(emlist.Name);
|
emlist.NameHash = JenkHash.GenHash(emlist.Name);
|
||||||
@ -6864,7 +6864,7 @@ namespace CodeWalker.Project
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
public bool IsCurrentAudioEmitterList(Dat151AmbientEmitterList list)
|
public bool IsCurrentAudioEmitterList(Dat151StaticEmitterList list)
|
||||||
{
|
{
|
||||||
return list == CurrentAudioEmitterList;
|
return list == CurrentAudioEmitterList;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user