More Chat Indicators (#4679)

* emote whisper and OOC bubbles

Signed-off-by: Nesoryo-jpeg <joem365289@gmail.com>

* Update meta.json

added entries for OOC, Emote, and Whisper

Signed-off-by: Nesoryo-jpeg <joem365289@gmail.com>

* Update meta.json

added copyright info for OOC, Emote, and Whispering

Signed-off-by: Nesoryo-jpeg <joem365289@gmail.com>

* Update typing_indicator.yml

Added Whisper, OOC, and Emote indicators

Signed-off-by: Nesoryo-jpeg <joem365289@gmail.com>

* added indicator logic

* added radio sprite state

* initialized logic for chat bubbles

* refresh indicator change

* fixed emote sprite

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* nicer comments

* cleaned up and sorted namespaces

* oh my god

* cleanup...

* cleanup two

* cleanup 3 (my god)

* YESSSS

---------

Signed-off-by: Nesoryo-jpeg <joem365289@gmail.com>
Co-authored-by: Nesoryo-jpeg <joem365289@gmail.com>
Co-authored-by: nkokic <nikola1.kokic@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
KOTOB 2025-12-04 08:59:08 -08:00 committed by GitHub
parent ed21b2e04d
commit 73363b9ff5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
14 changed files with 154 additions and 3 deletions

View File

@ -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)

View File

@ -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);
}

View File

@ -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<CharacterInfoSystem>
{
public ChatSelectChannel CurrentChannel = ChatSelectChannel.None;
private static readonly ProtoId<TypingIndicatorPrototype> WhisperID = "whisper";
private static readonly ProtoId<TypingIndicatorPrototype> EmoteID = "emote";
private static readonly ProtoId<TypingIndicatorPrototype> OocID = "ooc";
private static readonly ProtoId<TypingIndicatorPrototype> RadioID = "radio";
/// <summary>
/// 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<CharacterInfoSys
if (shouldSave)
_config.SaveToFile();
}
/// <summary>
/// Notifies and sets what type of typing indicator should be put.
/// </summary>
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;
}
}
}

View File

@ -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);
}

View File

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 756 B

View File

@ -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
]
]
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 827 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 632 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 742 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 738 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 562 B