Add description tooltips to traits, jobs and antagonists (#11661)

Co-authored-by: CommieFlowers <rasmus.cedergren@hotmail.com>
This commit is contained in:
rolfero
2022-10-26 13:52:21 +02:00
committed by GitHub
parent b6bc0d37c2
commit 9bbe0fec06
6 changed files with 55 additions and 1 deletions

View File

@@ -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,