Localize traits (#11765)
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
@@ -10,6 +10,9 @@ namespace Content.Shared.Traits
|
||||
[Prototype("trait")]
|
||||
public sealed class TraitPrototype : IPrototype
|
||||
{
|
||||
private string _name = string.Empty;
|
||||
private string? _description;
|
||||
|
||||
[ViewVariables]
|
||||
[IdDataField]
|
||||
public string ID { get; } = default!;
|
||||
@@ -18,13 +21,21 @@ namespace Content.Shared.Traits
|
||||
/// The name of this trait.
|
||||
/// </summary>
|
||||
[DataField("name")]
|
||||
public string Name { get; } = string.Empty;
|
||||
public string Name
|
||||
{
|
||||
get => _name;
|
||||
private set => _name = Loc.GetString(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The description of this trait.
|
||||
/// </summary>
|
||||
[DataField("description")]
|
||||
public string? Description { get; }
|
||||
public string? Description
|
||||
{
|
||||
get => _description;
|
||||
private set => _description = value is null ? null : Loc.GetString(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Don't apply this trait to entities this whitelist IS NOT valid for.
|
||||
|
||||
Reference in New Issue
Block a user