Add Eris' keyboard sounds to R&D Console. (#427)
* Add Eris' keyboard sounds to R&D Console. * woah buddy thats not c# standard * fix weirdly capitalized keyboard method * thats silly
This commit is contained in:
committed by
Pieter-Jan Briers
parent
e5150d3714
commit
0d30bc2676
@@ -1,14 +1,19 @@
|
||||
using Content.Server.GameObjects.EntitySystems;
|
||||
using Content.Server.GameObjects.EntitySystems;
|
||||
using Content.Shared.Audio;
|
||||
using Content.Shared.GameObjects.Components.Research;
|
||||
using Content.Shared.Research;
|
||||
using Robust.Server.GameObjects.Components.UserInterface;
|
||||
using Robust.Server.GameObjects.EntitySystems;
|
||||
using Robust.Server.Interfaces.GameObjects;
|
||||
using Robust.Server.Interfaces.Player;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.GameObjects.Components.UserInterface;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.Interfaces.Random;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Log;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Random;
|
||||
|
||||
namespace Content.Server.GameObjects.Components.Research
|
||||
{
|
||||
@@ -16,8 +21,16 @@ namespace Content.Server.GameObjects.Components.Research
|
||||
[ComponentReference(typeof(IActivate))]
|
||||
public class ResearchConsoleComponent : SharedResearchConsoleComponent, IActivate
|
||||
{
|
||||
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IEntitySystemManager _entitySystemManager;
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager;
|
||||
[Dependency] private readonly IRobustRandom _random;
|
||||
#pragma warning restore 649
|
||||
|
||||
private BoundUserInterface _userInterface;
|
||||
private ResearchClientComponent _client;
|
||||
private const string _soundCollectionName = "keyboard";
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
@@ -88,7 +101,16 @@ namespace Content.Server.GameObjects.Components.Research
|
||||
return;
|
||||
|
||||
OpenUserInterface(actor.playerSession);
|
||||
PlayKeyboardSound();
|
||||
return;
|
||||
}
|
||||
|
||||
private void PlayKeyboardSound()
|
||||
{
|
||||
var soundCollection = _prototypeManager.Index<SoundCollectionPrototype>(_soundCollectionName);
|
||||
var file = _random.Pick(soundCollection.PickFiles);
|
||||
var audioSystem = _entitySystemManager.GetEntitySystem<AudioSystem>();
|
||||
audioSystem.Play(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BIN
Resources/Audio/machines/keyboard/keyboard1.ogg
Normal file
BIN
Resources/Audio/machines/keyboard/keyboard1.ogg
Normal file
Binary file not shown.
BIN
Resources/Audio/machines/keyboard/keyboard2.ogg
Normal file
BIN
Resources/Audio/machines/keyboard/keyboard2.ogg
Normal file
Binary file not shown.
BIN
Resources/Audio/machines/keyboard/keyboard3.ogg
Normal file
BIN
Resources/Audio/machines/keyboard/keyboard3.ogg
Normal file
Binary file not shown.
BIN
Resources/Audio/machines/keyboard/keyboard4.ogg
Normal file
BIN
Resources/Audio/machines/keyboard/keyboard4.ogg
Normal file
Binary file not shown.
8
Resources/Prototypes/SoundCollections/keyboard.yml
Normal file
8
Resources/Prototypes/SoundCollections/keyboard.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
- type: sound_collection
|
||||
id: keyboard
|
||||
files:
|
||||
- /Audio/machines/keyboard/keyboard1.ogg
|
||||
- /Audio/machines/keyboard/keyboard2.ogg
|
||||
- /Audio/machines/keyboard/keyboard3.ogg
|
||||
- /Audio/machines/keyboard/keyboard4.ogg
|
||||
|
||||
Reference in New Issue
Block a user