diff --git a/Content.Server/Chat/Systems/ChatSystem.cs b/Content.Server/Chat/Systems/ChatSystem.cs index f69c95dfcb8..3503ef84ca3 100644 --- a/Content.Server/Chat/Systems/ChatSystem.cs +++ b/Content.Server/Chat/Systems/ChatSystem.cs @@ -423,11 +423,11 @@ private void SendEntitySpeak( name = FormattedMessage.EscapeText(name); // The chat message wrapped in a "x says y" string - var wrappedMessage = WrapPublicMessage(source, name, message); + var wrappedMessage = WrapPublicMessage(source, name, message, languageOverride: language); // The chat message obfuscated via language obfuscation var obfuscated = SanitizeInGameICMessage(source, _language.ObfuscateSpeech(message, language), out var emoteStr, true, _configurationManager.GetCVar(CCVars.ChatPunctuation), (!CultureInfo.CurrentCulture.IsNeutralCulture && CultureInfo.CurrentCulture.Parent.Name == "en") || (CultureInfo.CurrentCulture.IsNeutralCulture && CultureInfo.CurrentCulture.Name == "en")); // The language-obfuscated message wrapped in a "x says y" string - var wrappedObfuscated = WrapPublicMessage(source, name, obfuscated); + var wrappedObfuscated = WrapPublicMessage(source, name, obfuscated, languageOverride: language); SendInVoiceRange(ChatChannel.Local, name, message, wrappedMessage, obfuscated, wrappedObfuscated, source, range, languageOverride: language); @@ -514,6 +514,7 @@ private void SendEntityWhisper( // Scenario 1: the listener can clearly understand the message result = perceivedMessage; wrappedMessage = Loc.GetString("chat-manager-entity-whisper-wrap-message", + ("color", language.Color ?? Color.Gray), ("entityName", name), ("message", FormattedMessage.EscapeText(result))); } @@ -523,13 +524,14 @@ private void SendEntityWhisper( // Collisiongroup.Opaque is not ideal for this use. Preferably, there should be a check specifically with "Can Ent1 see Ent2" in mind result = ObfuscateMessageReadability(perceivedMessage); wrappedMessage = Loc.GetString("chat-manager-entity-whisper-wrap-message", - ("entityName", nameIdentity), ("message", FormattedMessage.EscapeText(result))); + ("entityName", nameIdentity), ("color", language.Color ?? Color.Gray), ("message", FormattedMessage.EscapeText(result))); } else { // Scenario 3: If listener is too far and has no line of sight, they can't identify the whisperer's identity result = ObfuscateMessageReadability(perceivedMessage); wrappedMessage = Loc.GetString("chat-manager-entity-whisper-unknown-wrap-message", + ("color", language.Color ?? Color.Gray), ("message", FormattedMessage.EscapeText(result))); } @@ -537,6 +539,7 @@ private void SendEntityWhisper( } var replayWrap = Loc.GetString("chat-manager-entity-whisper-wrap-message", + ("color", language.Color ?? Color.Gray), ("entityName", name), ("message", FormattedMessage.EscapeText(message))); _replay.RecordServerMessage(new ChatMessage(ChatChannel.Whisper, message, replayWrap, GetNetEntity(source), null, MessageRangeHideChatForReplay(range))); @@ -837,15 +840,16 @@ public string SanitizeMessageReplaceWords(string message) /// /// Wraps a message sent by the specified entity into an "x says y" string. /// - public string WrapPublicMessage(EntityUid source, string name, string message) + public string WrapPublicMessage(EntityUid source, string name, string message, LanguagePrototype? languageOverride = null) { + var language = languageOverride ?? _language.GetLanguage(source); var speech = GetSpeechVerb(source, message); - var verbName = Loc.GetString(_random.Pick(speech.SpeechVerbStrings)); return Loc.GetString(speech.Bold ? "chat-manager-entity-say-bold-wrap-message" : "chat-manager-entity-say-wrap-message", + ("color", language.Color ?? Color.White), ("entityName", name), - ("verb", verbName), - ("fontType", speech.FontId), - ("fontSize", speech.FontSize), + ("verb", Loc.GetString(_random.Pick(speech.SpeechVerbStrings))), + ("fontType", language.FontId ?? speech.FontId), + ("fontSize", language.FontSize ?? speech.FontSize), ("message", message)); } diff --git a/Content.Server/Radio/EntitySystems/RadioSystem.cs b/Content.Server/Radio/EntitySystems/RadioSystem.cs index 7ed7574a9ae..bfdd49213ee 100644 --- a/Content.Server/Radio/EntitySystems/RadioSystem.cs +++ b/Content.Server/Radio/EntitySystems/RadioSystem.cs @@ -115,12 +115,12 @@ public void SendRadioMessage(EntityUid messageSource, string message, RadioChann ? FormattedMessage.EscapeText(message) : message; - var wrappedMessage = WrapRadioMessage(messageSource, channel, name, content); + var wrappedMessage = WrapRadioMessage(messageSource, channel, name, content, language); var msg = new ChatMessage(ChatChannel.Radio, content, wrappedMessage, NetEntity.Invalid, null); // ... you guess it var obfuscated = _language.ObfuscateSpeech(content, language); - var obfuscatedWrapped = WrapRadioMessage(messageSource, channel, name, obfuscated); + var obfuscatedWrapped = WrapRadioMessage(messageSource, channel, name, obfuscated, language); var notUdsMsg = new ChatMessage(ChatChannel.Radio, obfuscated, obfuscatedWrapped, NetEntity.Invalid, null); var ev = new RadioReceiveEvent(messageSource, channel, msg, notUdsMsg, language); @@ -173,13 +173,14 @@ public void SendRadioMessage(EntityUid messageSource, string message, RadioChann _messages.Remove(message); } - private string WrapRadioMessage(EntityUid source, RadioChannelPrototype channel, string name, string message) + private string WrapRadioMessage(EntityUid source, RadioChannelPrototype channel, string name, string message, LanguagePrototype language) { var speech = _chat.GetSpeechVerb(source, message); return Loc.GetString(speech.Bold ? "chat-radio-message-wrap-bold" : "chat-radio-message-wrap", ("color", channel.Color), - ("fontType", speech.FontId), - ("fontSize", speech.FontSize), + ("languageColor", language.Color ?? channel.Color), + ("fontType", language.FontId ?? speech.FontId), + ("fontSize", language.FontSize ?? speech.FontSize), ("verb", Loc.GetString(_random.Pick(speech.SpeechVerbStrings))), ("channel", $"\\[{channel.LocalizedName}\\]"), ("name", name), diff --git a/Content.Shared/Language/LanguagePrototype.cs b/Content.Shared/Language/LanguagePrototype.cs index 9342c07e91f..be54b45aa1f 100644 --- a/Content.Shared/Language/LanguagePrototype.cs +++ b/Content.Shared/Language/LanguagePrototype.cs @@ -8,6 +8,15 @@ public sealed class LanguagePrototype : IPrototype [IdDataField] public string ID { get; private set; } = default!; + [DataField("color")] + public Color? Color; + + [DataField("fontId")] + public string? FontId; + + [DataField("fontSize")] + public int? FontSize; + /// /// Obfuscation method used by this language. By default, uses /// diff --git a/Resources/Fonts/Copperplate.otf b/Resources/Fonts/Copperplate.otf new file mode 100644 index 00000000000..40d45aa46b6 Binary files /dev/null and b/Resources/Fonts/Copperplate.otf differ diff --git a/Resources/Fonts/Mangat.ttf b/Resources/Fonts/Mangat.ttf new file mode 100644 index 00000000000..de4c11beba5 Binary files /dev/null and b/Resources/Fonts/Mangat.ttf differ diff --git a/Resources/Fonts/Noganas.ttf b/Resources/Fonts/Noganas.ttf new file mode 100644 index 00000000000..afa0c82f03e Binary files /dev/null and b/Resources/Fonts/Noganas.ttf differ diff --git a/Resources/Fonts/RubikBubbles.ttf b/Resources/Fonts/RubikBubbles.ttf new file mode 100644 index 00000000000..a653715c6cd Binary files /dev/null and b/Resources/Fonts/RubikBubbles.ttf differ diff --git a/Resources/Locale/en-US/chat/managers/chat-manager.ftl b/Resources/Locale/en-US/chat/managers/chat-manager.ftl index fab815b4f90..2c8b326b076 100644 --- a/Resources/Locale/en-US/chat/managers/chat-manager.ftl +++ b/Resources/Locale/en-US/chat/managers/chat-manager.ftl @@ -21,11 +21,11 @@ chat-manager-whisper-headset-on-message = You can't whisper on the radio! chat-manager-server-wrap-message = [bold]{$message}[/bold] chat-manager-sender-announcement-wrap-message = [font size=14][bold]{$sender} Announcement:[/font][font size=12] {$message}[/bold][/font] -chat-manager-entity-say-wrap-message = [BubbleHeader][Name]{$entityName}[/Name][/BubbleHeader] {$verb}, [font={$fontType} size={$fontSize}]"[BubbleContent]{$message}[/BubbleContent]"[/font] -chat-manager-entity-say-bold-wrap-message = [BubbleHeader][Name]{$entityName}[/Name][/BubbleHeader] {$verb}, [font={$fontType} size={$fontSize}]"[BubbleContent][bold]{$message}[/bold][/BubbleContent]"[/font] +chat-manager-entity-say-wrap-message = [BubbleHeader][Name]{$entityName}[/Name][/BubbleHeader] {$verb}, [font="{$fontType}" size={$fontSize}]"[color={$color}][BubbleContent]{$message}[/BubbleContent][/color]"[/font] +chat-manager-entity-say-bold-wrap-message = [BubbleHeader][Name]{$entityName}[/Name][/BubbleHeader] {$verb}, [font="{$fontType}" size={$fontSize}]"[color={$color}][BubbleContent][bold]{$message}[/bold][/BubbleContent][/color]"[/font] -chat-manager-entity-whisper-wrap-message = [font size=11][italic][BubbleHeader][Name]{$entityName}[/Name][/BubbleHeader] whispers,"[BubbleContent]{$message}[/BubbleContent]"[/italic][/font] -chat-manager-entity-whisper-unknown-wrap-message = [font size=11][italic][BubbleHeader]Someone[/BubbleHeader] whispers, "[BubbleContent]{$message}[/BubbleContent]"[/italic][/font] +chat-manager-entity-whisper-wrap-message = [font size=11][italic][BubbleHeader][Name]{$entityName}[/Name][/BubbleHeader] whispers,"[color={$color}][BubbleContent]{$message}[/BubbleContent][/color]"[/italic][/font] +chat-manager-entity-whisper-unknown-wrap-message = [font size=11][italic][BubbleHeader]Someone[/BubbleHeader] whispers, "[color={$color}][BubbleContent]{$message}[/BubbleContent][/color]"[/italic][/font] # THE() is not used here because the entity and its name can technically be disconnected if a nameOverride is passed... chat-manager-entity-me-wrap-message = [italic]{ PROPER($entity) -> diff --git a/Resources/Locale/en-US/headset/headset-component.ftl b/Resources/Locale/en-US/headset/headset-component.ftl index a220737f18a..75c83643d6d 100644 --- a/Resources/Locale/en-US/headset/headset-component.ftl +++ b/Resources/Locale/en-US/headset/headset-component.ftl @@ -1,6 +1,6 @@ # Chat window radio wrap (prefix and postfix) -chat-radio-message-wrap = [color={$color}]{$channel} {$name} {$verb}, [font={$fontType} size={$fontSize}]"{$message}"[/font][/color] -chat-radio-message-wrap-bold = [color={$color}]{$channel} {$name} {$verb}, [font={$fontType} size={$fontSize}][bold]"{$message}"[/bold][/font][/color] +chat-radio-message-wrap = [color={$color}]{$channel} {$name} {$verb}, [font="{$fontType}" size={$fontSize}]"[/color][color={$languageColor}]{$message}[/color][color={$color}]"[/font][/color] +chat-radio-message-wrap-bold = [color={$color}]{$channel} {$name} {$verb}, [font="{$fontType}" size={$fontSize}][bold]"[/color][color={$languageColor}]{$message}[/color][color={$color}]"[/bold][/font][/color] examine-headset-default-channel = Use {$prefix} for the default channel ([color={$color}]{$channel}[/color]). diff --git a/Resources/Prototypes/Language/languages.yml b/Resources/Prototypes/Language/languages.yml index 1a874612c2f..048fdc6f24c 100644 --- a/Resources/Prototypes/Language/languages.yml +++ b/Resources/Prototypes/Language/languages.yml @@ -38,6 +38,8 @@ # Spoken by slimes. - type: language id: Bubblish + color: "#0077aa" + fontId: RubikBubbles obfuscation: !type:SyllableObfuscation minSyllables: 1 @@ -52,6 +54,8 @@ # Spoken by moths. - type: language id: Moffic + color: "#869b29" + fontId: Copperplate obfuscation: !type:SyllableObfuscation minSyllables: 2 # Replacements are really short @@ -118,6 +122,8 @@ # Spoken by dionas. - type: language id: RootSpeak + color: "#804000" + fontId: Noganas obfuscation: !type:SyllableObfuscation minSyllables: 1 @@ -132,6 +138,8 @@ # A mess of broken Japanese, spoken by Felinds and Oni - type: language id: Nekomimetic + color: "#803B56" + fontId: Manga obfuscation: !type:SyllableObfuscation minSyllables: 1 @@ -189,6 +197,7 @@ # Spoken by the Lizard race. - type: language id: Draconic + color: "#228b22" obfuscation: !type:SyllableObfuscation minSyllables: 2 @@ -282,6 +291,7 @@ # Spoken by the Vulpkanin race. - type: language id: Canilunzt + color: "#b97a57" obfuscation: !type:SyllableObfuscation minSyllables: 1 @@ -314,7 +324,6 @@ - vor - nic - gro - # - lll - enem - zandt - tzch @@ -349,6 +358,7 @@ # The common language of the Sol system. - type: language id: SolCommon + color: "#8282fb" obfuscation: !type:SyllableObfuscation minSyllables: 1 @@ -374,6 +384,7 @@ - type: language id: RobotTalk + fontId: Monospace obfuscation: !type:SyllableObfuscation minSyllables: 1 diff --git a/Resources/Prototypes/fonts.yml b/Resources/Prototypes/fonts.yml index 03102cd341b..92c2947258c 100644 --- a/Resources/Prototypes/fonts.yml +++ b/Resources/Prototypes/fonts.yml @@ -45,3 +45,19 @@ - type: font id: Emoji path: /Fonts/NotoEmoji.ttf + +- type: font + id: RubikBubbles + path: /Fonts/RubikBubbles.ttf + +- type: font + id: Copperplate + path: /Fonts/Copperplate.otf + +- type: font + id: Manga + path: /Fonts/Mangat.ttf + +- type: font + id: Noganas + path: /Fonts/Noganas.ttf