* Fix paper system late localization * IS THIS WHAT YOU WANT * well I guess this is happening now * fix the BUI * did that even do anything before? * again with the escapeformatting... * Dirtying * Move dirty to function * Rename PaperSystem to PaperVisualizerSystem * Fix namespace * how many namespace changes must I suffer through * SetContent is for Setting Content * minor shuffling * review --------- Co-authored-by: plykiya <plykiya@protonmail.com> Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
88 lines
2.2 KiB
C#
88 lines
2.2 KiB
C#
using Robust.Shared.Audio;
|
|
using Robust.Shared.GameStates;
|
|
using Robust.Shared.Serialization;
|
|
|
|
namespace Content.Shared.Paper;
|
|
|
|
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
|
public sealed partial class PaperComponent : Component
|
|
{
|
|
public PaperAction Mode;
|
|
[DataField("content"), AutoNetworkedField]
|
|
public string Content { get; set; } = "";
|
|
|
|
[DataField("contentSize")]
|
|
public int ContentSize { get; set; } = 6000;
|
|
|
|
[DataField("stampedBy"), AutoNetworkedField]
|
|
public List<StampDisplayInfo> StampedBy { get; set; } = new();
|
|
|
|
/// <summary>
|
|
/// Stamp to be displayed on the paper, state from bureaucracy.rsi
|
|
/// </summary>
|
|
[DataField("stampState"), AutoNetworkedField]
|
|
public string? StampState { get; set; }
|
|
|
|
[DataField, AutoNetworkedField]
|
|
public bool EditingDisabled;
|
|
|
|
/// <summary>
|
|
/// Sound played after writing to the paper.
|
|
/// </summary>
|
|
[DataField("sound")]
|
|
public SoundSpecifier? Sound { get; private set; } = new SoundCollectionSpecifier("PaperScribbles", AudioParams.Default.WithVariation(0.1f));
|
|
|
|
[Serializable, NetSerializable]
|
|
public sealed class PaperBoundUserInterfaceState : BoundUserInterfaceState
|
|
{
|
|
public readonly string Text;
|
|
public readonly List<StampDisplayInfo> StampedBy;
|
|
public readonly PaperAction Mode;
|
|
|
|
public PaperBoundUserInterfaceState(string text, List<StampDisplayInfo> stampedBy, PaperAction mode = PaperAction.Read)
|
|
{
|
|
Text = text;
|
|
StampedBy = stampedBy;
|
|
Mode = mode;
|
|
}
|
|
}
|
|
|
|
[Serializable, NetSerializable]
|
|
public sealed class PaperInputTextMessage : BoundUserInterfaceMessage
|
|
{
|
|
public readonly string Text;
|
|
|
|
public PaperInputTextMessage(string text)
|
|
{
|
|
Text = text;
|
|
}
|
|
}
|
|
|
|
[Serializable, NetSerializable]
|
|
public enum PaperUiKey
|
|
{
|
|
Key
|
|
}
|
|
|
|
[Serializable, NetSerializable]
|
|
public enum PaperAction
|
|
{
|
|
Read,
|
|
Write,
|
|
}
|
|
|
|
[Serializable, NetSerializable]
|
|
public enum PaperVisuals : byte
|
|
{
|
|
Status,
|
|
Stamp
|
|
}
|
|
|
|
[Serializable, NetSerializable]
|
|
public enum PaperStatus : byte
|
|
{
|
|
Blank,
|
|
Written
|
|
}
|
|
}
|