Minor paper ECS and stamps (#7394)
Co-authored-by: fishfish458 <fishfish458>
This commit is contained in:
@@ -39,7 +39,7 @@ namespace Content.Client.Paper.UI
|
||||
{
|
||||
if (!string.IsNullOrEmpty(obj.Text))
|
||||
{
|
||||
SendMessage(new PaperInputText(obj.Text));
|
||||
SendMessage(new PaperInputTextMessage(obj.Text));
|
||||
|
||||
if (_window != null)
|
||||
{
|
||||
|
||||
29
Content.Client/Paper/UI/PaperSystem.cs
Normal file
29
Content.Client/Paper/UI/PaperSystem.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using Robust.Client.GameObjects;
|
||||
|
||||
using static Content.Shared.Paper.SharedPaperComponent;
|
||||
|
||||
namespace Content.Client.Paper;
|
||||
|
||||
public sealed class PaperSystem : VisualizerSystem<PaperVisualsComponent>
|
||||
{
|
||||
protected override void OnAppearanceChange(EntityUid uid, PaperVisualsComponent component, ref AppearanceChangeEvent args)
|
||||
{
|
||||
if (!TryComp(uid, out SpriteComponent? sprite))
|
||||
return;
|
||||
|
||||
if (args.Component.TryGetData(PaperVisuals.Status , out PaperStatus writingStatus))
|
||||
sprite.LayerSetVisible(PaperVisualLayers.Writing, writingStatus == PaperStatus.Written);
|
||||
|
||||
if (args.Component.TryGetData(PaperVisuals.Stamp, out string stampState))
|
||||
{
|
||||
sprite.LayerSetState(PaperVisualLayers.Stamp, stampState);
|
||||
sprite.LayerSetVisible(PaperVisualLayers.Stamp, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public enum PaperVisualLayers
|
||||
{
|
||||
Stamp,
|
||||
Writing
|
||||
}
|
||||
6
Content.Client/Paper/UI/PaperVisualsComponent.cs
Normal file
6
Content.Client/Paper/UI/PaperVisualsComponent.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace Content.Client.Paper;
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed class PaperVisualsComponent : Component
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user