Move PaperSystem to Shared (#30592)
* 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>
This commit is contained in:
29
Content.Client/Paper/UI/PaperVisualizerSystem.cs
Normal file
29
Content.Client/Paper/UI/PaperVisualizerSystem.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using Robust.Client.GameObjects;
|
||||
|
||||
using static Content.Shared.Paper.PaperComponent;
|
||||
|
||||
namespace Content.Client.Paper.UI;
|
||||
|
||||
public sealed class PaperVisualizerSystem : VisualizerSystem<PaperVisualsComponent>
|
||||
{
|
||||
protected override void OnAppearanceChange(EntityUid uid, PaperVisualsComponent component, ref AppearanceChangeEvent args)
|
||||
{
|
||||
if (args.Sprite == null)
|
||||
return;
|
||||
|
||||
if (AppearanceSystem.TryGetData<PaperStatus>(uid, PaperVisuals.Status , out var writingStatus, args.Component))
|
||||
args.Sprite.LayerSetVisible(PaperVisualLayers.Writing, writingStatus == PaperStatus.Written);
|
||||
|
||||
if (AppearanceSystem.TryGetData<string>(uid, PaperVisuals.Stamp, out var stampState, args.Component))
|
||||
{
|
||||
args.Sprite.LayerSetState(PaperVisualLayers.Stamp, stampState);
|
||||
args.Sprite.LayerSetVisible(PaperVisualLayers.Stamp, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public enum PaperVisualLayers
|
||||
{
|
||||
Stamp,
|
||||
Writing
|
||||
}
|
||||
Reference in New Issue
Block a user