From f8cf4dc829dd5978c68255dd8c3570535e4fad91 Mon Sep 17 00:00:00 2001 From: qrwas Date: Mon, 16 Jun 2025 12:36:06 +0300 Subject: [PATCH] Add group for loadouts (#36951) Co-authored-by: ArtisticRoomba <145879011+ArtisticRoomba@users.noreply.github.com> --- .../UI/Loadouts/LoadoutContainer.xaml.cs | 19 +- .../UI/Loadouts/LoadoutGroupContainer.xaml | 12 +- .../UI/Loadouts/LoadoutGroupContainer.xaml.cs | 184 ++++++++++++++++-- .../UI/Loadouts/SubLoadoutContainer.xaml | 8 + .../UI/Loadouts/SubLoadoutContainer.xaml.cs | 21 ++ .../UI/Loadouts/ToggleLoadoutButton.xaml | 9 + .../UI/Loadouts/ToggleLoadoutButton.xaml.cs | 10 + .../Preferences/Loadouts/LoadoutPrototype.cs | 5 + .../Jobs/Security/head_of_security.yml | 6 + .../Loadouts/Miscellaneous/trinkets.yml | 77 ++++++-- 10 files changed, 295 insertions(+), 56 deletions(-) create mode 100644 Content.Client/Lobby/UI/Loadouts/SubLoadoutContainer.xaml create mode 100644 Content.Client/Lobby/UI/Loadouts/SubLoadoutContainer.xaml.cs create mode 100644 Content.Client/Lobby/UI/Loadouts/ToggleLoadoutButton.xaml create mode 100644 Content.Client/Lobby/UI/Loadouts/ToggleLoadoutButton.xaml.cs diff --git a/Content.Client/Lobby/UI/Loadouts/LoadoutContainer.xaml.cs b/Content.Client/Lobby/UI/Loadouts/LoadoutContainer.xaml.cs index 2ab40fb37d..2264cecd23 100644 --- a/Content.Client/Lobby/UI/Loadouts/LoadoutContainer.xaml.cs +++ b/Content.Client/Lobby/UI/Loadouts/LoadoutContainer.xaml.cs @@ -20,6 +20,12 @@ public sealed partial class LoadoutContainer : BoxContainer public Button Select => SelectButton; + public string? Text + { + get => SelectButton.Text; + set => SelectButton.Text = value; + } + public LoadoutContainer(ProtoId proto, bool disabled, FormattedMessage? reason) { RobustXamlLoader.Load(this); @@ -54,22 +60,9 @@ public sealed partial class LoadoutContainer : BoxContainer protected override void Dispose(bool disposing) { base.Dispose(disposing); - if (!disposing) return; _entManager.DeleteEntity(_entity); } - - public bool Pressed - { - get => SelectButton.Pressed; - set => SelectButton.Pressed = value; - } - - public string? Text - { - get => SelectButton.Text; - set => SelectButton.Text = value; - } } diff --git a/Content.Client/Lobby/UI/Loadouts/LoadoutGroupContainer.xaml b/Content.Client/Lobby/UI/Loadouts/LoadoutGroupContainer.xaml index 1e3eb14d3f..0deb1c82ba 100644 --- a/Content.Client/Lobby/UI/Loadouts/LoadoutGroupContainer.xaml +++ b/Content.Client/Lobby/UI/Loadouts/LoadoutGroupContainer.xaml @@ -1,10 +1,14 @@ - - + + -