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

@@ -20,8 +20,6 @@ namespace Content.Server.GameObjects.Components.Fluids
[RegisterComponent]
public class BucketComponent : Component, IInteractUsing
{
[Dependency] private readonly ILocalizationManager _localizationManager = default!;
public override string Name => "Bucket";
public ReagentUnit MaxVolume
@@ -101,7 +99,7 @@ namespace Content.Server.GameObjects.Components.Fluids
return false;
}
Owner.PopupMessage(eventArgs.User, _localizationManager.GetString("Splish"));
Owner.PopupMessage(eventArgs.User, Loc.GetString("Splish"));
return true;
}
@@ -119,7 +117,7 @@ namespace Content.Server.GameObjects.Components.Fluids
}
// Give some visual feedback shit's happening (for anyone who can't hear sound)
Owner.PopupMessage(eventArgs.User, _localizationManager.GetString("Sploosh"));
Owner.PopupMessage(eventArgs.User, Loc.GetString("Sploosh"));
if (_sound == null)
{

View File

@@ -6,7 +6,6 @@ using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Server.GameObjects.EntitySystems;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Systems;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Serialization;
@@ -18,10 +17,6 @@ namespace Content.Server.GameObjects.Components.Fluids
[RegisterComponent]
public class MopComponent : Component, IAfterInteract
{
#pragma warning disable 649
[Dependency] private readonly ILocalizationManager _localizationManager;
#pragma warning restore 649
public override string Name => "Mop";
internal SolutionComponent Contents => _contents;
private SolutionComponent _contents;
@@ -115,7 +110,7 @@ namespace Content.Server.GameObjects.Components.Fluids
}
// Give some visual feedback shit's happening (for anyone who can't hear sound)
Owner.PopupMessage(eventArgs.User, _localizationManager.GetString("Swish"));
Owner.PopupMessage(eventArgs.User, Loc.GetString("Swish"));
if (_pickupSound == null)
{

View File

@@ -48,7 +48,6 @@ namespace Content.Server.GameObjects.Components.Fluids
#pragma warning disable 649
[Dependency] private readonly IMapManager _mapManager;
[Dependency] private readonly ILocalizationManager _loc;
#pragma warning restore 649
public override string Name => "Puddle";
@@ -160,7 +159,7 @@ namespace Content.Server.GameObjects.Components.Fluids
{
if(_slippery)
{
message.AddText(_loc.GetString("It looks slippery."));
message.AddText(Loc.GetString("It looks slippery."));
}
}