Localize material names (#11059)

This commit is contained in:
Morb
2022-09-14 06:00:08 +03:00
committed by GitHub
parent ebcce52abe
commit 89367f71e4
5 changed files with 42 additions and 16 deletions

View File

@@ -13,6 +13,8 @@ namespace Content.Shared.Materials
[Prototype("material")]
public sealed class MaterialPrototype : IPrototype, IInheritingPrototype
{
private string _name = string.Empty;
[ViewVariables]
[ParentDataField(typeof(AbstractPrototypeIdArraySerializer<MaterialPrototype>))]
public string[]? Parents { get; }
@@ -31,7 +33,11 @@ namespace Content.Shared.Materials
[ViewVariables]
[DataField("name")]
public string Name { get; } = "unobtanium";
public string Name
{
get => _name;
private set => _name = Loc.GetString(value);
}
[ViewVariables]
[DataField("color")]