Rename SoundComponent and refactor its wrong usages. (#1036)

* Rename `SoundComponent` and refactor its wrong usages.

* Replace verbose IoC grabs with EntitySysetm.Get

* unused depend

Co-authored-by: FL-OZ <anotherscuffed@gmail.com>
Co-authored-by: Víctor Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
This commit is contained in:
FL-OZ
2020-05-31 12:40:36 -05:00
committed by GitHub
parent 8db5adb387
commit 53900b79e9
30 changed files with 137 additions and 97 deletions

View File

@@ -17,6 +17,7 @@ using Robust.Server.GameObjects;
using Robust.Server.GameObjects.EntitySystems;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Systems;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.Map;
using Robust.Shared.Interfaces.Random;
@@ -89,7 +90,7 @@ namespace Content.Server.GameObjects.Components.Interactable
{
base.Initialize();
_audioSystem = _entitySystemManager.GetEntitySystem<AudioSystem>();
_audioSystem = EntitySystem.Get<AudioSystem>();
_interactionSystem = _entitySystemManager.GetEntitySystem<InteractionSystem>();
Owner.TryGetComponent(out _spriteComponent);
}
@@ -125,7 +126,7 @@ namespace Content.Server.GameObjects.Components.Interactable
{
var soundCollection = _prototypeManager.Index<SoundCollectionPrototype>(name);
var file = _robustRandom.Pick(soundCollection.PickFiles);
_entitySystemManager.GetEntitySystem<AudioSystem>()
EntitySystem.Get<AudioSystem>()
.Play(file, Owner, AudioHelpers.WithVariation(0.15f).WithVolume(volume));
}