From 0cb636d255bbf7800cfb47dad10ffd2fa4823ff6 Mon Sep 17 00:00:00 2001 From: Kill_Me_I_Noobs <118206719+Vonsant@users.noreply.github.com> Date: Wed, 1 Jan 2025 08:25:25 +0300 Subject: [PATCH] Update HushedSystem.cs --- .../Speech/EntitySystems/HushedSystem.cs | 58 +++++++++---------- 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/Content.Server/_CorvaxNext/Speech/EntitySystems/HushedSystem.cs b/Content.Server/_CorvaxNext/Speech/EntitySystems/HushedSystem.cs index 74a6c4f3050..48183ca8823 100644 --- a/Content.Server/_CorvaxNext/Speech/EntitySystems/HushedSystem.cs +++ b/Content.Server/_CorvaxNext/Speech/EntitySystems/HushedSystem.cs @@ -9,44 +9,42 @@ using Content.Shared.Actions; using Robust.Shared.Player; -namespace Content.Server._CorvaxNext.Speech.EntitySystems +namespace Content.Server._CorvaxNext.Speech.EntitySystems; + +public sealed class HushedSystem : EntitySystem { - public sealed class HushedSystem : EntitySystem - { - [Dependency] private readonly PopupSystem _popupSystem = default!; + [Dependency] private readonly PopupSystem _popupSystem = default!; - public override void Initialize() - { - SubscribeLocalEvent(OnScreamAction, [typeof(VocalSystem)]); - SubscribeLocalEvent(OnEmote, before: [typeof(VocalSystem)]); - } + public override void Initialize() + { + SubscribeLocalEvent(OnScreamAction, new[] { typeof(VocalSystem) }); + SubscribeLocalEvent(OnEmote, before: new[] { typeof(VocalSystem) }); + } - private void OnScreamAction(EntityUid uid, HushedComponent component, ScreamActionEvent args) - { - if (args.Handled) - return; + private void OnScreamAction(EntityUid uid, HushedComponent component, ScreamActionEvent args) + { + if (args.Handled) + return; - if (HasComp(uid)) - return; + if (HasComp(uid)) + return; - _popupSystem.PopupEntity(Loc.GetString("speech-hushed-scream-blocked"), uid, uid); - args.Handled = true; - } + _popupSystem.PopupEntity(Loc.GetString("speech-hushed-scream-blocked"), uid, uid); + args.Handled = true; + } - private void OnEmote(EntityUid uid, HushedComponent component, ref EmoteEvent args) - { - if (args.Handled) - return; + private void OnEmote(EntityUid uid, HushedComponent component, ref EmoteEvent args) + { + if (args.Handled) + return; - if (HasComp(uid)) - return; + if (HasComp(uid)) + return; - if (args.Emote.Category.HasFlag(EmoteCategory.Vocal)) - { - _popupSystem.PopupEntity(Loc.GetString("speech-hushed-vocal-emote-blocked"), uid, uid); + if (!args.Emote.Category.HasFlag(EmoteCategory.Vocal)) + return; - args.Handled = true; - } - } + _popupSystem.PopupEntity(Loc.GetString("speech-hushed-vocal-emote-blocked"), uid, uid); + args.Handled = true; } }