Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #134 from FireNameFN/FixChatPrefix
Browse files Browse the repository at this point in the history
Fixed radio prefixes
  • Loading branch information
Zekins3366 authored May 8, 2024
2 parents 13df740 + 92f7f65 commit 48d72b0
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 13 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 @@ -255,7 +255,7 @@ public void TrySendInGameICMessage(
{
if (TryProccessRadioMessage(source, message, out var modMessage, out var channel))
{
SendEntityWhisper(source, message, language, range, channel, nameOverride, hideLog, ignoreActionBlocker);
SendEntityWhisper(source, modMessage, language, range, channel, nameOverride, hideLog, ignoreActionBlocker);
return;
}
}
Expand Down
15 changes: 4 additions & 11 deletions Content.Server/Radio/EntitySystems/RadioSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,20 +114,13 @@ public void SendRadioMessage(EntityUid messageSource, LanguageMessage message, R
name = FormattedMessage.EscapeText(name);

SpeechVerbPrototype speech;
SpeechVerbPrototype? languageSpeech;
if (mask != null
&& mask.Enabled
&& mask.SpeechVerb != null
&& _prototype.TryIndex<SpeechVerbPrototype>(mask.SpeechVerb, out var proto))
{
speech = proto;
languageSpeech = proto;
}
else
{
speech = _chat.GetSpeechVerb(messageSource, message.OriginalMessage);
languageSpeech = message.Message is not null ? _chat.GetSpeechVerb(messageSource, message.Message) : null;
}

var content = escapeMarkup
? FormattedMessage.EscapeText(message.OriginalMessage)
Expand All @@ -146,11 +139,11 @@ public void SendRadioMessage(EntityUid messageSource, LanguageMessage message, R
("name", name),
("message", content));

var wrappedLanguageMessage = languageContent is not null ? Loc.GetString(languageSpeech!.Bold ? "chat-radio-message-wrap-bold" : "chat-radio-message-wrap",
var wrappedLanguageMessage = languageContent is not null ? Loc.GetString(speech!.Bold ? "chat-radio-message-wrap-bold" : "chat-radio-message-wrap",
("color", channel.Color),
("fontType", languageSpeech.FontId),
("fontSize", languageSpeech.FontSize),
("verb", Loc.GetString(_random.Pick(languageSpeech.SpeechVerbStrings))),
("fontType", speech.FontId),
("fontSize", speech.FontSize),
("verb", Loc.GetString(_random.Pick(speech.SpeechVerbStrings))),
("channel", $"\\[{channel.LocalizedName}\\]"),
("name", name),
("message", languageContent)) : null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
CapacitorStockPart: 8
MicroManipulatorStockPart: 8
Beaker: 8 # Frontier - beakers are required for some machines
VulpTranslator: 10
Translator: 10 # Corvax-Frontier
AirFreshener: 10
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,13 @@
layers:
- state: icon
- type: LanguageTranslator

- type: entity
id: EmptyTranslator
parent: Translator
suffix: Empty
components:
- type: ItemSlots
slots:
cell_slot:
name: power-cell-slot-component-slot-name-default
8 changes: 8 additions & 0 deletions Resources/Prototypes/Corvax/Lathes/tools.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- type: latheRecipe
id: Translator
result: EmptyTranslator
category: Tools
completetime: 2
materials:
Steel: 200
Plastic: 200
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
- Wrench
- Crowbar
- Multitool
- Translator # Corvax-Frontier
- NetworkConfigurator
- SprayPainter
- FlashlightLantern
Expand Down

0 comments on commit 48d72b0

Please sign in to comment.