From 0b8b107175d77e10c884f8c1d7c7d6ecc5cdca8b Mon Sep 17 00:00:00 2001 From: Chief-Engineer <119664036+Chief-Engineer@users.noreply.github.com> Date: Tue, 27 Jun 2023 04:51:01 -0500 Subject: [PATCH] add ability to edit ghost colors (#17662) --- Content.Client/Ghost/GhostSystem.cs | 3 +++ Content.Shared/Ghost/SharedGhostComponent.cs | 8 ++++++++ Resources/Prototypes/Entities/Mobs/Player/observer.yml | 1 + 3 files changed, 12 insertions(+) diff --git a/Content.Client/Ghost/GhostSystem.cs b/Content.Client/Ghost/GhostSystem.cs index 22f480dc12..5f8f9688d0 100644 --- a/Content.Client/Ghost/GhostSystem.cs +++ b/Content.Client/Ghost/GhostSystem.cs @@ -148,6 +148,9 @@ namespace Content.Client.Ghost private void OnGhostState(EntityUid uid, GhostComponent component, ref ComponentHandleState args) { + if (TryComp(uid, out var sprite)) + sprite.LayerSetColor(0, component.color); + if (uid != _playerManager.LocalPlayer?.ControlledEntity) return; diff --git a/Content.Shared/Ghost/SharedGhostComponent.cs b/Content.Shared/Ghost/SharedGhostComponent.cs index 07ae1ff81b..ef8221b423 100644 --- a/Content.Shared/Ghost/SharedGhostComponent.cs +++ b/Content.Shared/Ghost/SharedGhostComponent.cs @@ -39,6 +39,14 @@ namespace Content.Shared.Ghost } } + /// + /// Ghost color + /// + /// Used to allow admins to change ghost colors. Should be removed if the capability to edit existing sprite colors is ever added back. + [DataField("color"), AutoNetworkedField] + [ViewVariables(VVAccess.ReadWrite)] + public Color color = Color.White; + [DataField("canReturnToBody"), AutoNetworkedField] private bool _canReturnToBody; } diff --git a/Resources/Prototypes/Entities/Mobs/Player/observer.yml b/Resources/Prototypes/Entities/Mobs/Player/observer.yml index 7dc497f5ab..7bf2ef94ac 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/observer.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/observer.yml @@ -31,6 +31,7 @@ - type: Examiner skipChecks: true - type: Ghost + color: "#fff8" - type: IntrinsicRadioReceiver - type: ActiveRadio channels: