diff --git a/Content.Client/UserInterface/Systems/Chat/ChatUIController.cs b/Content.Client/UserInterface/Systems/Chat/ChatUIController.cs index 100841f053..18d8bd604a 100644 --- a/Content.Client/UserInterface/Systems/Chat/ChatUIController.cs +++ b/Content.Client/UserInterface/Systems/Chat/ChatUIController.cs @@ -714,6 +714,13 @@ public sealed partial class ChatUIController : UIController box.ChatInput.ChannelSelector.UpdateChannelSelectButton(box.SelectedChannel, null); else box.ChatInput.ChannelSelector.UpdateChannelSelectButton(prefixChannel, radioChannel); + + // DeltaV begin - refresh indicator change + if (CurrentChannel != prefixChannel) + _typingIndicator?.ClientSubmittedChatText(); + + CurrentChannel = prefixChannel; + // DeltaV end } public (ChatSelectChannel chatChannel, string text, RadioChannelPrototype? radioChannel) SplitInputContents(string text) diff --git a/Content.Client/UserInterface/Systems/Chat/Widgets/ChatBox.xaml.cs b/Content.Client/UserInterface/Systems/Chat/Widgets/ChatBox.xaml.cs index f131cc0604..7ab18a586c 100644 --- a/Content.Client/UserInterface/Systems/Chat/Widgets/ChatBox.xaml.cs +++ b/Content.Client/UserInterface/Systems/Chat/Widgets/ChatBox.xaml.cs @@ -238,6 +238,7 @@ public partial class ChatBox : UIWidget return; ChatInput.ChannelSelector.Select(toSelect); + _controller.CurrentChannel = toSelect; // DeltaV - Alt Chat Indicators } private void OnInputKeyBindDown(GUIBoundKeyEventArgs args) @@ -270,12 +271,14 @@ public partial class ChatBox : UIWidget _controller.UpdateSelectedChannel(this); // Warn typing indicator about change - _controller.NotifyChatTextChange(); + // _controller.NotifyChatTextChange(); // DeltaV + _controller.NotifySpecificChatTextChange(SelectedChannel); // DeltaV - Alt Chat Indicators } private void OnFocusEnter(LineEditEventArgs args) { // Warn typing indicator about focus + _controller.CurrentChannel = SelectedChannel; // DeltaV - Alt Chat Indicators _controller.NotifyChatFocus(true); } diff --git a/Content.Client/_DV/UserInterfaces/Systems/Chat/ChatUIController.cs b/Content.Client/_DV/UserInterfaces/Systems/Chat/ChatUIController.cs index 0fd37a6069..317be86879 100644 --- a/Content.Client/_DV/UserInterfaces/Systems/Chat/ChatUIController.cs +++ b/Content.Client/_DV/UserInterfaces/Systems/Chat/ChatUIController.cs @@ -4,6 +4,9 @@ using Content.Client.CharacterInfo; using Content.Shared.CCVar; using Content.Shared._DV.CCVars; using Content.Shared.Dataset; +using Content.Shared.Chat; +using Content.Shared.Chat.TypingIndicator; +using Robust.Shared.Prototypes; using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controllers; using static Content.Client.CharacterInfo.CharacterInfoSystem; @@ -12,6 +15,12 @@ namespace Content.Client.UserInterface.Systems.Chat; public sealed partial class ChatUIController : IOnSystemChanged { + public ChatSelectChannel CurrentChannel = ChatSelectChannel.None; + private static readonly ProtoId WhisperID = "whisper"; + private static readonly ProtoId EmoteID = "emote"; + private static readonly ProtoId OocID = "ooc"; + private static readonly ProtoId RadioID = "radio"; + /// /// Gets Invoked whenever the autofilled highlights have changed. /// Used to populate the preview in the channel selector window. @@ -98,4 +107,38 @@ public sealed partial class ChatUIController : IOnSystemChanged + /// Notifies and sets what type of typing indicator should be put. + /// + public void NotifySpecificChatTextChange(ChatSelectChannel selectedChannel) + { + var channel = CurrentChannel; + if (CurrentChannel == ChatSelectChannel.None) + channel = selectedChannel; + + switch (channel) + { + case ChatSelectChannel.Whisper: + _typingIndicator?.ClientAlternateTyping(WhisperID); + break; + + case ChatSelectChannel.Radio: + _typingIndicator?.ClientAlternateTyping(RadioID); + break; + + case ChatSelectChannel.Emotes: + _typingIndicator?.ClientAlternateTyping(EmoteID); + break; + + case ChatSelectChannel.LOOC: + case ChatSelectChannel.OOC: + _typingIndicator?.ClientAlternateTyping(OocID); + break; + + default: + _typingIndicator?.ClientChangedChatText(); + break; + } + } } diff --git a/Content.Shared/Chat/TypingIndicator/SharedTypingIndicatorSystem.cs b/Content.Shared/Chat/TypingIndicator/SharedTypingIndicatorSystem.cs index a878879470..dfae7369a4 100644 --- a/Content.Shared/Chat/TypingIndicator/SharedTypingIndicatorSystem.cs +++ b/Content.Shared/Chat/TypingIndicator/SharedTypingIndicatorSystem.cs @@ -80,7 +80,9 @@ public abstract class SharedTypingIndicatorSystem : EntitySystem return; } - SetTypingOverride(uid.Value, ev.OverrideIndicator); // DeltaV + if(ev.State != TypingIndicatorState.Idle) // DeltaV - don't remove override when transitioning to idle + SetTypingOverride(uid.Value, ev.OverrideIndicator); // DeltaV + SetTypingIndicatorState(uid.Value, ev.State); } diff --git a/Resources/Prototypes/_DV/typing_indicator.yml b/Resources/Prototypes/_DV/typing_indicator.yml index 25ac9338b7..29a04a8c73 100644 --- a/Resources/Prototypes/_DV/typing_indicator.yml +++ b/Resources/Prototypes/_DV/typing_indicator.yml @@ -52,3 +52,31 @@ typingState: paper0 idleState: paper0 offset: 0, 0.1 + +- type: typingIndicator + id: emote + spritePath: /Textures/_DV/Effects/speech.rsi + typingState: emote0 + idleState: emote1 + offset: -0.05, 0.1 + +- type: typingIndicator + id: ooc + spritePath: /Textures/_DV/Effects/speech.rsi + typingState: ooc0 + idleState: ooc1 + offset: -0.05, 0.1 + +- type: typingIndicator + id: whisper + spritePath: /Textures/_DV/Effects/speech.rsi + typingState: whisper0 + idleState: whisper1 + offset: -0.05, 0.1 + +- type: typingIndicator + id: radio + spritePath: /Textures/_DV/Effects/speech.rsi + typingState: radio0 + idleState: radio1 + offset: -0.05, 0.1 diff --git a/Resources/Textures/_DV/Effects/speech.rsi/emote0.png b/Resources/Textures/_DV/Effects/speech.rsi/emote0.png new file mode 100644 index 0000000000..8848256e14 Binary files /dev/null and b/Resources/Textures/_DV/Effects/speech.rsi/emote0.png differ diff --git a/Resources/Textures/_DV/Effects/speech.rsi/emote1.png b/Resources/Textures/_DV/Effects/speech.rsi/emote1.png new file mode 100644 index 0000000000..ddb3594838 Binary files /dev/null and b/Resources/Textures/_DV/Effects/speech.rsi/emote1.png differ diff --git a/Resources/Textures/_DV/Effects/speech.rsi/meta.json b/Resources/Textures/_DV/Effects/speech.rsi/meta.json index 0baabeab6c..6c32d2778f 100644 --- a/Resources/Textures/_DV/Effects/speech.rsi/meta.json +++ b/Resources/Textures/_DV/Effects/speech.rsi/meta.json @@ -5,7 +5,7 @@ "y": 32 }, "license": "CC-BY-SA-3.0", - "copyright": "Felinid sprites made by Adrian16199 (Github), Rodentia sprites made by portfiend, Feroxi sprites made by BlitzTheSquishy, AAC sprites by _.requiem._ (Discord), paper sprites by Nikovnik (Github: nkokic)", + "copyright": "Felinid sprites made by Adrian16199 (Github), Rodentia sprites made by portfiend, Feroxi sprites made by BlitzTheSquishy, AAC sprites by _.requiem._ (Discord), paper and radio sprites by Nikovnik (Github: nkokic); OOC, emote and whispering sprites made by Nesoryo (Discord); radio/ooc/emote/whisper idle states modified from default states by kotobdev (GitHub)", "states": [ { "name": "aac0", @@ -130,6 +130,74 @@ 0.5 ] ] + }, + { + "name": "emote0", + "delays": [ + [ + 0.3, + 0.2, + 0.3, + 0.2 + ] + ] + }, + { + "name": "emote1", + "delays": [ + [ + 0.5, + 0.5 + ] + ] + }, + { + "name": "ooc0", + "delays": [ + [ + 0.2, + 0.3, + 0.3, + 0.5 + ] + ] + }, + { + "name": "ooc1" + }, + { + "name": "whisper0", + "delays": [ + [ + 0.2, + 0.3, + 0.3, + 0.5 + ] + ] + }, + { + "name": "whisper1" + }, + { + "name": "radio0", + "delays": [ + [ + 0.2, + 0.3, + 0.3, + 0.5 + ] + ] + }, + { + "name": "radio1", + "delays": [ + [ + 0.5, + 0.5 + ] + ] } ] } diff --git a/Resources/Textures/_DV/Effects/speech.rsi/ooc0.png b/Resources/Textures/_DV/Effects/speech.rsi/ooc0.png new file mode 100644 index 0000000000..e3ac1b5a3c Binary files /dev/null and b/Resources/Textures/_DV/Effects/speech.rsi/ooc0.png differ diff --git a/Resources/Textures/_DV/Effects/speech.rsi/ooc1.png b/Resources/Textures/_DV/Effects/speech.rsi/ooc1.png new file mode 100644 index 0000000000..cc9b206d44 Binary files /dev/null and b/Resources/Textures/_DV/Effects/speech.rsi/ooc1.png differ diff --git a/Resources/Textures/_DV/Effects/speech.rsi/radio0.png b/Resources/Textures/_DV/Effects/speech.rsi/radio0.png new file mode 100644 index 0000000000..57919e93f7 Binary files /dev/null and b/Resources/Textures/_DV/Effects/speech.rsi/radio0.png differ diff --git a/Resources/Textures/_DV/Effects/speech.rsi/radio1.png b/Resources/Textures/_DV/Effects/speech.rsi/radio1.png new file mode 100644 index 0000000000..fac7aa105d Binary files /dev/null and b/Resources/Textures/_DV/Effects/speech.rsi/radio1.png differ diff --git a/Resources/Textures/_DV/Effects/speech.rsi/whisper0.png b/Resources/Textures/_DV/Effects/speech.rsi/whisper0.png new file mode 100644 index 0000000000..2ed0cd7ea7 Binary files /dev/null and b/Resources/Textures/_DV/Effects/speech.rsi/whisper0.png differ diff --git a/Resources/Textures/_DV/Effects/speech.rsi/whisper1.png b/Resources/Textures/_DV/Effects/speech.rsi/whisper1.png new file mode 100644 index 0000000000..4a6723e4d8 Binary files /dev/null and b/Resources/Textures/_DV/Effects/speech.rsi/whisper1.png differ