diff --git a/Content.Client/StatusIcon/StatusIconSystem.cs b/Content.Client/StatusIcon/StatusIconSystem.cs index 63f57767695..9e78189c653 100644 --- a/Content.Client/StatusIcon/StatusIconSystem.cs +++ b/Content.Client/StatusIcon/StatusIconSystem.cs @@ -4,6 +4,8 @@ using Content.Shared.StatusIcon.Components; using Content.Shared.Stealth.Components; using Content.Shared.Whitelist; +using Content.Shared.Administration.Managers; // Sunrise-Edit +using Content.Shared.Administration; // Sunrise-Edit using Robust.Client.Graphics; using Robust.Client.Player; using Robust.Shared.Configuration; @@ -19,6 +21,7 @@ public sealed class StatusIconSystem : SharedStatusIconSystem [Dependency] private readonly IOverlayManager _overlay = default!; [Dependency] private readonly IPlayerManager _playerManager = default!; [Dependency] private readonly EntityWhitelistSystem _entityWhitelist = default!; + [Dependency] private readonly ISharedAdminManager _adminManager = default!; // Sunrise-Edit private bool _globalEnabled; private bool _localEnabled; @@ -71,13 +74,19 @@ public List GetStatusIcons(EntityUid uid, MetaDataComponent? met public bool IsVisible(Entity ent, StatusIconData data) { var viewer = _playerManager.LocalSession?.AttachedEntity; + // Sunrise-Edit-Start + if (viewer == null) + return false; + // Sunrise-Edit-End // Always show our icons to our entity if (viewer == ent.Owner) return true; - if (data.VisibleToGhosts && HasComp(viewer)) + // Sunrise-Edit-Start + if (data is FactionIconPrototype && HasComp(viewer) && _adminManager.HasAdminFlag(viewer.Value, AdminFlags.Admin)) return true; + // Sunrise-Edit-End if (data.HideInContainer && (ent.Comp.Flags & MetaDataFlags.InContainer) != 0) return false; @@ -88,6 +97,10 @@ public bool IsVisible(Entity ent, StatusIconData data) if (data.ShowTo != null && !_entityWhitelist.IsValid(data.ShowTo, viewer)) return false; + // Sunrise-Edit-Start + if (HasComp(viewer)) + return data.VisibleToGhosts; + // Sunrise-Edit-End return true; } }