2021-06-09 22:19:39 +02:00
|
|
|
using Content.Shared.Stacks;
|
2021-05-26 10:20:57 +02:00
|
|
|
using JetBrains.Annotations;
|
|
|
|
|
using Robust.Shared.GameObjects;
|
|
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Client.Stack
|
2021-05-26 10:20:57 +02:00
|
|
|
{
|
|
|
|
|
[UsedImplicitly]
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class StackSystem : SharedStackSystem
|
2021-05-26 10:20:57 +02:00
|
|
|
{
|
|
|
|
|
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.
|
2021-08-30 11:49:09 +02:00
|
|
|
component.UiUpdateNeeded = true;
|
2021-05-26 10:20:57 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|