diff --git a/Content.Client/Chat/TypingIndicator/TypingIndicatorSystem.cs b/Content.Client/Chat/TypingIndicator/TypingIndicatorSystem.cs index 1f7736bffc1..7c3d4496edc 100644 --- a/Content.Client/Chat/TypingIndicator/TypingIndicatorSystem.cs +++ b/Content.Client/Chat/TypingIndicator/TypingIndicatorSystem.cs @@ -18,7 +18,7 @@ namespace Content.Client.Chat.TypingIndicator; // Client-side typing system tracks user input in chat box -public sealed class TypingIndicatorSystem : SharedTypingIndicatorSystem +public sealed partial class TypingIndicatorSystem : SharedTypingIndicatorSystem // DeltaV - Made partial { [Dependency] private readonly IGameTiming _time = default!; [Dependency] private readonly IPlayerManager _playerManager = default!; @@ -34,6 +34,7 @@ public override void Initialize() base.Initialize(); Subs.CVar(_cfg, CCVars.ChatShowTypingIndicator, OnShowTypingChanged); + InitializeAlternateTyping(); // DeltaV } public void ClientChangedChatText() @@ -113,4 +114,4 @@ private void OnShowTypingChanged(bool showTyping) ClientUpdateTyping(); } } -} \ No newline at end of file +} diff --git a/Content.Client/Chat/TypingIndicator/TypingIndicatorVisualizerSystem.cs b/Content.Client/Chat/TypingIndicator/TypingIndicatorVisualizerSystem.cs index bc65dc03afe..fc597149224 100644 --- a/Content.Client/Chat/TypingIndicator/TypingIndicatorVisualizerSystem.cs +++ b/Content.Client/Chat/TypingIndicator/TypingIndicatorVisualizerSystem.cs @@ -40,6 +40,13 @@ protected override void OnAppearanceChange(EntityUid uid, TypingIndicatorCompone if (overrideIndicator != null) currentTypingIndicator = overrideIndicator.Value; + // Begin DeltaV Additions - AAC TypingIndicator Override + if (component.TypingIndicatorOverridePrototype != null) + { + currentTypingIndicator = component.TypingIndicatorOverridePrototype.Value; + } + // End DeltaV Additions + if (!_prototypeManager.TryIndex(currentTypingIndicator, out var proto)) { Log.Error($"Unknown typing indicator id: {component.TypingIndicatorPrototype}"); @@ -67,4 +74,4 @@ protected override void OnAppearanceChange(EntityUid uid, TypingIndicatorCompone break; } } -} \ No newline at end of file +} diff --git a/Content.Client/_DV/AACTablet/UI/AACBoundUserInterface.cs b/Content.Client/_DV/AACTablet/UI/AACBoundUserInterface.cs new file mode 100644 index 00000000000..9f294fa44a0 --- /dev/null +++ b/Content.Client/_DV/AACTablet/UI/AACBoundUserInterface.cs @@ -0,0 +1,55 @@ +using Content.Client.Chat.TypingIndicator; +using Content.Shared._DV.AACTablet; +using Content.Shared._DV.QuickPhrase; +using Content.Shared.Chat.TypingIndicator; +using Robust.Client.UserInterface; +using Robust.Shared.Prototypes; + +namespace Content.Client._DV.AACTablet.UI; + +public sealed class AACBoundUserInterface(EntityUid owner, Enum uiKey) : BoundUserInterface(owner, uiKey) +{ + [ViewVariables] + private AACWindow? _window; + + private static readonly ProtoId AACTypingIndicator = "aac"; + + private TypingIndicatorSystem? _typing; + + protected override void Open() + { + base.Open(); + _window = new AACWindow(Owner); + _window.OpenCentered(); + _window.OnClose += Close; + _window.PhraseButtonPressed += OnPhraseButtonPressed; + _window.Typing += OnTyping; + _window.SubmitPressed += OnSubmit; + } + + private void OnPhraseButtonPressed(List> phraseId) + { + SendMessage(new AACTabletSendPhraseMessage(phraseId)); + } + + private void OnTyping() + { + _typing ??= EntMan.System(); + _typing?.ClientAlternateTyping(AACTypingIndicator); + } + + private void OnSubmit() + { + _typing ??= EntMan.System(); + _typing?.ClientSubmittedChatText(); + } + + protected override void Dispose(bool disposing) + { + base.Dispose(disposing); + if (!disposing) + return; + + _window?.Parent?.RemoveChild(_window); + } +} diff --git a/Content.Client/_DV/AACTablet/UI/AACWindow.xaml b/Content.Client/_DV/AACTablet/UI/AACWindow.xaml new file mode 100644 index 00000000000..d95fbf92d6e --- /dev/null +++ b/Content.Client/_DV/AACTablet/UI/AACWindow.xaml @@ -0,0 +1,23 @@ + + + + + +