Made anchor visuals generic (#33810)
Added a generic anchor visuals enum
This commit is contained in:
@@ -31,6 +31,7 @@ public sealed partial class AnchorableSystem : EntitySystem
|
||||
[Dependency] private readonly SharedToolSystem _tool = default!;
|
||||
[Dependency] private readonly SharedTransformSystem _transformSystem = default!;
|
||||
[Dependency] private readonly TagSystem _tagSystem = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
private EntityQuery<PhysicsComponent> _physicsQuery;
|
||||
|
||||
@@ -47,6 +48,18 @@ public sealed partial class AnchorableSystem : EntitySystem
|
||||
SubscribeLocalEvent<AnchorableComponent, TryAnchorCompletedEvent>(OnAnchorComplete);
|
||||
SubscribeLocalEvent<AnchorableComponent, TryUnanchorCompletedEvent>(OnUnanchorComplete);
|
||||
SubscribeLocalEvent<AnchorableComponent, ExaminedEvent>(OnAnchoredExamine);
|
||||
SubscribeLocalEvent<AnchorableComponent, ComponentStartup>(OnAnchorStartup);
|
||||
SubscribeLocalEvent<AnchorableComponent, AnchorStateChangedEvent>(OnAnchorStateChange);
|
||||
}
|
||||
|
||||
private void OnAnchorStartup(EntityUid uid, AnchorableComponent comp, ComponentStartup args)
|
||||
{
|
||||
_appearance.SetData(uid, AnchorVisuals.Anchored, Transform(uid).Anchored);
|
||||
}
|
||||
|
||||
private void OnAnchorStateChange(EntityUid uid, AnchorableComponent comp, AnchorStateChangedEvent args)
|
||||
{
|
||||
_appearance.SetData(uid, AnchorVisuals.Anchored, args.Anchored);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -343,3 +356,9 @@ public sealed partial class AnchorableSystem : EntitySystem
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum AnchorVisuals : byte
|
||||
{
|
||||
Anchored
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user