Files
tbd-station-14/Content.Client/Kitchen/Visualizers/ReagentGrinderVisualizer.cs
0x6273 dfdad0ffe5 Refactor ReagentGrinder (#11751)
* Refactor ReagentGrinder

- It can now process partial stacks. (Before it would do nothing if the entire stack's solution didn't fit in the output container)
- Get rid of `SharedReagentGrinderComponent`, move shared stuff to `SharedReagentGrinder.cs`.
- Subscribe to events instead of massive switch/case.
- Get rid of update queue thing.
- Change `DoWork` so it's less duplicate code for grinding/juicing.
- Get rid of `ExtractableScalingEvent` and just scale directly based on item stack count.
- Add message for when you try to put something into the reagent grinder that doesn't fit.
- Fix obsolescence warnings.

* Use a timer on component instead of SpawnTimer

* s/StorageCap/StorageMaxEntities
2022-10-25 23:34:56 -07:00

18 lines
681 B
C#

using Robust.Client.GameObjects;
using Content.Shared.Kitchen;
namespace Content.Client.Kitchen.Visualizers
{
public sealed class ReagentGrinderVisualizer : AppearanceVisualizer
{
[Obsolete("Subscribe to AppearanceChangeEvent instead.")]
public override void OnChangeData(AppearanceComponent component)
{
base.OnChangeData(component);
var sprite = IoCManager.Resolve<IEntityManager>().GetComponent<ISpriteComponent>(component.Owner);
component.TryGetData(ReagentGrinderVisualState.BeakerAttached, out bool hasBeaker);
sprite.LayerSetState(0, $"juicer{(hasBeaker ? "1" : "0")}");
}
}
}