using Content.Client.Chat.Managers; using Content.Shared.Sunrise.CollectiveMind; using Robust.Client.Player; namespace Content.Client.Chat { public sealed class CollectiveMindChatUpdateSystem : EntitySystem { [Dependency] private readonly IChatManager _chatManager = default!; [Dependency] private readonly IPlayerManager _playerManager = default!; public override void Initialize() { base.Initialize(); SubscribeLocalEvent(OnInit); SubscribeLocalEvent(OnRemove); } public CollectiveMindComponent? Player => CompOrNull(_playerManager.LocalSession?.AttachedEntity); public bool IsCollectiveMind => Player != null; private void OnInit(EntityUid uid, CollectiveMindComponent component, ComponentInit args) { _chatManager.UpdatePermissions(); } private void OnRemove(EntityUid uid, CollectiveMindComponent component, ComponentRemove args) { _chatManager.UpdatePermissions(); } } }