Paper Visualizer (#4811)

This commit is contained in:
20kdc
2021-10-09 14:48:53 +01:00
committed by GitHub
parent 090692560b
commit 4f5cbb63de
3 changed files with 28 additions and 2 deletions

View File

@@ -72,9 +72,9 @@ namespace Content.Server.Paper
Content += msg.Text + '\n'; Content += msg.Text + '\n';
if (Owner.TryGetComponent(out SpriteComponent? sprite)) if (Owner.TryGetComponent(out AppearanceComponent? appearance))
{ {
sprite.LayerSetState(0, "paper_words"); appearance.SetData(PaperVisuals.Status, PaperStatus.Written);
} }
Owner.Description = ""; Owner.Description = "";

View File

@@ -57,5 +57,18 @@ namespace Content.Shared.Paper
Stamp Stamp
} }
[Serializable, NetSerializable]
public enum PaperVisuals : byte
{
Status
}
[Serializable, NetSerializable]
public enum PaperStatus : byte
{
Blank,
Written
}
} }
} }

View File

@@ -6,6 +6,7 @@
components: components:
- type: Sprite - type: Sprite
sprite: Objects/Misc/bureaucracy.rsi sprite: Objects/Misc/bureaucracy.rsi
netsync: false
layers: layers:
- state: paper - state: paper
- type: Paper - type: Paper
@@ -13,14 +14,26 @@
interfaces: interfaces:
- key: enum.PaperUiKey.Key - key: enum.PaperUiKey.Key
type: PaperBoundUserInterface type: PaperBoundUserInterface
- type: Appearance
visuals:
- type: GenericEnumVisualizer
key: enum.PaperVisuals.Status
layer: 0
states:
# This default isn't actually explicitly used right now.
enum.PaperStatus.Blank: paper
enum.PaperStatus.Written: paper_words
- type: entity - type: entity
parent: Paper parent: Paper
id: PaperWritten id: PaperWritten
abstract: true abstract: true
components: components:
- type: Paper
- type: Sprite - type: Sprite
layers: layers:
# Changing it here is fine - if the PaperStatus key is actually added,
# something happened, so that ought to override this either way.
- state: paper_words - state: paper_words
- type: entity - type: entity