Chat fixes (#10051)
This commit is contained in:
@@ -73,6 +73,9 @@ public sealed partial class ChatSystem
|
|||||||
chan = _prototypeManager.Index<RadioChannelPrototype>("Common");
|
chan = _prototypeManager.Index<RadioChannelPrototype>("Common");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Re-capitalize message since we removed the prefix.
|
||||||
|
message = SanitizeMessageCapital(source, message);
|
||||||
|
|
||||||
if (_inventory.TryGetSlotEntity(source, "ears", out var entityUid) &&
|
if (_inventory.TryGetSlotEntity(source, "ears", out var entityUid) &&
|
||||||
TryComp(entityUid, out HeadsetComponent? headset))
|
TryComp(entityUid, out HeadsetComponent? headset))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
using Content.Server.Administration.Logs;
|
using Content.Server.Administration.Logs;
|
||||||
using Content.Server.Administration.Managers;
|
using Content.Server.Administration.Managers;
|
||||||
using Content.Server.Chat.Managers;
|
using Content.Server.Chat.Managers;
|
||||||
@@ -244,17 +245,22 @@ public sealed partial class ChatSystem : SharedChatSystem
|
|||||||
|
|
||||||
private void SendEntitySpeak(EntityUid source, string originalMessage, bool hideChat = false)
|
private void SendEntitySpeak(EntityUid source, string originalMessage, bool hideChat = false)
|
||||||
{
|
{
|
||||||
if (!_actionBlocker.CanSpeak(source)) return;
|
if (!_actionBlocker.CanSpeak(source))
|
||||||
|
return;
|
||||||
|
|
||||||
var (message, channel) = GetRadioPrefix(source, originalMessage);
|
var (message, channel) = GetRadioPrefix(source, originalMessage);
|
||||||
|
|
||||||
|
if (channel != null)
|
||||||
|
{
|
||||||
|
_listener.PingListeners(source, message, channel);
|
||||||
|
SendEntityWhisper(source, message, hideChat);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
message = TransformSpeech(source, message);
|
message = TransformSpeech(source, message);
|
||||||
if (message.Length == 0)
|
if (message.Length == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (channel != null)
|
|
||||||
_listener.PingListeners(source, message, channel);
|
|
||||||
|
|
||||||
var messageWrap = Loc.GetString("chat-manager-entity-say-wrap-message",
|
var messageWrap = Loc.GetString("chat-manager-entity-say-wrap-message",
|
||||||
("entityName", Name(source)));
|
("entityName", Name(source)));
|
||||||
|
|
||||||
@@ -271,7 +277,8 @@ public sealed partial class ChatSystem : SharedChatSystem
|
|||||||
|
|
||||||
private void SendEntityWhisper(EntityUid source, string originalMessage, bool hideChat = false)
|
private void SendEntityWhisper(EntityUid source, string originalMessage, bool hideChat = false)
|
||||||
{
|
{
|
||||||
if (!_actionBlocker.CanSpeak(source)) return;
|
if (!_actionBlocker.CanSpeak(source))
|
||||||
|
return;
|
||||||
|
|
||||||
var message = TransformSpeech(source, originalMessage);
|
var message = TransformSpeech(source, originalMessage);
|
||||||
if (message.Length == 0)
|
if (message.Length == 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user