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

@@ -5,7 +5,6 @@ using Content.Server.Atmos;
using Content.Server.GameObjects.Components.Chemistry;
using Content.Server.GameObjects.Components.Items.Storage;
using Content.Server.GameObjects.EntitySystems;
using Content.Server.Interfaces;
using Content.Server.Interfaces.Chat;
using Content.Server.Interfaces.GameObjects;
using Content.Server.Utility;
@@ -15,7 +14,6 @@ using Content.Shared.GameObjects.Components.Interactable;
using Content.Shared.Interfaces.GameObjects.Components;
using Content.Shared.Interfaces;
using Robust.Server.GameObjects;
using Robust.Server.Interfaces.Player;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.IoC;
@@ -33,8 +31,6 @@ namespace Content.Server.GameObjects.Components.Interactable
public class WelderComponent : ToolComponent, IExamine, IUse, ISuicideAct, ISolutionChange
{
[Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
[Dependency] private readonly IServerNotifyManager _notifyManager = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;
public override string Name => "Welder";
public override uint? NetID => ContentNetIDs.WELDER;
@@ -108,7 +104,7 @@ namespace Content.Server.GameObjects.Components.Interactable
if (!CanWeld(DefaultFuelCost))
{
_notifyManager.PopupMessage(target, user, "Can't weld!");
target.PopupMessage(user, "Can't weld!");
return false;
}
@@ -137,13 +133,13 @@ namespace Content.Server.GameObjects.Components.Interactable
{
if (!WelderLit)
{
if(!silent) _notifyManager.PopupMessage(Owner, user, Loc.GetString("The welder is turned off!"));
if(!silent) Owner.PopupMessage(user, Loc.GetString("The welder is turned off!"));
return false;
}
if (!CanWeld(value))
{
if(!silent) _notifyManager.PopupMessage(Owner, user, Loc.GetString("The welder does not have enough fuel for that!"));
if(!silent) Owner.PopupMessage(user, Loc.GetString("The welder does not have enough fuel for that!"));
return false;
}
@@ -192,7 +188,7 @@ namespace Content.Server.GameObjects.Components.Interactable
if (!CanLitWelder())
{
_notifyManager.PopupMessage(Owner, user, Loc.GetString("The welder has no fuel left!"));
Owner.PopupMessage(user, Loc.GetString("The welder has no fuel left!"));
return false;
}