2023-02-03 11:59:17 -08:00
using Robust.Client.Animations ;
2023-07-08 14:08:32 +10:00
using Robust.Client.Graphics ;
2023-10-26 22:52:11 -04:00
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom ;
2023-02-03 11:59:17 -08:00
namespace Content.Client.Chemistry.Visualizers ;
/// <summary>
/// A component that makes foam play an animation when it dissolves.
/// </summary>
[RegisterComponent]
[Access(typeof(FoamVisualizerSystem))]
2023-08-22 18:14:33 -07:00
public sealed partial class FoamVisualsComponent : Component
2023-02-03 11:59:17 -08:00
{
/// <summary>
/// The id of the animation used when the foam dissolves.
/// </summary>
public const string AnimationKey = "foamdissolve_animation" ;
2023-10-26 22:52:11 -04:00
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
public TimeSpan StartTime ;
2023-02-03 11:59:17 -08:00
/// <summary>
/// How long the foam visually dissolves for.
/// </summary>
2023-10-26 22:52:11 -04:00
[DataField]
public float AnimationTime = 0.5f ;
2023-02-03 11:59:17 -08:00
/// <summary>
/// The state of the entities base sprite RSI that is displayed when the foam dissolves.
2023-07-08 14:08:32 +10:00
/// Cannot use <see cref="RSI.StateKey"/> because it does not have <see cref="DataDefinitionAttribute"/> and I am not making an engine PR at this time.
2023-02-03 11:59:17 -08:00
/// </summary>
2023-10-26 22:52:11 -04:00
[DataField]
public string AnimationState = "foam-dissolve" ;
2023-02-03 11:59:17 -08:00
/// <summary>
/// The animation used while the foam dissolves.
/// Generated by <see cref="FoamVisualizerSystem.OnComponentInit"/>.
/// </summary>
[ViewVariables(VVAccess.ReadOnly)]
public Animation Animation = default ! ;
}