Skip to content

Commit

Permalink
TooLoud
Browse files Browse the repository at this point in the history
  • Loading branch information
Vonsant committed Dec 11, 2024
1 parent 7b4b3c3 commit d2670d4
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Content.Server/Chat/Systems/ChatSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
using Content.Shared.Players.RateLimiting;
using Content.Shared.Radio;
using Content.Shared.Whitelist;
using Content.Shared.Speech.Hushing;
using Robust.Server.Player;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
Expand Down Expand Up @@ -217,6 +218,15 @@ public void TrySendInGameICMessage(
checkRadioPrefix = false;
message = message[1..];
}

// Corvax-Next-Hushed-Start
// This needs to happen after prefix removal to avoid bug
if (desiredType == InGameICChatType.Speak && HasComp<HushedComponent>(source))
{
// hushed players cannot speak on local chat so will be sent as whisper instead
desiredType = InGameICChatType.Whisper;
}
// Corvax-Next-Hushed-End

bool shouldCapitalize = (desiredType != InGameICChatType.Emote);
bool shouldPunctuate = _configurationManager.GetCVar(CCVars.ChatPunctuation);
Expand Down
6 changes: 6 additions & 0 deletions Content.Shared/_CorvaxNext/Speech/HushedComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
using Robust.Shared.GameStates;

namespace Content.Shared.Speech.Hushing;

[RegisterComponent, NetworkedComponent]
public sealed partial class HushedComponent : Component;
2 changes: 2 additions & 0 deletions Resources/Locale/ru-RU/_CorvaxNext/traits/traits.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
trait-hushed-name = Тихоня
trait-hushed-desc = Вы слишком скромны и можете говорить только шёпотом.
11 changes: 11 additions & 0 deletions Resources/Prototypes/_CorvaxNext/Traits/speech.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
- type: trait
id: Hushed
name: trait-hushed-name
description: trait-hushed-desc
category: SpeechTraits
cost: 1
blacklist:
components:
- BorgChassis
components:
- type: Hushed

0 comments on commit d2670d4

Please sign in to comment.