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;
|
||||
|
||||
|
||||
@@ -19,6 +19,12 @@ namespace Content.Shared.Traits
|
||||
[DataField("name")]
|
||||
public string Name { get; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// The description of this trait.
|
||||
/// </summary>
|
||||
[DataField("description")]
|
||||
public string? Description { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The components that get added to the player, when they pick this trait.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user