Renamed the "file" attribute of hit sounds to "tag", replaced footstep sound paths in creature configs with tags.

This commit is contained in:
Joonas Rikkonen
2018-02-24 21:13:21 +02:00
parent eaafc022f2
commit 48757618f6
7 changed files with 24 additions and 19 deletions
@@ -21,9 +21,9 @@ namespace Barotrauma
if (impact > 3.0f && limb.SoundTimer <= 0.0f)
{
limb.SoundTimer = Limb.SoundInterval;
if (!string.IsNullOrWhiteSpace(limb.HitSound))
if (!string.IsNullOrWhiteSpace(limb.HitSoundTag))
{
SoundPlayer.PlaySound(limb.HitSound, volume, impact * 100.0f, limb.WorldPosition);
SoundPlayer.PlaySound(limb.HitSoundTag, volume, impact * 100.0f, limb.WorldPosition);
}
foreach (WearableSprite wearable in limb.WearingItems)
{
@@ -17,11 +17,11 @@ namespace Barotrauma
private set;
}
private string hitSound;
private string hitSoundTag;
public string HitSound
public string HitSoundTag
{
get { return hitSound; }
get { return hitSoundTag; }
}
partial void InitProjSpecific(XElement element)
@@ -34,7 +34,12 @@ namespace Barotrauma
LightSource = new LightSource(subElement);
break;
case "sound":
hitSound = subElement.GetAttributeString("file", "");
hitSoundTag = subElement.GetAttributeString("tag", "");
if (string.IsNullOrWhiteSpace(hitSoundTag))
{
//legacy support
hitSoundTag = subElement.GetAttributeString("file", "");
}
break;
}
}