From 685c0c9947e25b680a3f2757fb5a755c7302d25d Mon Sep 17 00:00:00 2001 From: Skubman Date: Sat, 30 Nov 2024 06:58:56 +0800 Subject: [PATCH] Re-Enable Language Color and Font (#1294) # Description Re-enables language font and colors showing up in chat messages. The language font/colors were bugged after adding language names in chat (https://github.com/Simple-Station/Einstein-Engines/pull/1165) I also overhauled the format for chat messages to be more aesthetically pleasing, and made sure chat bubbles use the language color/font. ## Media **Nekomimetic** ![image](https://github.com/user-attachments/assets/4cb88d7b-7466-42ed-bf2d-b68c68edb62c) ![image](https://github.com/user-attachments/assets/adec7fd7-0a84-4e21-9eff-c1a387e2d529) **Bubblish** ![image](https://github.com/user-attachments/assets/c49f5573-ac96-4375-a584-e8b2cc6f5fee) ![image](https://github.com/user-attachments/assets/c739c249-9d1e-453e-9e92-3f7ef24a4d61) **Tau-Ceti Basic (Default Language)** ![image](https://github.com/user-attachments/assets/e6660039-ac2f-449b-96e0-44e0142d3715) ![image](https://github.com/user-attachments/assets/2baec2ca-975d-4111-85b0-3b2056fdd7f7) **Rootspeak** ![image](https://github.com/user-attachments/assets/99d94f8d-9a1c-4be9-8c98-b42c9c7cffd7) ![image](https://github.com/user-attachments/assets/c20b4621-1ca7-42f5-a22a-82c9a4d1dddf) ## Changelog :cl: Skubman - fix: Language colors and fonts will show up in text messages again, both on in-person messages and on the radio. - tweak: The text on chat bubbles now uses the color and font of the language being spoken. - tweak: The language prefix before the name on chat messages now uses the language's color. (cherry picked from commit 1a9763528a9b15f11f474a2fa7ecfdde98aa9a15) --- Content.Server/Chat/Systems/ChatSystem.cs | 2 +- Content.Server/Radio/EntitySystems/RadioSystem.cs | 4 +++- .../Locale/en-US/chat/managers/chat-manager.ftl | 13 +++++++++---- .../Locale/en-US/headset/headset-component.ftl | 4 ++-- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/Content.Server/Chat/Systems/ChatSystem.cs b/Content.Server/Chat/Systems/ChatSystem.cs index f322aef7e5..c75e32d818 100644 --- a/Content.Server/Chat/Systems/ChatSystem.cs +++ b/Content.Server/Chat/Systems/ChatSystem.cs @@ -964,7 +964,7 @@ public string WrapMessage(LocId wrapId, InGameICChatType chatType, EntityUid sou if (language.SpeechOverride.Color is { } colorOverride) color = Color.InterpolateBetween(color, colorOverride, colorOverride.A); var languageDisplay = language.IsVisibleLanguage - ? $"{language.ChatName} | " + ? Loc.GetString("chat-manager-language-prefix", ("language", language.ChatName)) : ""; return Loc.GetString(wrapId, diff --git a/Content.Server/Radio/EntitySystems/RadioSystem.cs b/Content.Server/Radio/EntitySystems/RadioSystem.cs index 71fb4ff502..66dadc85b5 100644 --- a/Content.Server/Radio/EntitySystems/RadioSystem.cs +++ b/Content.Server/Radio/EntitySystems/RadioSystem.cs @@ -167,12 +167,14 @@ private string WrapRadioMessage(EntityUid source, RadioChannelPrototype channel, if (language.SpeechOverride.Color is { } colorOverride) languageColor = Color.InterpolateBetween(languageColor, colorOverride, colorOverride.A); var languageDisplay = language.IsVisibleLanguage - ? $"{language.ChatName} | " + ? Loc.GetString("chat-manager-language-prefix", ("language", language.ChatName)) : ""; + var messageColor = language.IsVisibleLanguage ? languageColor : channel.Color; return Loc.GetString(speech.Bold ? "chat-radio-message-wrap-bold" : "chat-radio-message-wrap", ("color", channel.Color), ("languageColor", languageColor), + ("messageColor", messageColor), ("fontType", language.SpeechOverride.FontId ?? speech.FontId), ("fontSize", language.SpeechOverride.FontSize ?? speech.FontSize), ("verb", Loc.GetString(_random.Pick(speech.SpeechVerbStrings))), diff --git a/Resources/Locale/en-US/chat/managers/chat-manager.ftl b/Resources/Locale/en-US/chat/managers/chat-manager.ftl index 9db49d9436..171b7261f3 100644 --- a/Resources/Locale/en-US/chat/managers/chat-manager.ftl +++ b/Resources/Locale/en-US/chat/managers/chat-manager.ftl @@ -18,14 +18,19 @@ chat-manager-no-radio-key = No radio key specified! chat-manager-no-such-channel = There is no channel with key '{$key}'! chat-manager-whisper-headset-on-message = You can't whisper on the radio! +chat-manager-language-prefix = ({ $language }){" "} + 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][bold][Name]{ $language }{ $entityName }[/Name][/bold][/BubbleHeader] { $verb }, [font={ $fontType } size={ $fontSize } ]"[BubbleContent]{ $message }[/BubbleContent]"[/font] -chat-manager-entity-say-bold-wrap-message = [BubbleHeader][bold][Name]{ $language }{ $entityName }[/Name][/bold][/BubbleHeader] { $verb }, [font={ $fontType } size={ $fontSize }]"[BubbleContent][bold]{ $message }[/bold][/BubbleContent]"[/font] -chat-manager-entity-whisper-wrap-message = [font size=11][italic][BubbleHeader][Name]{ $language }{ $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][font="{$fontType}"][color={$color}]{$message}[/color][/font][/BubbleContent]"[/italic][/font] +# For the message in double quotes, the font/color/bold/italic elements are repeated twice, outside the double quotes and inside. +# The outside elements are for formatting the double quotes, and the inside elements are for formatting the text in speech bubbles ([BubbleContent]). +chat-manager-entity-say-wrap-message = [BubbleHeader][Name][font size=11][color={$color}][bold]{$language}[/bold][/color][/font][bold]{$entityName}[/bold][/Name][/BubbleHeader] {$verb}, [font="{$fontType}" size={$fontSize} ][color={$color}]"[BubbleContent][font="{$fontType}" size={$fontSize}][color={$color}]{$message}[/color][/font][/BubbleContent]"[/color][/font] +chat-manager-entity-say-bold-wrap-message = [BubbleHeader][Name][font size=11][color={$color}][bold]{$language}[/bold][/color][/font][bold]{$entityName}[/bold][/Name][/BubbleHeader] {$verb}, [font="{$fontType}" size={$fontSize} ][color={$color}][bold]"[BubbleContent][font="{$fontType}" size={$fontSize}][color={$color}][bold]{$message}[/bold][/color][/font][/BubbleContent]"[/bold][/color][/font] + +chat-manager-entity-whisper-wrap-message = [BubbleHeader][Name][font size=10][color={$color}][bold]{$language}[/bold][/color][/font][font size=11][italic]{$entityName}[/Name][/BubbleHeader] whispers, [font="{$fontType}"][color={$color}][italic]"[BubbleContent][font="{$fontType}"][color={$color}][italic]{$message}[/italic][/color][/font][/BubbleContent]"[/italic][/color][/font][/italic][/font] +chat-manager-entity-whisper-unknown-wrap-message = [BubbleHeader][font size=10][color={$color}][bold]{$language}[/bold][/color][/font][font size=11][italic]Someone[/BubbleHeader] whispers, [font="{$fontType}"][color={$color}][italic]"[BubbleContent][font="{$fontType}"][color={$color}][italic]{$message}[/italic][/color][/font][/BubbleContent]"[/italic][/color][/font][/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 3f89dde13a..8d759e237a 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 } [bold]{ $language }{ $name }[/bold] { $verb }, [font={ $fontType } size={ $fontSize }]"{ $message }"[/font][/color] -chat-radio-message-wrap-bold = [color={ $color }]{ $channel } [bold]{ $language }{ $name }[/bold] { $verb }, [font={ $fontType } size={ $fontSize }][bold]"{ $message }"[/bold][/font][/color] +chat-radio-message-wrap = [color={$color}]{$channel} [font size=11][color={$languageColor}][bold]{$language}[/bold][/color][/font][bold]{$name}[/bold] {$verb}, [font="{$fontType}" size={$fontSize}][color={$messageColor}]"{$message}"[/color][/font][/color] +chat-radio-message-wrap-bold = [color={$color}]{$channel} [font size=11][color={$languageColor}][bold]{$language}[/bold][/color][/font][bold]{$name}[/bold] {$verb}, [font="{$fontType}" size={$fontSize}][color={$messageColor}][bold]"{$message}"[/bold][/color][/font][/color] examine-headset-default-channel = Use {$prefix} for the default channel ([color={$color}]{$channel}[/color]).