Files
wwdpublic/Content.Shared/UserInterface/ActivatableUIComponent.cs
RedFoxIV ed9c0fcd12 [педальные раздатчики] настолько заебался что даже шутить уже не хочется (#159)
* Shitspawner Extraordinare

* Shitcoder Extraordinare

* the code is leaking

* ёбушки-воробушки

* it will all be over soon

* шутки кончились

* virtual selfantag

* шейдеры это на удивление весело

* i'm tired boss

* connection terminated

* консервная банка

* а чё сразу нельзя было?

* minus

* Removed Herobrine.

* мусор

* Apply suggestions from code review

Co-authored-by: Spatison <137375981+Spatison@users.noreply.github.com>

* code review

* fix: unshit

* shit: unfix

* потемнее

* переперевод

* ok i clean up

* жопа

Co-authored-by: Spatison <137375981+Spatison@users.noreply.github.com>

* scuffed english localization

---------

Co-authored-by: Spatison <137375981+Spatison@users.noreply.github.com>
2025-01-02 00:20:07 +07:00

84 lines
3.0 KiB
C#

using Content.Shared.Whitelist;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization.TypeSerializers.Implementations;
namespace Content.Shared.UserInterface
{
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class ActivatableUIComponent : Component
{
[DataField(required: true, customTypeSerializer: typeof(EnumSerializer))]
public Enum? Key;
/// <summary>
/// Whether the item must be held in one of the user's hands to work.
/// This is ignored unless <see cref="RequireHands"/> is true.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField]
public bool InHandsOnly;
[DataField]
public bool SingleUser;
[ViewVariables(VVAccess.ReadWrite)]
[DataField]
public bool AdminOnly;
[DataField]
public LocId VerbText = "ui-verb-toggle-open";
/// <summary>
/// Whether you need a hand to operate this UI. The hand does not need to be free, you just need to have one.
/// </summary>
/// <remarks>
/// This should probably be true for most machines & computers, but there will still be UIs that represent a
/// more generic interaction / configuration that might not require hands.
/// </remarks>
[ViewVariables(VVAccess.ReadWrite)]
[DataField]
public bool RequireHands = true;
/// <summary>
/// Entities that are required to open this UI.
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public EntityWhitelist? RequiredItems;
/// <summary>
/// Whitelist for the user who is trying to open this UI.
/// </summary>
[DataField]
public EntityWhitelist? UserWhitelist;
/// <summary>
/// If true, then this UI can only be opened via verbs. I.e., normal interactions/activations will not open
/// the UI.
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public bool VerbOnly;
/// <summary>
/// Whether spectators (non-admin ghosts) should be allowed to view this UI.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField]
public bool BlockSpectators;
/// <summary>
/// Whether the item must be in the user's currently selected/active hand.
/// This is ignored unless <see cref="InHandsOnly"/> is true.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField]
public bool RequireActiveHand = true;
/// <summary>
/// The client channel currently using the object, or null if there's none/not single user.
/// NOTE: DO NOT DIRECTLY SET, USE ActivatableUISystem.SetCurrentSingleUser
/// </summary>
[DataField, AutoNetworkedField]
public EntityUid? CurrentSingleUser;
}
}