Files
OldThink/Content.Shared/Light/Component/RgbLightControllerComponent.cs

48 lines
1.4 KiB
C#
Raw Normal View History

2022-01-19 11:18:16 +13:00
using Robust.Shared.Analyzers;
2021-11-30 08:54:51 -06:00
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
2022-01-19 11:18:16 +13:00
using Robust.Shared.Maths;
using Robust.Shared.Serialization;
2021-11-30 08:54:51 -06:00
using Robust.Shared.Serialization.Manager.Attributes;
2022-01-19 11:18:16 +13:00
using System;
using System.Collections.Generic;
2021-11-30 08:54:51 -06:00
2022-01-19 11:18:16 +13:00
namespace Content.Shared.Light.Component;
/// <summary>
/// Networked ~~solely for admemes~~ for completely legitimate reasons, like hacked energy swords.
/// </summary>
[NetworkedComponent]
[RegisterComponent]
[Friend(typeof(SharedRgbLightControllerSystem))]
public sealed class RgbLightControllerComponent : Robust.Shared.GameObjects.Component
2021-11-30 08:54:51 -06:00
{
2022-01-19 11:18:16 +13:00
[DataField("cycleRate")]
public float CycleRate { get; set; } = 0.1f;
2021-11-30 08:54:51 -06:00
/// <summary>
2022-01-19 11:18:16 +13:00
/// What layers of the sprite to modulate? If null, will affect the whole sprite.
2021-11-30 08:54:51 -06:00
/// </summary>
2022-01-19 11:18:16 +13:00
[DataField("layers")]
public List<int>? Layers;
// original colors when rgb was added. Used to revert Colors when removed.
public Color OriginalLightColor;
public Color OriginalItemColor;
public Color OriginalSpriteColor;
public Dictionary<int, Color>? OriginalLayerColors;
}
[Serializable, NetSerializable]
public sealed class RgbLightControllerState : ComponentState
2022-01-19 11:18:16 +13:00
{
public readonly float CycleRate;
public readonly List<int>? Layers;
2021-11-30 08:54:51 -06:00
2022-01-19 11:18:16 +13:00
public RgbLightControllerState(float cycleRate, List<int>? layers)
{
CycleRate = cycleRate;
Layers = layers;
2021-11-30 08:54:51 -06:00
}
}