2025-08-06 04:29:13 +02:00
|
|
|
using Content.Shared.Storage.EntitySystems;
|
2023-04-29 11:39:08 +00:00
|
|
|
using Content.Shared.Whitelist;
|
2025-08-06 04:29:13 +02:00
|
|
|
using Robust.Shared.GameStates;
|
2023-04-29 11:39:08 +00:00
|
|
|
|
2025-08-06 04:29:13 +02:00
|
|
|
namespace Content.Shared.Storage.Components;
|
2023-04-29 11:39:08 +00:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Adds a verb to pick a random item from a container.
|
|
|
|
|
/// Only picks items that match the whitelist.
|
|
|
|
|
/// </summary>
|
2025-08-06 04:29:13 +02:00
|
|
|
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
2023-04-29 11:39:08 +00:00
|
|
|
[Access(typeof(PickRandomSystem))]
|
2023-08-22 18:14:33 -07:00
|
|
|
public sealed partial class PickRandomComponent : Component
|
2023-04-29 11:39:08 +00:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Whitelist for potential picked items.
|
|
|
|
|
/// </summary>
|
2025-08-06 04:29:13 +02:00
|
|
|
[DataField, AutoNetworkedField]
|
2023-04-29 11:39:08 +00:00
|
|
|
public EntityWhitelist? Whitelist;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Locale id for the pick verb text.
|
|
|
|
|
/// </summary>
|
2025-08-06 04:29:13 +02:00
|
|
|
[DataField, AutoNetworkedField]
|
2023-10-10 20:06:24 -07:00
|
|
|
public LocId VerbText = "comp-pick-random-verb-text";
|
2023-04-29 11:39:08 +00:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Locale id for the empty storage message.
|
|
|
|
|
/// </summary>
|
2025-08-06 04:29:13 +02:00
|
|
|
[DataField, AutoNetworkedField]
|
2023-10-10 20:06:24 -07:00
|
|
|
public LocId EmptyText = "comp-pick-random-empty";
|
2023-04-29 11:39:08 +00:00
|
|
|
}
|