diff --git a/Content.Client/_DEN/Denu/Modules/Chat/FormatterModule.cs b/Content.Client/_DEN/Denu/Modules/Chat/FormatterModule.cs index a53496d51c..d8640cdd88 100644 --- a/Content.Client/_DEN/Denu/Modules/Chat/FormatterModule.cs +++ b/Content.Client/_DEN/Denu/Modules/Chat/FormatterModule.cs @@ -166,7 +166,7 @@ private static MessageFormatter.FormatterConfig CreateFormatterConfig() { new("***", "[bolditalic]", "[/bolditalic]", false, false), new("**", "[bold]", "[/bold]", false, false), - new("\"", "[color={DialogueColor}]\"", "\"[/color]", false, true), + new("\"", "\"[color={DialogueColor}]", "[/color]\"", false, true), new("*", "[italic]", "[/italic]", true, false), new("*", "[italic][color={EmoteColor}]*", "*[/color][/italic]", false, false), }, diff --git a/Content.Server/Radio/EntitySystems/RadioSystem.cs b/Content.Server/Radio/EntitySystems/RadioSystem.cs index 833d2bac6a..b6dddec04a 100644 --- a/Content.Server/Radio/EntitySystems/RadioSystem.cs +++ b/Content.Server/Radio/EntitySystems/RadioSystem.cs @@ -179,6 +179,8 @@ public void SendRadioMessage(EntityUid messageSource, channel.LocalizedName, channel.Color); + Log.Debug("Radio: " + wrappedMessage); + if (name != Name(messageSource)) _adminLogger.Add(LogType.Chat, LogImpact.Low, $"Radio message from {ToPrettyString(messageSource):user} as {name} on {channel.LocalizedName}: {unwrappedMessage}"); else diff --git a/Content.Server/_DEN/Chat/Systems/ChatSystem.Language.cs b/Content.Server/_DEN/Chat/Systems/ChatSystem.Language.cs index b1ec651892..0403c22052 100644 --- a/Content.Server/_DEN/Chat/Systems/ChatSystem.Language.cs +++ b/Content.Server/_DEN/Chat/Systems/ChatSystem.Language.cs @@ -393,19 +393,18 @@ public void SendComplexMessageToEntity(EntityUid source, // Combine tags back into emotes and dialog so they can be formatted. List<(ChatPart, string)> mergedParts = []; var workingSet = message.Parts; + Log.Debug("====== BEFORE ======"); + foreach (var (kind, part) in workingSet) + { + Log.Debug("Got " + kind + ": [" + part + "]"); + } var lastSeen = workingSet[0]; - for (int i = 0; i < workingSet.Count; i++) + for (int i = 1; i < workingSet.Count; i++) { - if (i == 0) - { - lastSeen = workingSet[0]; - continue; - } - var current = workingSet[i]; // Matching Dialog or Emote. if ((lastSeen.Item1 is ChatPart.Dialog or ChatPart.DialogTag - && current.Item1 is ChatPart.Dialog or ChatPart.DialogTag) + && current.Item1 is ChatPart.Dialog or ChatPart.DialogTag) || (lastSeen.Item1 is ChatPart.Emote or ChatPart.EmoteTag && current.Item1 is ChatPart.Emote or ChatPart.EmoteTag)) { @@ -423,12 +422,12 @@ public void SendComplexMessageToEntity(EntityUid source, } } mergedParts.Add(lastSeen); - + // Loop over the parts of the complex speech. // Dialog gets a lot of special formatting where as emotes just get default action formatting. foreach (var (kind, part) in mergedParts) { - if (kind == ChatPart.Dialog) + if (kind == ChatPart.Dialog || kind == ChatPart.DialogTag) { unwrappedBuilder.Append(message.Delimiter + part + message.Delimiter); wrappedBuilder.Append(message.Delimiter); diff --git a/Content.Shared/_DEN/Chat/SharedChatSystem.Language.cs b/Content.Shared/_DEN/Chat/SharedChatSystem.Language.cs index 15a72f3cdf..164e6ac9f1 100644 --- a/Content.Shared/_DEN/Chat/SharedChatSystem.Language.cs +++ b/Content.Shared/_DEN/Chat/SharedChatSystem.Language.cs @@ -1,7 +1,6 @@ using System.Linq; using Content.Shared._DEN.CCVar; using Content.Shared._DEN.Language; -using Content.Shared._DEN.Utility; using Content.Shared.Speech; using Robust.Shared.Configuration; using Robust.Shared.Prototypes; @@ -53,7 +52,7 @@ public ComplexChatMessage ObfuscateComplexChatMessage(ComplexChatMessage message /// The correct speech verb prototype to use. public SpeechVerbPrototype GetComplexSpeechVerb(EntityUid source, ComplexChatMessage message, LanguagePrototype language, ChatChannel channel) { - var lastDialog = message.Parts.LastOrDefault(p => p.Item1 == ChatPart.Dialog).Item2; + var lastDialog = message.Parts.LastOrDefault(p => p.Item1 == ChatPart.Dialog).Item2 ?? ""; SpeechVerbPrototype? current = null; Dictionary>? currentSuffixVerbs = null; @@ -178,12 +177,12 @@ public ComplexChatMessage(string message, string delimiter, bool isDetailed, boo return; } - var outside = false; + var outside = true; foreach (var hunk in parsedMsg.Nodes) { if (!hunk.IsPlainText) { - parts.Add((outside ? ChatPart.DialogTag : ChatPart.EmoteTag, hunk.ToString())); + parts.Add((outside ? ChatPart.EmoteTag : ChatPart.DialogTag, hunk.ToString())); continue; } @@ -191,15 +190,17 @@ public ComplexChatMessage(string message, string delimiter, bool isDetailed, boo var pieces = hunk.ToString().Split(Delimiter); if (pieces.Length == 1 && !string.IsNullOrEmpty(pieces[0])) { - parts.Add((outside ? ChatPart.Dialog : ChatPart.Emote, pieces[0])); + parts.Add((outside ? ChatPart.Emote : ChatPart.Dialog, pieces[0])); continue; } foreach (var msgChunk in pieces) { if (!string.IsNullOrEmpty(msgChunk)) - parts.Add((outside ? ChatPart.Dialog : ChatPart.Emote, msgChunk)); - outside = !outside; + { + parts.Add((outside ? ChatPart.Emote : ChatPart.Dialog, msgChunk)); + outside = !outside; + } } }