Make energy swords use RgbLightController (#7344)

This commit is contained in:
Leon Friedrich
2022-04-16 17:11:48 +12:00
committed by GitHub
parent 1dcaa2d44b
commit a231429cb4
35 changed files with 240 additions and 583 deletions

View File

@@ -0,0 +1,33 @@
using Content.Shared.Hands.Components;
using static Robust.Shared.GameObjects.SharedSpriteComponent;
namespace Content.Client.Toggleable;
/// <summary>
/// Component that handles the toggling the visuals of some light emitting entity.
/// </summary>
/// <remarks>
/// This will toggle the visibility of layers on an entity's sprite, the in-hand visuals, and the clothing/equipment
/// visuals. This will modify the color of any attached point lights.
/// </remarks>
[RegisterComponent]
public sealed class ToggleableLightVisualsComponent : Component
{
/// <summary>
/// Sprite layer that will have it's visibility toggled when this item is toggled.
/// </summary>
[DataField("spriteLayer")]
public string SpriteLayer = "light";
/// <summary>
/// Layers to add to the sprite of the player that is holding this entity (while the component is toggled on).
/// </summary>
[DataField("inhandVisuals")]
public Dictionary<HandLocation, List<PrototypeLayerData>> InhandVisuals = new();
/// <summary>
/// Layers to add to the sprite of the player that is wearing this entity (while the component is toggled on).
/// </summary>
[DataField("clothingVisuals")]
public readonly Dictionary<string, List<PrototypeLayerData>> ClothingVisuals = new();
}