2021-08-02 13:53:33 +02:00
|
|
|
using Robust.Shared.GameStates;
|
2022-07-09 21:59:39 +12:00
|
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
|
|
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Generic;
|
2019-04-04 15:09:06 +02:00
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Shared.SubFloor
|
2019-04-04 15:09:06 +02:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
2019-09-19 11:43:46 -07:00
|
|
|
/// Simple component that automatically hides the sibling
|
2022-02-14 16:20:35 +13:00
|
|
|
/// <see cref="SpriteComponent" /> when the tile it's on is not a sub floor
|
2019-09-19 11:43:46 -07:00
|
|
|
/// (plating).
|
2019-04-04 15:09:06 +02:00
|
|
|
/// </summary>
|
2019-09-19 11:43:46 -07:00
|
|
|
/// <seealso cref="P:Content.Shared.Maps.ContentTileDefinition.IsSubFloor" />
|
2021-08-02 13:53:33 +02:00
|
|
|
[NetworkedComponent]
|
2019-07-31 15:02:36 +02:00
|
|
|
[RegisterComponent]
|
2022-06-07 15:26:28 +02:00
|
|
|
[Access(typeof(SharedSubFloorHideSystem))]
|
2023-08-22 18:14:33 -07:00
|
|
|
public sealed partial class SubFloorHideComponent : Component
|
2019-04-04 15:09:06 +02:00
|
|
|
{
|
2022-02-12 12:00:33 +13:00
|
|
|
/// <summary>
|
|
|
|
|
/// Whether the entity's current position has a "Floor-type" tile above its current position.
|
|
|
|
|
/// </summary>
|
2022-02-14 16:20:35 +13:00
|
|
|
[ViewVariables]
|
2022-02-12 12:00:33 +13:00
|
|
|
public bool IsUnderCover { get; set; } = false;
|
|
|
|
|
|
2022-02-16 15:34:31 +13:00
|
|
|
/// <summary>
|
|
|
|
|
/// Whether interactions with this entity should be blocked while it is under floor tiles.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <remarks>
|
2022-02-18 15:01:15 +13:00
|
|
|
/// Useful for entities like vents, which are only partially hidden. Anchor attempts will still be blocked.
|
2022-02-16 15:34:31 +13:00
|
|
|
/// </remarks>
|
|
|
|
|
[DataField("blockInteractions")]
|
|
|
|
|
public bool BlockInteractions { get; set; } = true;
|
|
|
|
|
|
2022-03-12 16:20:31 -06:00
|
|
|
/// <summary>
|
|
|
|
|
/// Whether this entity's ambience should be disabled when underneath the floor.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// Useful for cables and piping, gives maint it's distinct noise.
|
|
|
|
|
/// </remarks>
|
|
|
|
|
[DataField("blockAmbience")]
|
|
|
|
|
public bool BlockAmbience { get; set; } = true;
|
|
|
|
|
|
2022-07-09 21:59:39 +12:00
|
|
|
/// <summary>
|
|
|
|
|
/// Sprite layer keys for the layers that are always visible, even if the entity is below a floor tile. E.g.,
|
|
|
|
|
/// the vent part of a vent is always visible, even though the piping is hidden.
|
|
|
|
|
/// </summary>
|
2022-08-08 13:44:16 +12:00
|
|
|
[DataField("visibleLayers")]
|
|
|
|
|
public HashSet<Enum> VisibleLayers = new() { SubfloorLayers.FirstLayer };
|
2024-02-16 18:37:56 -05:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// This is used for storing the original draw depth of a t-ray revealed entity.
|
|
|
|
|
/// e.g. when a t-ray revealed cable is drawn above a carpet.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField]
|
|
|
|
|
public int? OriginalDrawDepth;
|
2021-08-02 13:53:33 +02:00
|
|
|
}
|
2019-04-04 15:09:06 +02:00
|
|
|
}
|