Refactors stacks to be fully ECS. (#4046)
This commit is contained in:
committed by
GitHub
parent
0f8e330a3d
commit
33fa208214
25
Content.Client/GameObjects/EntitySystems/StackSystem.cs
Normal file
25
Content.Client/GameObjects/EntitySystems/StackSystem.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using Content.Client.GameObjects.Components;
|
||||
using Content.Shared.GameObjects.Components;
|
||||
using Content.Shared.GameObjects.EntitySystems;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Client.GameObjects.EntitySystems
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public class StackSystem : SharedStackSystem
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<StackComponent, StackCountChangedEvent>(OnStackCountChanged);
|
||||
}
|
||||
|
||||
private void OnStackCountChanged(EntityUid uid, StackComponent component, StackCountChangedEvent args)
|
||||
{
|
||||
// Dirty the UI now that the stack count has changed.
|
||||
component.DirtyUI();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user