From 8e053ae31a697cf0c2c6a43c70653ceadffe1ce9 Mon Sep 17 00:00:00 2001 From: Vonsant Date: Wed, 1 Jan 2025 06:29:32 +0300 Subject: [PATCH 1/7] HushedUpdate --- .../Speech/EntitySystems/HushedSystem.cs | 52 +++++++++++++++++++ .../_corvaxnext/speech/speech-effects.ftl | 2 + .../ru-RU/_corvaxnext/traits/traits.ftl | 2 +- .../Prototypes/_CorvaxNext/Traits/speech.yml | 3 +- 4 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 Content.Server/_CorvaxNext/Speech/EntitySystems/HushedSystem.cs create mode 100644 Resources/Locale/ru-RU/_corvaxnext/speech/speech-effects.ftl diff --git a/Content.Server/_CorvaxNext/Speech/EntitySystems/HushedSystem.cs b/Content.Server/_CorvaxNext/Speech/EntitySystems/HushedSystem.cs new file mode 100644 index 00000000000..f403b77dac6 --- /dev/null +++ b/Content.Server/_CorvaxNext/Speech/EntitySystems/HushedSystem.cs @@ -0,0 +1,52 @@ +using Content.Server.Popups; +using Content.Server.Speech.EntitySystems; +using Content.Server.Chat.Systems; +using Content.Shared.Speech; +using Content.Shared.Speech.Muting; +using Content.Shared.Speech.Hushing; +using Content.Shared.Chat.Prototypes; +using Content.Shared.Puppet; +using Content.Shared.Actions; +using Robust.Shared.Player; + +namespace Content.Server._CorvaxNext.Speech.EntitySystems +{ + public sealed class HushedSystem : EntitySystem + { + [Dependency] private readonly PopupSystem _popupSystem = default!; + + public override void Initialize() + { + SubscribeLocalEvent(OnScreamAction, before: new[] { typeof(VocalSystem) }); + SubscribeLocalEvent(OnEmote, before: new[] { typeof(VocalSystem) }); + } + + private void OnScreamAction(EntityUid uid, HushedComponent component, ScreamActionEvent args) + { + if (args.Handled) + return; + + if (HasComp(uid)) + return; + + _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; + + if (HasComp(uid)) + return; + + if (args.Emote.Category.HasFlag(EmoteCategory.Vocal)) + { + _popupSystem.PopupEntity(Loc.GetString("speech-hushed-vocal-emote-blocked"), uid, uid); + + args.Handled = true; + } + } + } +} diff --git a/Resources/Locale/ru-RU/_corvaxnext/speech/speech-effects.ftl b/Resources/Locale/ru-RU/_corvaxnext/speech/speech-effects.ftl new file mode 100644 index 00000000000..92f930e4cf2 --- /dev/null +++ b/Resources/Locale/ru-RU/_corvaxnext/speech/speech-effects.ftl @@ -0,0 +1,2 @@ +speech-hushed-scream-blocked = Вы слишком скромны для крика. +speech-hushed-vocal-emote-blocked = Вы чувствуете себя неуверенно. diff --git a/Resources/Locale/ru-RU/_corvaxnext/traits/traits.ftl b/Resources/Locale/ru-RU/_corvaxnext/traits/traits.ftl index 99234245842..ca416b903b0 100644 --- a/Resources/Locale/ru-RU/_corvaxnext/traits/traits.ftl +++ b/Resources/Locale/ru-RU/_corvaxnext/traits/traits.ftl @@ -1,2 +1,2 @@ trait-hushed-name = Тихоня -trait-hushed-desc = Вы слишком скромны и можете говорить только шёпотом. \ No newline at end of file +trait-hushed-desc = Вы слишком скромны и можете говорить только шёпотом. diff --git a/Resources/Prototypes/_CorvaxNext/Traits/speech.yml b/Resources/Prototypes/_CorvaxNext/Traits/speech.yml index b2bc2e907f8..18d678b2843 100644 --- a/Resources/Prototypes/_CorvaxNext/Traits/speech.yml +++ b/Resources/Prototypes/_CorvaxNext/Traits/speech.yml @@ -8,4 +8,5 @@ components: - BorgChassis components: - - type: Hushed \ No newline at end of file + - type: Hushed + \ No newline at end of file From 6cc3bdb60d4cd1bdf5913e2ccfb42ee49f7eb236 Mon Sep 17 00:00:00 2001 From: Kill_Me_I_Noobs <118206719+Vonsant@users.noreply.github.com> Date: Wed, 1 Jan 2025 08:11:23 +0300 Subject: [PATCH 2/7] Update Content.Server/_CorvaxNext/Speech/EntitySystems/HushedSystem.cs Co-authored-by: FN <37689533+FireNameFN@users.noreply.github.com> --- .../_CorvaxNext/Speech/EntitySystems/HushedSystem.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Content.Server/_CorvaxNext/Speech/EntitySystems/HushedSystem.cs b/Content.Server/_CorvaxNext/Speech/EntitySystems/HushedSystem.cs index f403b77dac6..74a6c4f3050 100644 --- a/Content.Server/_CorvaxNext/Speech/EntitySystems/HushedSystem.cs +++ b/Content.Server/_CorvaxNext/Speech/EntitySystems/HushedSystem.cs @@ -17,8 +17,8 @@ public sealed class HushedSystem : EntitySystem public override void Initialize() { - SubscribeLocalEvent(OnScreamAction, before: new[] { typeof(VocalSystem) }); - SubscribeLocalEvent(OnEmote, before: new[] { typeof(VocalSystem) }); + SubscribeLocalEvent(OnScreamAction, [typeof(VocalSystem)]); + SubscribeLocalEvent(OnEmote, before: [typeof(VocalSystem)]); } private void OnScreamAction(EntityUid uid, HushedComponent component, ScreamActionEvent args) From f078dcae96ef181762ac5e77ab7cbcfd540909c9 Mon Sep 17 00:00:00 2001 From: Kill_Me_I_Noobs <118206719+Vonsant@users.noreply.github.com> Date: Wed, 1 Jan 2025 08:11:41 +0300 Subject: [PATCH 3/7] Update speech.yml --- Resources/Prototypes/_CorvaxNext/Traits/speech.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/Resources/Prototypes/_CorvaxNext/Traits/speech.yml b/Resources/Prototypes/_CorvaxNext/Traits/speech.yml index 18d678b2843..f86579941ae 100644 --- a/Resources/Prototypes/_CorvaxNext/Traits/speech.yml +++ b/Resources/Prototypes/_CorvaxNext/Traits/speech.yml @@ -9,4 +9,3 @@ - BorgChassis components: - type: Hushed - \ No newline at end of file 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 4/7] 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; } } From a26827c72a5095f42bafc85144670428aad4db79 Mon Sep 17 00:00:00 2001 From: Kill_Me_I_Noobs <118206719+Vonsant@users.noreply.github.com> Date: Wed, 1 Jan 2025 08:30:07 +0300 Subject: [PATCH 5/7] Update speech-effects.ftl --- Resources/Locale/ru-RU/_corvaxnext/speech/speech-effects.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/Locale/ru-RU/_corvaxnext/speech/speech-effects.ftl b/Resources/Locale/ru-RU/_corvaxnext/speech/speech-effects.ftl index 92f930e4cf2..6a30e0248df 100644 --- a/Resources/Locale/ru-RU/_corvaxnext/speech/speech-effects.ftl +++ b/Resources/Locale/ru-RU/_corvaxnext/speech/speech-effects.ftl @@ -1,2 +1,2 @@ speech-hushed-scream-blocked = Вы слишком скромны для крика. -speech-hushed-vocal-emote-blocked = Вы чувствуете себя неуверенно. +speech-hushed-vocal-emote-blocked = Вы чувствуете себя некомфортно. From 1bac56226cf5244d76a2988e13fde5e70dade0aa Mon Sep 17 00:00:00 2001 From: Kill_Me_I_Noobs <118206719+Vonsant@users.noreply.github.com> Date: Wed, 1 Jan 2025 14:41:17 +0300 Subject: [PATCH 6/7] Update HushedSystem.cs --- .../_CorvaxNext/Speech/EntitySystems/HushedSystem.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Content.Server/_CorvaxNext/Speech/EntitySystems/HushedSystem.cs b/Content.Server/_CorvaxNext/Speech/EntitySystems/HushedSystem.cs index 48183ca8823..0d65738fe25 100644 --- a/Content.Server/_CorvaxNext/Speech/EntitySystems/HushedSystem.cs +++ b/Content.Server/_CorvaxNext/Speech/EntitySystems/HushedSystem.cs @@ -17,8 +17,8 @@ public sealed class HushedSystem : EntitySystem public override void Initialize() { - SubscribeLocalEvent(OnScreamAction, new[] { typeof(VocalSystem) }); - SubscribeLocalEvent(OnEmote, before: new[] { typeof(VocalSystem) }); + SubscribeLocalEvent(OnScreamAction, [typeof(VocalSystem)]); + SubscribeLocalEvent(OnEmote, before: [typeof(VocalSystem)]); } private void OnScreamAction(EntityUid uid, HushedComponent component, ScreamActionEvent args) From 5f87a03652a398740d423d53bd79403395b197f1 Mon Sep 17 00:00:00 2001 From: Kill_Me_I_Noobs <118206719+Vonsant@users.noreply.github.com> Date: Wed, 1 Jan 2025 14:54:19 +0300 Subject: [PATCH 7/7] Update HushedSystem.cs --- Content.Server/_CorvaxNext/Speech/EntitySystems/HushedSystem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Content.Server/_CorvaxNext/Speech/EntitySystems/HushedSystem.cs b/Content.Server/_CorvaxNext/Speech/EntitySystems/HushedSystem.cs index 0d65738fe25..6e3d5d65710 100644 --- a/Content.Server/_CorvaxNext/Speech/EntitySystems/HushedSystem.cs +++ b/Content.Server/_CorvaxNext/Speech/EntitySystems/HushedSystem.cs @@ -17,7 +17,7 @@ public sealed class HushedSystem : EntitySystem public override void Initialize() { - SubscribeLocalEvent(OnScreamAction, [typeof(VocalSystem)]); + SubscribeLocalEvent(OnScreamAction, before: [typeof(VocalSystem)]); SubscribeLocalEvent(OnEmote, before: [typeof(VocalSystem)]); }