Footstep sounds. (#182)
This commit is contained in:
committed by
GitHub
parent
85241a7dce
commit
f5bb790edb
28
Content.Shared/Audio/SoundCollectionPrototype.cs
Normal file
28
Content.Shared/Audio/SoundCollectionPrototype.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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" />
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user