Files
Delta-v/Content.Client/Lobby/UI/Roles/TraitPreferenceSelector.xaml.cs
T
4364eaa388 real traits system (#5208)
* holy shit?

* final touches

* this is dumb

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* whatever go my integration tests

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* whoopsie forgot blacklists

* load bearing loc

* minor stuff

* whoopsie

* cool

* I LOVE REFLECTION

* got a call from the stink department

* i love fluent yes

* direction changes

* waiter more migrations please

* typo ops

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tobias Berger <toby@tobot.dev>
2026-01-20 12:49:59 +01:00

46 lines
1.3 KiB
C#

using Content.Shared.Traits;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
namespace Content.Client.Lobby.UI.Roles;
[GenerateTypedNameReferences]
public sealed partial class TraitPreferenceSelector : Control
{
public int Cost;
public bool Preference
{
get => Checkbox.Pressed;
set => Checkbox.Pressed = value;
}
public event Action<bool>? PreferenceChanged;
// DeltaV - This whole control is generally unused but the compiler wouldn't compile if I removed it
// So I'm just gonna comment this part out
// public TraitPreferenceSelector(TraitPrototype trait)
// {
// RobustXamlLoader.Load(this);
//
// 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)
// {
// Checkbox.ToolTip = Loc.GetString(desc);
// }
// }
private void OnCheckBoxToggled(BaseButton.ButtonToggledEventArgs args)
{
PreferenceChanged?.Invoke(Preference);
}
}