Add anchorable flags (#25667)
Added it to cargo pallet and the ATS puter. Small steps. Also moved the log until the anchoring is actually confirmed to prevent dummy logs.
This commit is contained in:
@@ -1,16 +1,21 @@
|
||||
using Content.Shared.Construction.EntitySystems;
|
||||
using Content.Shared.Tools;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
|
||||
namespace Content.Shared.Construction.Components
|
||||
{
|
||||
[RegisterComponent, Access(typeof(AnchorableSystem))]
|
||||
[RegisterComponent, Access(typeof(AnchorableSystem)), NetworkedComponent, AutoGenerateComponentState]
|
||||
public sealed partial class AnchorableComponent : Component
|
||||
{
|
||||
[DataField("tool", customTypeSerializer: typeof(PrototypeIdSerializer<ToolQualityPrototype>))]
|
||||
public string Tool { get; private set; } = "Anchoring";
|
||||
[DataField]
|
||||
public ProtoId<ToolQualityPrototype> Tool { get; private set; } = "Anchoring";
|
||||
|
||||
[DataField("snap")]
|
||||
[DataField, AutoNetworkedField]
|
||||
public AnchorableFlags Flags = AnchorableFlags.Anchorable | AnchorableFlags.Unanchorable;
|
||||
|
||||
[DataField]
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public bool Snap { get; private set; } = true;
|
||||
|
||||
@@ -18,10 +23,18 @@ namespace Content.Shared.Construction.Components
|
||||
/// Base delay to use for anchoring.
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField("delay")]
|
||||
[DataField]
|
||||
public float Delay = 1f;
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum AnchorableFlags : byte
|
||||
{
|
||||
None = 0,
|
||||
Anchorable = 1 << 0,
|
||||
Unanchorable = 1 << 1,
|
||||
}
|
||||
|
||||
public abstract class BaseAnchoredAttemptEvent : CancellableEntityEventArgs
|
||||
{
|
||||
public EntityUid User { get; }
|
||||
|
||||
Reference in New Issue
Block a user