Removed LocalizationManager dependencies (#2059)

* Removed LocalizationManager dependencies

* Fixed error

Co-authored-by: David Tan <>
This commit is contained in:
DTanxxx
2020-09-17 09:55:50 +12:00
committed by GitHub
parent 6b4fbc211f
commit 27a5a7a09c
19 changed files with 99 additions and 130 deletions

View File

@@ -32,8 +32,6 @@ namespace Content.Client.Research
private ItemList _unlockableTechnologies;
private ItemList _futureTechnologies;
[Dependency] private readonly ILocalizationManager _localizationManager = default!;
public Button UnlockButton { get; private set; }
public Button ServerSelectionButton { get; private set; }
public Button ServerSyncButton { get; private set; }
@@ -44,7 +42,7 @@ namespace Content.Client.Research
{
IoCManager.InjectDependencies(this);
Title = _localizationManager.GetString("R&D Console");
Title = Loc.GetString("R&D Console");
Owner = owner;
@@ -110,8 +108,8 @@ namespace Content.Client.Research
SizeFlagsStretchRatio = 3,
};
_pointLabel = new Label() { Text = _localizationManager.GetString("Research Points") + ": 0" };
_pointsPerSecondLabel = new Label() { Text = _localizationManager.GetString("Points per Second") + ": 0" };
_pointLabel = new Label() { Text = Loc.GetString("Research Points") + ": 0" };
_pointsPerSecondLabel = new Label() { Text = Loc.GetString("Points per Second") + ": 0" };
var vboxPointsButtons = new VBoxContainer()
{
@@ -120,9 +118,9 @@ namespace Content.Client.Research
SizeFlagsVertical = SizeFlags.FillExpand,
};
ServerSelectionButton = new Button() { Text = _localizationManager.GetString("Server list") };
ServerSyncButton = new Button() { Text = _localizationManager.GetString("Sync")};
UnlockButton = new Button() { Text = _localizationManager.GetString("Unlock"), Disabled = true };
ServerSelectionButton = new Button() { Text = Loc.GetString("Server list") };
ServerSyncButton = new Button() { Text = Loc.GetString("Sync")};
UnlockButton = new Button() { Text = Loc.GetString("Unlock"), Disabled = true };
vboxPointsButtons.AddChild(ServerSelectionButton);
@@ -268,8 +266,8 @@ namespace Content.Client.Research
_technologyIcon.Texture = TechnologySelected.Icon.Frame0();
_technologyName.Text = TechnologySelected.Name;
_technologyDescription.Text = TechnologySelected.Description+$"\n{TechnologySelected.RequiredPoints} " + _localizationManager.GetString("research points");
_technologyRequirements.Text = _localizationManager.GetString("No technology requirements.");
_technologyDescription.Text = TechnologySelected.Description+$"\n{TechnologySelected.RequiredPoints} " + Loc.GetString("research points");
_technologyRequirements.Text = Loc.GetString("No technology requirements.");
var prototypeMan = IoCManager.Resolve<IPrototypeManager>();
@@ -278,7 +276,7 @@ namespace Content.Client.Research
var requiredId = TechnologySelected.RequiredTechnologies[i];
if (!prototypeMan.TryIndex(requiredId, out TechnologyPrototype prototype)) continue;
if (i == 0)
_technologyRequirements.Text = _localizationManager.GetString("Requires") + $": {prototype.Name}";
_technologyRequirements.Text = Loc.GetString("Requires") + $": {prototype.Name}";
else
_technologyRequirements.Text += $", {prototype.Name}";
}
@@ -289,8 +287,8 @@ namespace Content.Client.Research
/// </summary>
public void PopulatePoints()
{
_pointLabel.Text = _localizationManager.GetString("Research Points") + $": {Owner.Points}";
_pointsPerSecondLabel.Text = _localizationManager.GetString("Points per second") + $": {Owner.PointsPerSecond}";
_pointLabel.Text = Loc.GetString("Research Points") + $": {Owner.Points}";
_pointsPerSecondLabel.Text = Loc.GetString("Points per second") + $": {Owner.PointsPerSecond}";
}
/// <summary>