Accent trait limit (#28046)

This commit is contained in:
Ed
2024-06-03 21:47:06 +03:00
committed by GitHub
parent ee8224bce2
commit a4d1601758
14 changed files with 365 additions and 171 deletions

View File

@@ -9,6 +9,8 @@ namespace Content.Client.Lobby.UI.Roles;
[GenerateTypedNameReferences]
public sealed partial class TraitPreferenceSelector : Control
{
public int Cost;
public bool Preference
{
get => Checkbox.Pressed;
@@ -20,7 +22,12 @@ public sealed partial class TraitPreferenceSelector : Control
public TraitPreferenceSelector(TraitPrototype trait)
{
RobustXamlLoader.Load(this);
Checkbox.Text = Loc.GetString(trait.Name);
var text = trait.Cost != 0 ? $"[{trait.Cost}] " : "";
text += Loc.GetString(trait.Name);
Cost = trait.Cost;
Checkbox.Text = text;
Checkbox.OnToggled += OnCheckBoxToggled;
if (trait.Description is { } desc)