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:
@@ -3,11 +3,10 @@ using System;
|
||||
using System.Linq;
|
||||
using Content.Server.GameObjects.Components.Mobs;
|
||||
using Content.Server.GameObjects.EntitySystems;
|
||||
using Content.Server.Interfaces;
|
||||
using Content.Server.Mobs;
|
||||
using Content.Server.Utility;
|
||||
using Content.Shared.GameObjects.Components.Instruments;
|
||||
using Content.Shared.GameObjects.EntitySystems;
|
||||
using Content.Shared.Interfaces;
|
||||
using Content.Shared.Interfaces.GameObjects.Components;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Server.GameObjects.Components.UserInterface;
|
||||
@@ -38,7 +37,6 @@ namespace Content.Server.GameObjects.Components.Instruments
|
||||
IUse,
|
||||
IThrown
|
||||
{
|
||||
[Dependency] private readonly IServerNotifyManager _notifyManager = default!;
|
||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||
|
||||
private static readonly TimeSpan OneSecAgo = TimeSpan.FromSeconds(-1);
|
||||
@@ -166,11 +164,11 @@ namespace Content.Server.GameObjects.Components.Instruments
|
||||
switch (_laggedBatches)
|
||||
{
|
||||
case (int) (MaxMidiLaggedBatches * (1 / 3d)) + 1:
|
||||
_notifyManager.PopupMessage(Owner, InstrumentPlayer.AttachedEntity,
|
||||
Owner.PopupMessage(InstrumentPlayer.AttachedEntity,
|
||||
"Your fingers are beginning to a cramp a little!");
|
||||
break;
|
||||
case (int) (MaxMidiLaggedBatches * (2 / 3d)) + 1:
|
||||
_notifyManager.PopupMessage(Owner, InstrumentPlayer.AttachedEntity,
|
||||
Owner.PopupMessage(InstrumentPlayer.AttachedEntity,
|
||||
"Your fingers are seriously cramping up!");
|
||||
break;
|
||||
}
|
||||
@@ -333,7 +331,7 @@ namespace Content.Server.GameObjects.Components.Instruments
|
||||
|
||||
InstrumentPlayer = null;
|
||||
|
||||
_notifyManager.PopupMessage(Owner, mob, "Your fingers cramp up from playing!");
|
||||
Owner.PopupMessage(mob, "Your fingers cramp up from playing!");
|
||||
}
|
||||
|
||||
_timer += delta;
|
||||
|
||||
Reference in New Issue
Block a user