2023-04-29 11:39:08 +00:00
|
|
|
using Content.Server.Storage.EntitySystems;
|
|
|
|
|
using Content.Shared.Whitelist;
|
|
|
|
|
|
|
|
|
|
namespace Content.Server.Storage.Components;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Adds a verb to pick a random item from a container.
|
|
|
|
|
/// Only picks items that match the whitelist.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[RegisterComponent]
|
|
|
|
|
[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>
|
2023-10-10 20:06:24 -07:00
|
|
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
2023-04-29 11:39:08 +00:00
|
|
|
public EntityWhitelist? Whitelist;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Locale id for the pick verb text.
|
|
|
|
|
/// </summary>
|
2023-10-10 20:06:24 -07:00
|
|
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
|
|
|
|
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>
|
2023-10-10 20:06:24 -07:00
|
|
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
|
|
|
|
public LocId EmptyText = "comp-pick-random-empty";
|
2023-04-29 11:39:08 +00:00
|
|
|
}
|