Add description tooltips to traits, jobs and antagonists (#11661)
Co-authored-by: CommieFlowers <rasmus.cedergren@hotmail.com>
This commit is contained in:
@@ -10,6 +10,7 @@ namespace Content.Shared.Roles
|
||||
{
|
||||
private string _name = string.Empty;
|
||||
private string _objective = string.Empty;
|
||||
private string? _description = string.Empty;
|
||||
|
||||
[ViewVariables]
|
||||
[IdDataFieldAttribute]
|
||||
@@ -25,6 +26,16 @@ namespace Content.Shared.Roles
|
||||
private set => _name = Loc.GetString(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The description of this antag shown in a tooltip.
|
||||
/// </summary>
|
||||
[DataField("description")]
|
||||
public string? Description
|
||||
{
|
||||
get => _description;
|
||||
private set => _description = value is null ? null : Loc.GetString(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The antag's objective, displayed at round-start to the player.
|
||||
/// </summary>
|
||||
|
||||
@@ -31,6 +31,15 @@ namespace Content.Shared.Roles
|
||||
[ViewVariables(VVAccess.ReadOnly)]
|
||||
public string LocalizedName => Loc.GetString(Name);
|
||||
|
||||
/// <summary>
|
||||
/// The name of this job as displayed to players.
|
||||
/// </summary>
|
||||
[DataField("description")]
|
||||
public string? Description { get; }
|
||||
|
||||
[ViewVariables(VVAccess.ReadOnly)]
|
||||
public string? LocalizedDescription => Description is null ? null : Loc.GetString(Description);
|
||||
|
||||
[DataField("requirements")]
|
||||
public HashSet<JobRequirement>? Requirements;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user