Add arguments to part and mechanism event methods (#2293)

This commit is contained in:
DrSmugleaf
2020-10-19 15:23:59 +02:00
committed by GitHub
parent 19d32eb4ce
commit 7ad46ddabf
9 changed files with 175 additions and 146 deletions

View File

@@ -1,7 +1,5 @@
#nullable enable
using Content.Shared.GameObjects.Components.Body.Mechanism;
using Content.Shared.GameObjects.Components.Body.Part;
using Robust.Client.Interfaces.GameObjects.Components;
using Robust.Shared.GameObjects;
namespace Content.Client.GameObjects.Components.Body.Mechanism
@@ -9,26 +7,5 @@ namespace Content.Client.GameObjects.Components.Body.Mechanism
[RegisterComponent]
[ComponentReference(typeof(SharedMechanismComponent))]
[ComponentReference(typeof(IMechanism))]
public class MechanismComponent : SharedMechanismComponent
{
protected override void OnAddedToPart()
{
base.OnAddedToPart();
if (Owner.TryGetComponent(out ISpriteComponent? sprite))
{
sprite.Visible = false;
}
}
protected override void OnRemovedFromPart(IBodyPart old)
{
base.OnRemovedFromPart(old);
if (Owner.TryGetComponent(out ISpriteComponent? sprite))
{
sprite.Visible = true;
}
}
}
public class MechanismComponent : SharedMechanismComponent { }
}