Skip to content

Commit

Permalink
Hidden loadout groups (#29170)
Browse files Browse the repository at this point in the history
* loadout hiding

* department of redundancy department
  • Loading branch information
Errant-4 authored Jun 19, 2024
1 parent baa6836 commit 9b2f9ce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Content.Client/Lobby/UI/Loadouts/LoadoutWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ public LoadoutWindow(HumanoidCharacterProfile profile, RoleLoadout loadout, Role
if (!protoManager.TryIndex(group, out var groupProto))
continue;

if (groupProto.Hidden)
continue;

var container = new LoadoutGroupContainer(profile, loadout, protoManager.Index(group), session, collection);
LoadoutGroupsContainer.AddTab(container, Loc.GetString(groupProto.Name));
_groups.Add(container);
Expand Down
6 changes: 6 additions & 0 deletions Content.Shared/Preferences/Loadouts/LoadoutGroupPrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ public sealed partial class LoadoutGroupPrototype : IPrototype
[DataField]
public int MaxLimit = 1;

/// <summary>
/// Hides the loadout group from the player.
/// </summary>
[DataField]
public bool Hidden;

[DataField(required: true)]
public List<ProtoId<LoadoutPrototype>> Loadouts = new();
}

0 comments on commit 9b2f9ce

Please sign in to comment.