Footstep sounds. (#182)

This commit is contained in:
Pieter-Jan Briers
2019-04-05 02:04:34 +02:00
committed by GitHub
parent 85241a7dce
commit f5bb790edb
28 changed files with 171 additions and 2 deletions

View File

@@ -0,0 +1,28 @@
using System.Collections.Generic;
using SS14.Shared.Prototypes;
using SS14.Shared.Utility;
using YamlDotNet.RepresentationModel;
namespace Content.Shared.Audio
{
[Prototype("sound_collection")]
public sealed class SoundCollectionPrototype : IPrototype, IIndexedPrototype
{
public string ID { get; private set; }
public IReadOnlyList<string> PickFiles { get; private set; }
public void LoadFrom(YamlMappingNode mapping)
{
ID = mapping.GetNode("id").AsString();
var pickFiles = new List<string>();
foreach (var file in mapping.GetNode<YamlSequenceNode>("files"))
{
pickFiles.Add(file.AsString());
}
PickFiles = pickFiles;
}
}
}

View File

@@ -62,6 +62,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Audio\SoundCollectionPrototype.cs" />
<Compile Include="EntryPoint.cs" />
<Compile Include="GameObjects\Components\Damage\DamageableComponent.cs" />
<Compile Include="GameObjects\Components\Doors\SharedDoorComponent.cs" />

View File

@@ -18,6 +18,7 @@ namespace Content.Shared.Maps
public string SpriteName { get; private set; }
public bool IsSubFloor { get; private set; }
public bool CanCrowbar { get; private set; }
public string FootstepSounds { get; private set; }
public void AssignTileId(ushort id)
{
@@ -39,6 +40,11 @@ namespace Content.Shared.Maps
{
CanCrowbar = node.AsBool();
}
if (mapping.TryGetNode("footstep_sounds", out node))
{
FootstepSounds = node.AsString();
}
}
}
}