Resolves ReagentGrinderVisualizer is Obsolete (#13886)
* Split ReagentGrinderVisualizer into Component/System pair * Update YAML * Generic visualizer * Update YAML * Swap visuals * Removes duplicate
This commit is contained in:
@@ -1,17 +0,0 @@
|
|||||||
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<SpriteComponent>(component.Owner);
|
|
||||||
component.TryGetData(ReagentGrinderVisualState.BeakerAttached, out bool hasBeaker);
|
|
||||||
sprite.LayerSetState(0, $"juicer{(hasBeaker ? "1" : "0")}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -15,8 +15,12 @@
|
|||||||
- key: enum.ReagentGrinderUiKey.Key
|
- key: enum.ReagentGrinderUiKey.Key
|
||||||
type: ReagentGrinderBoundUserInterface
|
type: ReagentGrinderBoundUserInterface
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
|
- type: GenericVisualizer
|
||||||
visuals:
|
visuals:
|
||||||
- type: ReagentGrinderVisualizer
|
enum.ReagentGrinderVisualState.BeakerAttached:
|
||||||
|
grinder:
|
||||||
|
True: {state: "juicer1"}
|
||||||
|
False: {state: "juicer0"}
|
||||||
- type: Physics
|
- type: Physics
|
||||||
- type: Fixtures
|
- type: Fixtures
|
||||||
fixtures:
|
fixtures:
|
||||||
@@ -30,9 +34,11 @@
|
|||||||
- type: Sprite
|
- type: Sprite
|
||||||
netsync: false
|
netsync: false
|
||||||
sprite: Structures/Machines/juicer.rsi
|
sprite: Structures/Machines/juicer.rsi
|
||||||
state: juicer0
|
|
||||||
drawdepth: SmallObjects
|
drawdepth: SmallObjects
|
||||||
snapCardinals: true
|
snapCardinals: true
|
||||||
|
layers:
|
||||||
|
- map: [ "grinder" ]
|
||||||
|
state: "juicer0"
|
||||||
- type: ApcPowerReceiver
|
- type: ApcPowerReceiver
|
||||||
powerLoad: 300
|
powerLoad: 300
|
||||||
- type: UpgradePowerDraw
|
- type: UpgradePowerDraw
|
||||||
|
|||||||
Reference in New Issue
Block a user