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.
|
||||
|
||||
@@ -1 +1,12 @@
|
||||
permanent-blindness-trait-examined = [color=lightblue]{CAPITALIZE(POSS-ADJ($target))} eyes are glassy and unfocused. It doesn't seem like {SUBJECT($target)} can see you.[/color]
|
||||
trait-blindness-name = Blindness
|
||||
trait-blindness-desc = You lack vision
|
||||
|
||||
trait-narcolepsy-name = Narcolepsy
|
||||
trait-narcolepsy-decs = You fall asleep randomly
|
||||
|
||||
trait-pacifist-name = Pacifist
|
||||
|
||||
trait-sneezing-name = Runny nose
|
||||
trait-sneezing-desc = You sneeze and cough uncontrollably
|
||||
|
||||
permanent-blindness-trait-examined = [color=lightblue]{CAPITALIZE(POSS-ADJ($target))} eyes are glassy and unfocused. It doesn't seem like {SUBJECT($target)} can see you.[/color]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
- type: trait
|
||||
id: Blindness
|
||||
name: Blindness
|
||||
description: You lack vision
|
||||
name: trait-blindness-name
|
||||
description: trait-blindness-desc
|
||||
whitelist:
|
||||
components:
|
||||
- Blindable
|
||||
@@ -10,8 +10,8 @@
|
||||
|
||||
- type: trait
|
||||
id: Narcolepsy
|
||||
name: Narcolepsy
|
||||
description: You fall asleep randomly
|
||||
name: trait-narcolepsy-name
|
||||
description: trait-narcolepsy-decs
|
||||
components:
|
||||
- type: Narcolepsy
|
||||
timeBetweenIncidents: 300, 600
|
||||
@@ -19,6 +19,6 @@
|
||||
|
||||
- type: trait
|
||||
id: Pacifist
|
||||
name: Pacifist
|
||||
name: trait-pacifist-name
|
||||
components:
|
||||
- type: Pacifist
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
- type: trait
|
||||
id: UncontrollableSneezing
|
||||
name: Runny nose
|
||||
description: You sneeze and cough uncontrollably
|
||||
name: trait-sneezing-name
|
||||
description: trait-sneezing-desc
|
||||
whitelist:
|
||||
components:
|
||||
- DiseaseCarrier
|
||||
|
||||
Reference in New Issue
Block a user