diff --git a/Content.Client/Prayer/PrayerSystem.cs b/Content.Client/Prayer/PrayerSystem.cs deleted file mode 100644 index 30f4a647da..0000000000 --- a/Content.Client/Prayer/PrayerSystem.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Content.Shared.Administration; -using Content.Shared.Prayer; - -namespace Content.Client.Prayer; -/// -/// System to handle subtle messages and praying -/// -public sealed class PrayerSystem : SharedPrayerSystem -{ - protected override void OnPrayerTextMessage(PrayerTextMessage message, EntitySessionEventArgs eventArgs) - { - var bwoinkMessage = new SharedBwoinkSystem.BwoinkTextMessage(eventArgs.SenderSession.UserId, - eventArgs.SenderSession.UserId, message.Text); - - RaiseNetworkEvent(bwoinkMessage); - } -} diff --git a/Content.Server/Prayer/PrayerSystem.cs b/Content.Server/Prayer/PrayerSystem.cs index 655ebb62b4..ccd1bf8bab 100644 --- a/Content.Server/Prayer/PrayerSystem.cs +++ b/Content.Server/Prayer/PrayerSystem.cs @@ -7,7 +7,6 @@ using Content.Shared.Popups; using Robust.Server.Player; using Robust.Shared.Player; using Content.Shared.Chat; -using Content.Shared.Prayer; using Content.Shared.Verbs; using Robust.Server.GameObjects; @@ -15,7 +14,10 @@ namespace Content.Server.Prayer; /// /// System to handle subtle messages and praying /// -public sealed class PrayerSystem : SharedPrayerSystem +/// +/// Rain is a professional developer and this did not take 2 PRs to fix subtle messages +/// +public sealed class PrayerSystem : EntitySystem { [Dependency] private readonly PopupSystem _popupSystem = default!; [Dependency] private readonly IChatManager _chatManager = default!; @@ -34,24 +36,29 @@ public sealed class PrayerSystem : SharedPrayerSystem if (!EntityManager.TryGetComponent(args.User, out var actor)) return; + // this is to prevent ghosts from using it if (!args.CanAccess) return; - ActivationVerb prayerVerb = new(); - prayerVerb.Text = Loc.GetString("prayer-verbs-pray"); - prayerVerb.IconTexture = "/Textures/Interface/pray.svg.png"; - prayerVerb.Act = () => + var prayerVerb = new ActivationVerb { - if (comp.BibleUserOnly && !EntityManager.TryGetComponent(args.User, out var bibleUser)) + Text = Loc.GetString("prayer-verbs-pray"), + IconTexture = "/Textures/Interface/pray.svg.png", + Act = () => { - _popupSystem.PopupEntity(Loc.GetString("prayer-popup-notify-locked"), uid, Filter.Empty().AddPlayer(actor.PlayerSession), PopupType.Large); - return; - } + if (comp.BibleUserOnly && !EntityManager.TryGetComponent(args.User, out var bibleUser)) + { + _popupSystem.PopupEntity(Loc.GetString("prayer-popup-notify-locked"), uid, Filter.Empty().AddPlayer(actor.PlayerSession), PopupType.Large); + return; + } + + _quickDialog.OpenDialog(actor.PlayerSession, "Pray", "Message", (string message) => + { + Pray(actor.PlayerSession, message); + }); + }, + Impact = LogImpact.Low, - _quickDialog.OpenDialog(actor.PlayerSession, "Pray", "Message", (string message) => - { - Pray(actor.PlayerSession, message); - }); }; prayerVerb.Impact = LogImpact.Low; args.Verbs.Add(prayerVerb); @@ -68,8 +75,10 @@ public sealed class PrayerSystem : SharedPrayerSystem if (target.AttachedEntity == null) return; + var message = popupMessage == "" ? "" : popupMessage + $" \"{messageString}\""; + _popupSystem.PopupEntity(popupMessage, target.AttachedEntity.Value, Filter.Empty().AddPlayer(target), PopupType.Large); - _chatManager.ChatMessageToOne(ChatChannel.Local, messageString, popupMessage + " \"{message}\"", EntityUid.Invalid, false, target.ConnectedClient); + _chatManager.ChatMessageToOne(ChatChannel.Local, messageString, message, EntityUid.Invalid, false, target.ConnectedClient); } /// @@ -86,10 +95,9 @@ public sealed class PrayerSystem : SharedPrayerSystem if (sender.AttachedEntity == null) return; + _popupSystem.PopupEntity(Loc.GetString("prayer-popup-notify-sent"), sender.AttachedEntity.Value, Filter.Empty().AddPlayer(sender), PopupType.Medium); - var networkMessage = new PrayerTextMessage(Loc.GetString("prayer-chat-notify", ("message", message))); - - RaiseNetworkEvent(networkMessage, sender); + _chatManager.SendAdminAnnouncement(Loc.GetString("prayer-chat-notify", ("name", sender.Name), ("message", message))); } } diff --git a/Content.Shared/Prayer/SharedPrayerSystem.cs b/Content.Shared/Prayer/SharedPrayerSystem.cs deleted file mode 100644 index fafdbfe043..0000000000 --- a/Content.Shared/Prayer/SharedPrayerSystem.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Robust.Shared.Serialization; - -namespace Content.Shared.Prayer; - -/// -/// Shared system for handling Prayers -/// -public abstract class SharedPrayerSystem : EntitySystem -{ - public override void Initialize() - { - SubscribeNetworkEvent(OnPrayerTextMessage); - } - - protected virtual void OnPrayerTextMessage(PrayerTextMessage message, EntitySessionEventArgs eventArgs) - { - // Specific side code in target. - } - - [Serializable, NetSerializable] - public sealed class PrayerTextMessage : EntityEventArgs - { - public string Text { get; } - - public PrayerTextMessage(string text) - { - Text = text; - } - } -} diff --git a/Resources/Locale/en-US/prayers/prayers.ftl b/Resources/Locale/en-US/prayers/prayers.ftl index 09e9759e03..3b7a399197 100644 --- a/Resources/Locale/en-US/prayers/prayers.ftl +++ b/Resources/Locale/en-US/prayers/prayers.ftl @@ -1,6 +1,6 @@ prayer-verbs-subtle-message = Subtle Message prayer-verbs-pray = Pray -prayer-chat-notify = PRAYER: {$message} +prayer-chat-notify = PRAYER: <{$name}>: {$message} prayer-popup-subtle-default = You hear a voice in your head... prayer-popup-notify-sent = Your message has been sent to the gods...