Removed old Loc.GetString() use instances (#4155)
Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>
This commit is contained in:
@@ -60,8 +60,9 @@ namespace Content.Client.Chemistry.Components
|
||||
_parent._uiUpdateNeeded = false;
|
||||
|
||||
_label.SetMarkup(Loc.GetString(
|
||||
"Volume: [color=white]{0}/{1}[/color]",
|
||||
_parent.CurrentVolume, _parent.TotalVolume));
|
||||
"hypospray-volume-text",
|
||||
("currentVolume", _parent.CurrentVolume),
|
||||
("totalVolume", _parent.TotalVolume)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,12 +71,14 @@ namespace Content.Client.Chemistry.Components
|
||||
//Update current volume and injector state
|
||||
var modeStringLocalized = _parent.CurrentMode switch
|
||||
{
|
||||
InjectorToggleMode.Draw => Loc.GetString("Draw"),
|
||||
InjectorToggleMode.Inject => Loc.GetString("Inject"),
|
||||
_ => Loc.GetString("Invalid")
|
||||
InjectorToggleMode.Draw => Loc.GetString("injector-draw-text"),
|
||||
InjectorToggleMode.Inject => Loc.GetString("injector-inject-text"),
|
||||
_ => Loc.GetString("injector-invalid-injector-toggle-mode")
|
||||
};
|
||||
_label.SetMarkup(Loc.GetString("Volume: [color=white]{0}/{1}[/color] | [color=white]{2}[/color]",
|
||||
_parent.CurrentVolume, _parent.TotalVolume, modeStringLocalized));
|
||||
_label.SetMarkup(Loc.GetString("injector-volume-label",
|
||||
("currentVolume", _parent.CurrentVolume),
|
||||
("totalVolume", _parent.TotalVolume),
|
||||
("modeString", modeStringLocalized)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace Content.Client.Chemistry.UI
|
||||
//Setup window layout/elements
|
||||
_window = new ChemMasterWindow
|
||||
{
|
||||
Title = Loc.GetString("ChemMaster 4000"),
|
||||
Title = Loc.GetString("chem-master-bound-user-interface-title"),
|
||||
};
|
||||
|
||||
_window.OpenCentered();
|
||||
@@ -58,7 +58,7 @@ namespace Content.Client.Chemistry.UI
|
||||
{
|
||||
base.UpdateState(state);
|
||||
|
||||
var castState = (ChemMasterBoundUserInterfaceState)state;
|
||||
var castState = (ChemMasterBoundUserInterfaceState) state;
|
||||
|
||||
_window?.UpdateState(castState); //Update window state
|
||||
}
|
||||
@@ -73,7 +73,6 @@ namespace Content.Client.Chemistry.UI
|
||||
{
|
||||
SendMessage(new UiActionMessage(action, null, null, null, pillAmount, bottleAmount));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
|
||||
@@ -66,9 +66,9 @@ namespace Content.Client.Chemistry.UI
|
||||
{
|
||||
Children =
|
||||
{
|
||||
new Label {Text = Loc.GetString("Container")},
|
||||
new Label {Text = Loc.GetString("chem-master-window-container-label")},
|
||||
new Control {HorizontalExpand = true},
|
||||
(EjectButton = new Button {Text = Loc.GetString("Eject")})
|
||||
(EjectButton = new Button {Text = Loc.GetString("chem-master-window-eject-button")})
|
||||
}
|
||||
},
|
||||
//Wrap the container info in a PanelContainer so we can color it's background differently.
|
||||
@@ -91,7 +91,7 @@ namespace Content.Client.Chemistry.UI
|
||||
{
|
||||
new Label
|
||||
{
|
||||
Text = Loc.GetString("No container loaded.")
|
||||
Text = Loc.GetString("chem-master-window-no-container-loaded-text")
|
||||
}
|
||||
}
|
||||
}),
|
||||
@@ -106,10 +106,10 @@ namespace Content.Client.Chemistry.UI
|
||||
{
|
||||
Children =
|
||||
{
|
||||
new Label {Text = Loc.GetString("Buffer")},
|
||||
new Label {Text = Loc.GetString("chem-master-window-buffer-text")},
|
||||
new Control {HorizontalExpand = true},
|
||||
(BufferTransferButton = new Button {Text = Loc.GetString("Transfer"), Pressed = BufferModeTransfer, StyleClasses = { StyleBase.ButtonOpenRight }}),
|
||||
(BufferDiscardButton = new Button {Text = Loc.GetString("Discard"), Pressed = !BufferModeTransfer, StyleClasses = { StyleBase.ButtonOpenLeft }})
|
||||
(BufferTransferButton = new Button {Text = Loc.GetString("chem-master-window-transfer-button"), Pressed = BufferModeTransfer, StyleClasses = { StyleBase.ButtonOpenRight }}),
|
||||
(BufferDiscardButton = new Button {Text = Loc.GetString("chem-master-window-discard-button"), Pressed = !BufferModeTransfer, StyleClasses = { StyleBase.ButtonOpenLeft }})
|
||||
}
|
||||
},
|
||||
|
||||
@@ -133,7 +133,7 @@ namespace Content.Client.Chemistry.UI
|
||||
{
|
||||
new Label
|
||||
{
|
||||
Text = Loc.GetString("Buffer empty.")
|
||||
Text = Loc.GetString("chem-master-window-buffer-empty-text")
|
||||
}
|
||||
}
|
||||
}),
|
||||
@@ -148,7 +148,7 @@ namespace Content.Client.Chemistry.UI
|
||||
{
|
||||
Children =
|
||||
{
|
||||
new Label {Text = Loc.GetString("Packaging ")},
|
||||
new Label {Text = $"{Loc.GetString("chem-master-window-packaging-text")} "},
|
||||
}
|
||||
},
|
||||
|
||||
@@ -182,7 +182,7 @@ namespace Content.Client.Chemistry.UI
|
||||
{
|
||||
new Label
|
||||
{
|
||||
Text = Loc.GetString("Pills:")
|
||||
Text = $"{Loc.GetString("chem-master-window-pills-label")} "
|
||||
},
|
||||
|
||||
},
|
||||
@@ -204,12 +204,12 @@ namespace Content.Client.Chemistry.UI
|
||||
|
||||
var pillVolume = new Label
|
||||
{
|
||||
Text = " max 50u/each ",
|
||||
Text = $" {Loc.GetString("chem-master-window-max-pills-volume-text")} ",
|
||||
StyleClasses = {StyleNano.StyleClassLabelSecondaryColor}
|
||||
};
|
||||
PillInfo.AddChild((pillVolume));
|
||||
|
||||
CreatePills = new Button {Text = Loc.GetString("Create")};
|
||||
CreatePills = new Button {Text = Loc.GetString("chem-master-window-create-pill-button") };
|
||||
PillInfo.AddChild(CreatePills);
|
||||
|
||||
//Bottles
|
||||
@@ -219,7 +219,7 @@ namespace Content.Client.Chemistry.UI
|
||||
{
|
||||
new Label
|
||||
{
|
||||
Text = Loc.GetString("Bottles:")
|
||||
Text = Loc.GetString("cham-master-window-bottles-label")
|
||||
},
|
||||
|
||||
},
|
||||
@@ -241,12 +241,12 @@ namespace Content.Client.Chemistry.UI
|
||||
|
||||
var bottleVolume = new Label
|
||||
{
|
||||
Text = " max 30u/each ",
|
||||
Text = $" {Loc.GetString("chem-master-window-max-bottle-volume-text")} ",
|
||||
StyleClasses = {StyleNano.StyleClassLabelSecondaryColor}
|
||||
};
|
||||
BottleInfo.AddChild((bottleVolume));
|
||||
|
||||
CreateBottles = new Button {Text = Loc.GetString("Create")};
|
||||
CreateBottles = new Button {Text = Loc.GetString("chem-master-window-create-bottle-button") };
|
||||
BottleInfo.AddChild(CreateBottles);
|
||||
}
|
||||
|
||||
@@ -311,7 +311,7 @@ namespace Content.Client.Chemistry.UI
|
||||
|
||||
if (!state.HasBeaker)
|
||||
{
|
||||
ContainerInfo.Children.Add(new Label {Text = Loc.GetString("No container loaded.")});
|
||||
ContainerInfo.Children.Add(new Label {Text = Loc.GetString("chem-master-window-no-container-loaded-text") });
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -330,7 +330,7 @@ namespace Content.Client.Chemistry.UI
|
||||
|
||||
foreach (var reagent in state.ContainerReagents)
|
||||
{
|
||||
var name = Loc.GetString("Unknown reagent");
|
||||
var name = Loc.GetString("chem-master-window-unknown-reagent-text");
|
||||
//Try to the prototype for the given reagent. This gives us it's name.
|
||||
if (_prototypeManager.TryIndex(reagent.ReagentId, out ReagentPrototype? proto))
|
||||
{
|
||||
@@ -357,7 +357,7 @@ namespace Content.Client.Chemistry.UI
|
||||
MakeChemButton("5", ReagentUnit.New(5), reagent.ReagentId, false, StyleBase.ButtonOpenBoth),
|
||||
MakeChemButton("10", ReagentUnit.New(10), reagent.ReagentId, false, StyleBase.ButtonOpenBoth),
|
||||
MakeChemButton("25", ReagentUnit.New(25), reagent.ReagentId, false, StyleBase.ButtonOpenBoth),
|
||||
MakeChemButton("All", ReagentUnit.New(-1), reagent.ReagentId, false, StyleBase.ButtonOpenLeft),
|
||||
MakeChemButton(Loc.GetString("chem-master-window-buffer-all-amount"), ReagentUnit.New(-1), reagent.ReagentId, false, StyleBase.ButtonOpenLeft),
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -367,14 +367,14 @@ namespace Content.Client.Chemistry.UI
|
||||
|
||||
if (!state.BufferReagents.Any())
|
||||
{
|
||||
BufferInfo.Children.Add(new Label {Text = Loc.GetString("Buffer empty.")});
|
||||
BufferInfo.Children.Add(new Label {Text = Loc.GetString("chem-master-window-buffer-empty-text") });
|
||||
return;
|
||||
}
|
||||
|
||||
var bufferHBox = new HBoxContainer();
|
||||
BufferInfo.AddChild(bufferHBox);
|
||||
|
||||
var bufferLabel = new Label {Text = "buffer: "};
|
||||
var bufferLabel = new Label { Text = $"{Loc.GetString("chem-master-window-buffer-label")} " };
|
||||
bufferHBox.AddChild(bufferLabel);
|
||||
var bufferVol = new Label
|
||||
{
|
||||
@@ -385,7 +385,7 @@ namespace Content.Client.Chemistry.UI
|
||||
|
||||
foreach (var reagent in state.BufferReagents)
|
||||
{
|
||||
var name = Loc.GetString("Unknown reagent");
|
||||
var name = Loc.GetString("chem-master-window-unknown-reagent-text");
|
||||
//Try to the prototype for the given reagent. This gives us it's name.
|
||||
if (_prototypeManager.TryIndex(reagent.ReagentId, out ReagentPrototype? proto))
|
||||
{
|
||||
@@ -413,7 +413,7 @@ namespace Content.Client.Chemistry.UI
|
||||
MakeChemButton("5", ReagentUnit.New(5), reagent.ReagentId, true, StyleBase.ButtonOpenBoth),
|
||||
MakeChemButton("10", ReagentUnit.New(10), reagent.ReagentId, true, StyleBase.ButtonOpenBoth),
|
||||
MakeChemButton("25", ReagentUnit.New(25), reagent.ReagentId, true, StyleBase.ButtonOpenBoth),
|
||||
MakeChemButton("All", ReagentUnit.New(-1), reagent.ReagentId, true, StyleBase.ButtonOpenLeft),
|
||||
MakeChemButton(Loc.GetString("chem-master-window-buffer-all-amount"), ReagentUnit.New(-1), reagent.ReagentId, true, StyleBase.ButtonOpenLeft),
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Content.Shared.Chemistry.Dispenser;
|
||||
using JetBrains.Annotations;
|
||||
@@ -35,7 +35,7 @@ namespace Content.Client.Chemistry.UI
|
||||
//Setup window layout/elements
|
||||
_window = new ReagentDispenserWindow
|
||||
{
|
||||
Title = Loc.GetString("Reagent dispenser"),
|
||||
Title = Loc.GetString("reagent-dispenser-bound-user-interface-title"),
|
||||
};
|
||||
|
||||
_window.OpenCentered();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using Content.Client.Stylesheets;
|
||||
using Content.Shared.Chemistry.Dispenser;
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
@@ -81,7 +81,7 @@ namespace Content.Client.Chemistry.UI
|
||||
{
|
||||
Children =
|
||||
{
|
||||
new Label {Text = Loc.GetString("Amount")},
|
||||
new Label {Text = Loc.GetString("reagent-dispenser-window-amount-to-dispense-label")},
|
||||
//Padding
|
||||
new Control {MinSize = (20, 0)},
|
||||
(DispenseButton1 = new Button {Text = "1", Group = dispenseAmountGroup, StyleClasses = { StyleBase.ButtonOpenRight }}),
|
||||
@@ -108,9 +108,9 @@ namespace Content.Client.Chemistry.UI
|
||||
{
|
||||
Children =
|
||||
{
|
||||
new Label {Text = Loc.GetString("Container: ")},
|
||||
(ClearButton = new Button {Text = Loc.GetString("Clear"), StyleClasses = {StyleBase.ButtonOpenRight}}),
|
||||
(EjectButton = new Button {Text = Loc.GetString("Eject"), StyleClasses = {StyleBase.ButtonOpenLeft}})
|
||||
new Label {Text = Loc.GetString("reagent-dispenser-window-container-label") + " "},
|
||||
(ClearButton = new Button {Text = Loc.GetString("reagent-dispenser-window-clear-button"), StyleClasses = {StyleBase.ButtonOpenRight}}),
|
||||
(EjectButton = new Button {Text = Loc.GetString("reagent-dispenser-window-eject-button"), StyleClasses = {StyleBase.ButtonOpenLeft}})
|
||||
}
|
||||
},
|
||||
//Wrap the container info in a PanelContainer so we can color it's background differently.
|
||||
@@ -133,7 +133,7 @@ namespace Content.Client.Chemistry.UI
|
||||
{
|
||||
new Label
|
||||
{
|
||||
Text = Loc.GetString("No container loaded.")
|
||||
Text = Loc.GetString("reagent-dispenser-window-no-container-loaded-text")
|
||||
}
|
||||
}
|
||||
}),
|
||||
@@ -163,7 +163,7 @@ namespace Content.Client.Chemistry.UI
|
||||
}
|
||||
else
|
||||
{
|
||||
ChemicalList.AddChild(new Button {Text = Loc.GetString("Reagent name not found")});
|
||||
ChemicalList.AddChild(new Button {Text = Loc.GetString("reagent-dispenser-window-reagent-name-not-found-text") });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -259,7 +259,7 @@ namespace Content.Client.Chemistry.UI
|
||||
|
||||
if (!state.HasBeaker)
|
||||
{
|
||||
ContainerInfo.Children.Add(new Label {Text = Loc.GetString("No container loaded.")});
|
||||
ContainerInfo.Children.Add(new Label {Text = Loc.GetString("reagent-dispenser-window-no-container-loaded-text") });
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -283,7 +283,7 @@ namespace Content.Client.Chemistry.UI
|
||||
|
||||
foreach (var reagent in state.ContainerReagents)
|
||||
{
|
||||
var name = Loc.GetString("Unknown reagent");
|
||||
var name = Loc.GetString("reagent-dispenser-window-unknown-reagent-text");
|
||||
//Try to the prototype for the given reagent. This gives us it's name.
|
||||
if (_prototypeManager.TryIndex(reagent.ReagentId, out ReagentPrototype? proto))
|
||||
{
|
||||
@@ -304,7 +304,7 @@ namespace Content.Client.Chemistry.UI
|
||||
},
|
||||
new Label
|
||||
{
|
||||
Text = $"{reagent.Quantity}u",
|
||||
Text = Loc.GetString("reagent-dispenser-window-quantity-label-text", ("quantity", reagent.Quantity)),
|
||||
StyleClasses = {StyleNano.StyleClassPowerStateGood}
|
||||
}
|
||||
}
|
||||
@@ -319,7 +319,7 @@ namespace Content.Client.Chemistry.UI
|
||||
new Label {Text = $"{name}: "},
|
||||
new Label
|
||||
{
|
||||
Text = $"{reagent.Quantity}u",
|
||||
Text = Loc.GetString("reagent-dispenser-window-quantity-label-text", ("quantity", reagent.Quantity)),
|
||||
StyleClasses = {StyleNano.StyleClassLabelSecondaryColor}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user