main cult
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
using Content.Shared.White.Cult.Items;
|
||||
using Robust.Client.GameObjects;
|
||||
|
||||
namespace Content.Client._White.Cult.Items.VoidTorch;
|
||||
|
||||
public sealed class VoidTorchVisualizerSystem : VisualizerSystem<VoidTorchVisualsComponent>
|
||||
{
|
||||
protected override void OnAppearanceChange(EntityUid uid, VoidTorchVisualsComponent component, ref AppearanceChangeEvent args)
|
||||
{
|
||||
base.OnAppearanceChange(uid, component, ref args);
|
||||
|
||||
if (args.Sprite == null
|
||||
|| !AppearanceSystem.TryGetData<bool>(uid, VoidTorchVisuals.Activated, out var activated))
|
||||
return;
|
||||
|
||||
args.Sprite.LayerSetState(VoidTorchVisualsLayers.Activated, activated ? component.StateOn : component.StateOff);
|
||||
}
|
||||
}
|
||||
|
||||
public enum VoidTorchVisualsLayers : byte
|
||||
{
|
||||
Activated
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
namespace Content.Client._White.Cult.Items.VoidTorch;
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed partial class VoidTorchVisualsComponent : Component
|
||||
{
|
||||
[DataField("stateOn")]
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public string? StateOn = "icon-on";
|
||||
|
||||
[DataField("stateOff")]
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public string? StateOff = "icon";
|
||||
}
|
||||
Reference in New Issue
Block a user