Resolves PowerChargerVisualizer is Obsolete (#13901)

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
TemporalOroboros
2023-04-28 21:34:48 -07:00
committed by GitHub
parent cf528ea0e7
commit 73980ad095
4 changed files with 87 additions and 81 deletions

View File

@@ -0,0 +1,39 @@
using Content.Shared.Power;
namespace Content.Client.PowerCell;
[RegisterComponent]
[Access(typeof(PowerChargerVisualizerSystem))]
public sealed class PowerChargerVisualsComponent : Component
{
/// <summary>
/// The base sprite state used if the power cell charger does not contain a power cell.
/// </summary>
[DataField("emptyState")]
[ViewVariables(VVAccess.ReadWrite)]
public string EmptyState = "empty";
/// <summary>
/// The base sprite state used if the power cell charger contains a power cell.
/// </summary>
[DataField("occupiedState")]
[ViewVariables(VVAccess.ReadWrite)]
public string OccupiedState = "full";
/// <summary>
/// A mapping of the indicator light overlays for the power cell charger.
/// <see cref="CellChargerStatus.Off"/> Maps to the state used when the charger is out of power/disabled.
/// <see cref="CellChargerStatus.Empty"/> Maps to the state used when the charger does not contain a power cell.
/// <see cref="CellChargerStatus.Charging"/> Maps to the state used when the charger is charging a power cell.
/// <see cref="CellChargerStatus.Charged"/> Maps to the state used when the charger contains a fully charged power cell.
/// </summary>
[DataField("lightStates")]
[ViewVariables(VVAccess.ReadWrite)]
public readonly Dictionary<CellChargerStatus, string> LightStates = new()
{
[CellChargerStatus.Off] = "light-off",
[CellChargerStatus.Empty] = "light-empty",
[CellChargerStatus.Charging] = "light-charging",
[CellChargerStatus.Charged] = "light-charged",
};
}