Localize antag roles (#10638)

This commit is contained in:
Morb
2022-09-01 05:37:54 +03:00
committed by GitHub
parent d946ed5009
commit 49397adbc5
7 changed files with 47 additions and 16 deletions

View File

@@ -8,6 +8,9 @@ namespace Content.Shared.Roles
[Prototype("antag")]
public sealed class AntagPrototype : IPrototype
{
private string _name = string.Empty;
private string _objective = string.Empty;
[ViewVariables]
[IdDataFieldAttribute]
public string ID { get; } = default!;
@@ -16,13 +19,21 @@ namespace Content.Shared.Roles
/// The name of this antag as displayed to players.
/// </summary>
[DataField("name")]
public string Name { get; } = string.Empty;
public string Name
{
get => _name;
private set => _name = Loc.GetString(value);
}
/// <summary>
/// The antag's objective, displayed at round-start to the player.
/// </summary>
[DataField("objective")]
public string Objective { get; private set; } = string.Empty;
public string Objective
{
get => _objective;
private set => _objective = Loc.GetString(value);
}
/// <summary>
/// Whether or not the antag role is one of the bad guys.