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:
@@ -1,12 +1,14 @@
|
||||
using Content.Server.GameObjects.Components.Sound;
|
||||
using Content.Server.GameObjects.EntitySystems;
|
||||
using Content.Server.Utility;
|
||||
using Content.Server.GameObjects.EntitySystems;
|
||||
using Content.Shared.GameObjects.Components.Power;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Server.GameObjects.Components.UserInterface;
|
||||
using Robust.Server.GameObjects.EntitySystems;
|
||||
using Robust.Server.Interfaces.GameObjects;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.GameObjects.Systems;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
|
||||
namespace Content.Server.GameObjects.Components.Power
|
||||
{
|
||||
@@ -14,6 +16,9 @@ namespace Content.Server.GameObjects.Components.Power
|
||||
[ComponentReference(typeof(IActivate))]
|
||||
public sealed class ApcComponent : SharedApcComponent, IActivate
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IEntitySystemManager _entitySystemManager;
|
||||
#pragma warning restore 649
|
||||
PowerStorageComponent Storage;
|
||||
AppearanceComponent Appearance;
|
||||
private PowerProviderComponent _provider;
|
||||
@@ -119,7 +124,7 @@ namespace Content.Server.GameObjects.Components.Power
|
||||
|
||||
private void _clickSound()
|
||||
{
|
||||
Owner.GetComponent<SoundComponent>().Play("/Audio/machines/machine_switch.ogg", AudioParams.Default.WithVolume(-2f));
|
||||
EntitySystem.Get<AudioSystem>().Play("/Audio/machines/machine_switch.ogg", AudioParams.Default.WithVolume(-2f));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user