Remove localization manager dependencies from components (#1864)

Co-authored-by: Víctor Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
This commit is contained in:
DrSmugleaf
2020-08-23 12:53:09 +02:00
committed by GitHub
parent 0b4ca168d4
commit a4a25a9975
22 changed files with 73 additions and 117 deletions

View File

@@ -33,7 +33,6 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
#pragma warning disable 649
[Dependency] private IRobustRandom _robustRandom;
[Dependency] private readonly ISharedNotifyManager _notifyManager;
[Dependency] private readonly ILocalizationManager _localizationManager;
#pragma warning restore 649
public override string Name => "Stunbaton";
@@ -168,14 +167,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, _localizationManager.GetString("Cell missing..."));
_notifyManager.PopupMessage(Owner, 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, _localizationManager.GetString("Dead cell..."));
_notifyManager.PopupMessage(Owner, user, Loc.GetString("Dead cell..."));
return;
}
@@ -242,11 +241,9 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
public void Examine(FormattedMessage message, bool inDetailsRange)
{
var loc = IoCManager.Resolve<ILocalizationManager>();
if (Activated)
{
message.AddMarkup(loc.GetString("The light is currently [color=darkgreen]on[/color]."));
message.AddMarkup(Loc.GetString("The light is currently [color=darkgreen]on[/color]."));
}
}