diff --git a/Content.Client/Chat/Managers/ChatManager.cs b/Content.Client/Chat/Managers/ChatManager.cs index 67b5f5202f9..18f03cd7db0 100644 --- a/Content.Client/Chat/Managers/ChatManager.cs +++ b/Content.Client/Chat/Managers/ChatManager.cs @@ -14,7 +14,7 @@ internal sealed class ChatManager : IChatManager [Dependency] private readonly IEntitySystemManager _systems = default!; private ISawmill _sawmill = default!; - + public event Action? PermissionsUpdated; //Nyano - Summary: need to be able to update perms for new psionics. public void Initialize() { _sawmill = Logger.GetSawmill("chat"); @@ -67,9 +67,19 @@ public void SendMessage(string text, ChatSelectChannel channel) _consoleHost.ExecuteCommand($"whisper \"{CommandParsing.Escape(str)}\""); break; + //Nyano - Summary: sends the command for telepath communication. + case ChatSelectChannel.Telepathic: + _consoleHost.ExecuteCommand($"tsay \"{CommandParsing.Escape(str)}\""); + break; + default: throw new ArgumentOutOfRangeException(nameof(channel), channel, null); } } + //Nyano - Summary: fires off the update permissions script. + public void UpdatePermissions() + { + PermissionsUpdated?.Invoke(); + } } } diff --git a/Content.Client/Chat/Managers/IChatManager.cs b/Content.Client/Chat/Managers/IChatManager.cs index 6464ca10196..a21a8194fde 100644 --- a/Content.Client/Chat/Managers/IChatManager.cs +++ b/Content.Client/Chat/Managers/IChatManager.cs @@ -7,5 +7,11 @@ public interface IChatManager void Initialize(); public void SendMessage(string text, ChatSelectChannel channel); + + /// + /// Nyano - Summary:. Will refresh perms. + /// + event Action PermissionsUpdated; + public void UpdatePermissions(); } } diff --git a/Content.Client/Nyanotrasen/CartridgeLoader/Cartridges/GlimmerMonitorUi.cs b/Content.Client/Nyanotrasen/CartridgeLoader/Cartridges/GlimmerMonitorUi.cs new file mode 100644 index 00000000000..0b5fc7ad38c --- /dev/null +++ b/Content.Client/Nyanotrasen/CartridgeLoader/Cartridges/GlimmerMonitorUi.cs @@ -0,0 +1,39 @@ +using Robust.Client.GameObjects; +using Robust.Client.UserInterface; +using Content.Client.UserInterface.Fragments; +using Content.Shared.CartridgeLoader.Cartridges; +using Content.Shared.CartridgeLoader; + +namespace Content.Client.Nyanotrasen.CartridgeLoader.Cartridges; + +public sealed partial class GlimmerMonitorUi : UIFragment +{ + private GlimmerMonitorUiFragment? _fragment; + + public override Control GetUIFragmentRoot() + { + return _fragment!; + } + + public override void Setup(BoundUserInterface userInterface, EntityUid? fragmentOwner) + { + _fragment = new GlimmerMonitorUiFragment(); + + _fragment.OnSync += _ => SendSyncMessage(userInterface); + } + + public override void UpdateState(BoundUserInterfaceState state) + { + if (state is not GlimmerMonitorUiState monitorState) + return; + + _fragment?.UpdateState(monitorState.GlimmerValues); + } + + private void SendSyncMessage(BoundUserInterface userInterface) + { + var syncMessage = new GlimmerMonitorSyncMessageEvent(); + var message = new CartridgeUiMessage(syncMessage); + userInterface.SendMessage(message); + } +} diff --git a/Content.Client/Nyanotrasen/CartridgeLoader/Cartridges/GlimmerMonitorUiFragment.xaml b/Content.Client/Nyanotrasen/CartridgeLoader/Cartridges/GlimmerMonitorUiFragment.xaml new file mode 100644 index 00000000000..119a1831e6e --- /dev/null +++ b/Content.Client/Nyanotrasen/CartridgeLoader/Cartridges/GlimmerMonitorUiFragment.xaml @@ -0,0 +1,13 @@ + + + +