Replace usages of ISharedNotifyManager and IServerNotifyManager with extension methods (#1965)

* Replace usages of ISharedNotifyManager and IServerNotifyManager with extension methods

* Remove redundant code
This commit is contained in:
DrSmugleaf
2020-09-01 12:34:53 +02:00
committed by GitHub
parent 14259ed920
commit 8f9ed2f562
53 changed files with 247 additions and 375 deletions

View File

@@ -31,7 +31,6 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
public class StunbatonComponent : MeleeWeaponComponent, IUse, IExamine, IMapInit, IInteractUsing
{
[Dependency] private readonly IRobustRandom _robustRandom = default!;
[Dependency] private readonly ISharedNotifyManager _notifyManager = default!;
public override string Name => "Stunbaton";
@@ -165,14 +164,14 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
{
EntitySystem.Get<AudioSystem>().PlayAtCoords("/Audio/Machines/button.ogg", Owner.Transform.GridPosition, AudioHelpers.WithVariation(0.25f));
_notifyManager.PopupMessage(Owner, user, Loc.GetString("Cell missing..."));
Owner.PopupMessage(user, Loc.GetString("Cell missing..."));
return;
}
if (cell.CurrentCharge < EnergyPerUse)
{
EntitySystem.Get<AudioSystem>().PlayAtCoords("/Audio/Machines/button.ogg", Owner.Transform.GridPosition, AudioHelpers.WithVariation(0.25f));
_notifyManager.PopupMessage(Owner, user, Loc.GetString("Dead cell..."));
Owner.PopupMessage(user, Loc.GetString("Dead cell..."));
return;
}