diff --git a/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml.cs b/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml.cs index d168dc4617..f449e26b6b 100644 --- a/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml.cs +++ b/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml.cs @@ -1099,6 +1099,7 @@ namespace Content.Client.Preferences.UI private StripeBack _lockStripe; private Label _requirementsLabel; + private Label _jobTitle; public JobPrioritySelector(JobPrototype job) { @@ -1156,13 +1157,25 @@ namespace Content.Client.Preferences.UI } }; + _jobTitle = new Label() + { + Text = job.LocalizedName, + MinSize = (175, 0) + }; + + if (job.LocalizedDescription != null) + { + _jobTitle.ToolTip = job.LocalizedDescription; + _jobTitle.TooltipDelay = 0.2f; + } + AddChild(new BoxContainer { Orientation = LayoutOrientation.Horizontal, Children = { icon, - new Label {Text = job.LocalizedName, MinSize = (175, 0)}, + _jobTitle, _optionButton, _lockStripe, } @@ -1227,6 +1240,12 @@ namespace Content.Client.Preferences.UI _checkBox = new CheckBox {Text = $"{antag.Name}"}; _checkBox.OnToggled += OnCheckBoxToggled; + if (antag.Description != null) + { + _checkBox.ToolTip = antag.Description; + _checkBox.TooltipDelay = 0.2f; + } + AddChild(new BoxContainer { Orientation = LayoutOrientation.Horizontal, @@ -1263,6 +1282,12 @@ namespace Content.Client.Preferences.UI _checkBox = new CheckBox {Text = $"{trait.Name}"}; _checkBox.OnToggled += OnCheckBoxToggled; + if (trait.Description != null) + { + _checkBox.ToolTip = trait.Description; + _checkBox.TooltipDelay = 0.2f; + } + AddChild(new BoxContainer { Orientation = LayoutOrientation.Horizontal, diff --git a/Content.Shared/Roles/AntagPrototype.cs b/Content.Shared/Roles/AntagPrototype.cs index 470d4897e9..c64830a7b9 100644 --- a/Content.Shared/Roles/AntagPrototype.cs +++ b/Content.Shared/Roles/AntagPrototype.cs @@ -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); } + /// + /// The description of this antag shown in a tooltip. + /// + [DataField("description")] + public string? Description + { + get => _description; + private set => _description = value is null ? null : Loc.GetString(value); + } + /// /// The antag's objective, displayed at round-start to the player. /// diff --git a/Content.Shared/Roles/JobPrototype.cs b/Content.Shared/Roles/JobPrototype.cs index 14bd3548bb..8807345f59 100644 --- a/Content.Shared/Roles/JobPrototype.cs +++ b/Content.Shared/Roles/JobPrototype.cs @@ -31,6 +31,15 @@ namespace Content.Shared.Roles [ViewVariables(VVAccess.ReadOnly)] public string LocalizedName => Loc.GetString(Name); + /// + /// The name of this job as displayed to players. + /// + [DataField("description")] + public string? Description { get; } + + [ViewVariables(VVAccess.ReadOnly)] + public string? LocalizedDescription => Description is null ? null : Loc.GetString(Description); + [DataField("requirements")] public HashSet? Requirements; diff --git a/Content.Shared/Traits/TraitPrototype.cs b/Content.Shared/Traits/TraitPrototype.cs index c0e31a6e48..94f0b39c0a 100644 --- a/Content.Shared/Traits/TraitPrototype.cs +++ b/Content.Shared/Traits/TraitPrototype.cs @@ -19,6 +19,12 @@ namespace Content.Shared.Traits [DataField("name")] public string Name { get; } = string.Empty; + /// + /// The description of this trait. + /// + [DataField("description")] + public string? Description { get; } + /// /// The components that get added to the player, when they pick this trait. /// diff --git a/Resources/Prototypes/Traits/disabilities.yml b/Resources/Prototypes/Traits/disabilities.yml index 365b896608..e6dfd5a9b9 100644 --- a/Resources/Prototypes/Traits/disabilities.yml +++ b/Resources/Prototypes/Traits/disabilities.yml @@ -1,12 +1,14 @@ - type: trait id: Blindness name: Blindness + description: You lack vision components: - type: PermanentBlindness - type: trait id: Narcolepsy name: Narcolepsy + description: You fall asleep randomly components: - type: Narcolepsy timeBetweenIncidents: 300, 600 diff --git a/Resources/Prototypes/Traits/inconveniences.yml b/Resources/Prototypes/Traits/inconveniences.yml index dde4135a7d..e8238c9bc1 100644 --- a/Resources/Prototypes/Traits/inconveniences.yml +++ b/Resources/Prototypes/Traits/inconveniences.yml @@ -1,6 +1,7 @@ - type: trait id: UncontrollableSneezing name: Runny nose + description: You sneeze and cough uncontrollably components: - type: UncontrollableSnough snoughSound: