Remove string appearance keys (#10114)

This commit is contained in:
Leon Friedrich
2022-08-08 13:44:16 +12:00
committed by GitHub
parent 1783dd82e7
commit 193b9f467d
14 changed files with 56 additions and 54 deletions

View File

@@ -249,4 +249,10 @@ namespace Content.Shared.Atmos.Monitor
Pressure,
Gas
}
public enum AtmosMonitorVisuals : byte
{
Offset,
AlarmType,
}
}

View File

@@ -96,6 +96,7 @@ namespace Content.Shared.Buckle.Components
public enum StrapVisuals : byte
{
RotationAngle,
BuckledState
BuckledState,
State
}
}

View File

@@ -7,8 +7,6 @@ namespace Content.Shared.Foldable;
[UsedImplicitly]
public abstract class SharedFoldableSystem : EntitySystem
{
private const string FoldKey = "FoldedState";
public override void Initialize()
{
base.Initialize();
@@ -50,7 +48,7 @@ public abstract class SharedFoldableSystem : EntitySystem
Dirty(component);
if (TryComp(component.Owner, out AppearanceComponent? appearance))
appearance.SetData(FoldKey, folded);
appearance.SetData(FoldedVisuals.State, folded);
}
private void OnInsertEvent(EntityUid uid, FoldableComponent component, ContainerGettingInsertedAttemptEvent args)
@@ -58,4 +56,9 @@ public abstract class SharedFoldableSystem : EntitySystem
if (!component.IsFolded)
args.Cancel();
}
public enum FoldedVisuals : byte
{
State
}
}

View File

@@ -49,8 +49,8 @@ namespace Content.Shared.SubFloor
/// Sprite layer keys for the layers that are always visible, even if the entity is below a floor tile. E.g.,
/// the vent part of a vent is always visible, even though the piping is hidden.
/// </summary>
[DataField("visibleLayers", customTypeSerializer:typeof(CustomHashSetSerializer<object, AppearanceKeySerializer>))]
public HashSet<object> VisibleLayers = new() { SubfloorLayers.FirstLayer };
[DataField("visibleLayers")]
public HashSet<Enum> VisibleLayers = new() { SubfloorLayers.FirstLayer };
/// <summary>
/// The entities this subfloor is revealed by.

View File

@@ -4,8 +4,23 @@ namespace Content.Shared.Toggleable;
// Appearance Data key
[Serializable, NetSerializable]
public enum ToggleableLightVisuals
public enum ToggleableLightVisuals : byte
{
Enabled,
Color
}
/// <summary>
/// Generic sprite layer keys.
/// </summary>
[Serializable, NetSerializable]
public enum LightLayers : byte
{
Light,
/// <summary>
/// Used as a key for generic unshaded layers. Not necessarily related to an entity with an actual light source.
/// Use this instead of creating a unique single-purpose "unshaded" enum for every visualizer.
/// </summary>
Unshaded,
}