Move BarSign appearance logic to client. (#11524)
* git mv * Client-side bar sign appearance * fix yaml
This commit is contained in:
24
Content.Shared/BarSign/BarSignComponent.cs
Normal file
24
Content.Shared/BarSign/BarSignComponent.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
|
||||
namespace Content.Shared.BarSign
|
||||
{
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed class BarSignComponent : Component
|
||||
{
|
||||
[DataField("current", customTypeSerializer:typeof(PrototypeIdSerializer<BarSignPrototype>))]
|
||||
public string? CurrentSign;
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class BarSignComponentState : ComponentState
|
||||
{
|
||||
public string? CurrentSign;
|
||||
|
||||
public BarSignComponentState(string? current)
|
||||
{
|
||||
CurrentSign = current;
|
||||
}
|
||||
}
|
||||
}
|
||||
37
Content.Shared/BarSign/BarSignPrototype.cs
Normal file
37
Content.Shared/BarSign/BarSignPrototype.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared.BarSign
|
||||
{
|
||||
[Prototype("barSign")]
|
||||
public sealed class BarSignPrototype : IPrototype
|
||||
{
|
||||
private string _description = string.Empty;
|
||||
private string _name = string.Empty;
|
||||
|
||||
[ViewVariables]
|
||||
[IdDataFieldAttribute]
|
||||
public string ID { get; } = default!;
|
||||
|
||||
|
||||
[DataField("icon")] public string Icon { get; private set; } = string.Empty;
|
||||
|
||||
[DataField("name")]
|
||||
public string Name
|
||||
{
|
||||
get => _name;
|
||||
private set => _name = Loc.GetString(value);
|
||||
}
|
||||
|
||||
[DataField("description")]
|
||||
public string Description
|
||||
{
|
||||
get => _description;
|
||||
private set => _description = Loc.GetString(value);
|
||||
}
|
||||
|
||||
[DataField("renameArea")]
|
||||
public bool RenameArea { get; private set; } = true;
|
||||
[DataField("hidden")]
|
||||
public bool Hidden { get; private set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user