Skip to content

Commit

Permalink
Re-Enable Language Color and Font (#1294)
Browse files Browse the repository at this point in the history
# Description

Re-enables language font and colors showing up in chat messages. The
language font/colors were bugged after adding language names in chat
(#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.
  • Loading branch information
angelofallars authored Nov 29, 2024
1 parent 8d485e8 commit 1a97635
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Content.Server/Chat/Systems/ChatSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,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,
Expand Down
4 changes: 3 additions & 1 deletion Content.Server/Radio/EntitySystems/RadioSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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))),
Expand Down
13 changes: 9 additions & 4 deletions Resources/Locale/en-US/chat/managers/chat-manager.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -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) ->
Expand Down
4 changes: 2 additions & 2 deletions Resources/Locale/en-US/headset/headset-component.ftl
Original file line number Diff line number Diff line change
@@ -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]).
Expand Down

0 comments on commit 1a97635

Please sign in to comment.