Revs (the spooky ones) (#9842)

This commit is contained in:
Nemanja
2022-08-13 09:49:41 -04:00
committed by GitHub
parent ab4e2ef74f
commit 3e1cf73469
68 changed files with 1976 additions and 34 deletions

View File

@@ -19,7 +19,7 @@ namespace Content.Client.Ghost
// No good way to get an event into the UI.
public int AvailableGhostRoleCount { get; private set; } = 0;
private bool _ghostVisibility;
private bool _ghostVisibility = true;
private bool GhostVisibility
{
@@ -33,12 +33,9 @@ namespace Content.Client.Ghost
_ghostVisibility = value;
foreach (var ghost in EntityManager.GetAllComponents(typeof(GhostComponent), true))
foreach (var ghost in EntityQuery<GhostComponent, SpriteComponent>(true))
{
if (EntityManager.TryGetComponent(ghost.Owner, out SpriteComponent? sprite))
{
sprite.Visible = value;
}
ghost.Item2.Visible = true;
}
}
}
@@ -69,12 +66,6 @@ namespace Content.Client.Ghost
{
component.Gui?.Dispose();
component.Gui = null;
// PlayerDetachedMsg might not fire due to deletion order so...
if (component.IsAttached)
{
GhostVisibility = false;
}
}
private void OnGhostPlayerAttach(EntityUid uid, GhostComponent component, PlayerAttachedEvent playerAttachedEvent)