Airlock visuals (#7261)
This commit is contained in:
32
Content.Shared/AirlockPainter/AirlockPainterEvents.cs
Normal file
32
Content.Shared/AirlockPainter/AirlockPainterEvents.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.AirlockPainter
|
||||
{
|
||||
[Serializable, NetSerializable]
|
||||
public enum AirlockPainterUiKey
|
||||
{
|
||||
Key,
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class AirlockPainterSpritePickedMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public int Index { get; }
|
||||
|
||||
public AirlockPainterSpritePickedMessage(int index)
|
||||
{
|
||||
Index = index;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class AirlockPainterBoundUserInterfaceState : BoundUserInterfaceState
|
||||
{
|
||||
public int SelectedStyle { get; }
|
||||
|
||||
public AirlockPainterBoundUserInterfaceState(int selectedStyle)
|
||||
{
|
||||
SelectedStyle = selectedStyle;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using Content.Shared.AirlockPainter.Prototypes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
|
||||
namespace Content.Server.AirlockPainter
|
||||
{
|
||||
[RegisterComponent]
|
||||
public sealed class PaintableAirlockComponent : Component
|
||||
{
|
||||
[DataField("group", customTypeSerializer:typeof(PrototypeIdSerializer<AirlockGroupPrototype>))]
|
||||
public string Group = default!;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared.AirlockPainter.Prototypes
|
||||
{
|
||||
[Prototype("AirlockGroup")]
|
||||
public sealed class AirlockGroupPrototype : IPrototype
|
||||
{
|
||||
[IdDataField]
|
||||
public string ID { get; } = default!;
|
||||
|
||||
[DataField("stylePaths")]
|
||||
public Dictionary<string, string> StylePaths = default!;
|
||||
|
||||
// The priority determines, which sprite is used when showing
|
||||
// the icon for a style in the airlock painter UI. The highest priority
|
||||
// gets shown.
|
||||
[DataField("iconPriority")]
|
||||
public int IconPriority = 0;
|
||||
}
|
||||
}
|
||||
30
Content.Shared/AirlockPainter/SharedAirlockPainterSystem.cs
Normal file
30
Content.Shared/AirlockPainter/SharedAirlockPainterSystem.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System.Linq;
|
||||
using Content.Shared.AirlockPainter.Prototypes;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared.AirlockPainter
|
||||
{
|
||||
public abstract class SharedAirlockPainterSystem : EntitySystem
|
||||
{
|
||||
[Dependency] protected readonly IPrototypeManager _prototypeManager = default!;
|
||||
|
||||
public List<string> Styles { get; private set; } = new();
|
||||
public List<AirlockGroupPrototype> Groups { get; private set; } = new();
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
HashSet<string> styles = new();
|
||||
foreach (AirlockGroupPrototype grp in _prototypeManager.EnumeratePrototypes<AirlockGroupPrototype>())
|
||||
{
|
||||
Groups.Add(grp);
|
||||
foreach (string style in grp.StylePaths.Keys)
|
||||
{
|
||||
styles.Add(style);
|
||||
}
|
||||
}
|
||||
Styles = styles.ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -249,6 +249,7 @@ public enum DoorVisuals
|
||||
Powered,
|
||||
BoltLights,
|
||||
EmergencyLights,
|
||||
BaseRSI,
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
|
||||
Reference in New Issue
Block a user