add ability to edit ghost colors (#17662)
This commit is contained in:
@@ -148,6 +148,9 @@ namespace Content.Client.Ghost
|
|||||||
|
|
||||||
private void OnGhostState(EntityUid uid, GhostComponent component, ref ComponentHandleState args)
|
private void OnGhostState(EntityUid uid, GhostComponent component, ref ComponentHandleState args)
|
||||||
{
|
{
|
||||||
|
if (TryComp<SpriteComponent>(uid, out var sprite))
|
||||||
|
sprite.LayerSetColor(0, component.color);
|
||||||
|
|
||||||
if (uid != _playerManager.LocalPlayer?.ControlledEntity)
|
if (uid != _playerManager.LocalPlayer?.ControlledEntity)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,14 @@ namespace Content.Shared.Ghost
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Ghost color
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>Used to allow admins to change ghost colors. Should be removed if the capability to edit existing sprite colors is ever added back.</remarks>
|
||||||
|
[DataField("color"), AutoNetworkedField]
|
||||||
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
|
public Color color = Color.White;
|
||||||
|
|
||||||
[DataField("canReturnToBody"), AutoNetworkedField]
|
[DataField("canReturnToBody"), AutoNetworkedField]
|
||||||
private bool _canReturnToBody;
|
private bool _canReturnToBody;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
- type: Examiner
|
- type: Examiner
|
||||||
skipChecks: true
|
skipChecks: true
|
||||||
- type: Ghost
|
- type: Ghost
|
||||||
|
color: "#fff8"
|
||||||
- type: IntrinsicRadioReceiver
|
- type: IntrinsicRadioReceiver
|
||||||
- type: ActiveRadio
|
- type: ActiveRadio
|
||||||
channels:
|
channels:
|
||||||
|
|||||||
Reference in New Issue
Block a user