diff --git a/Content.Server/Access/Systems/IdCardConsoleSystem.cs b/Content.Server/Access/Systems/IdCardConsoleSystem.cs index 13f2430b3d..d5f1947d87 100644 --- a/Content.Server/Access/Systems/IdCardConsoleSystem.cs +++ b/Content.Server/Access/Systems/IdCardConsoleSystem.cs @@ -7,6 +7,7 @@ using static Content.Shared.Access.Components.IdCardConsoleComponent; using Content.Shared.Access.Systems; using Content.Shared.Access; using Content.Shared.Administration.Logs; +using Content.Shared.Chat; using Content.Shared.Construction; using Content.Shared.Containers.ItemSlots; using Content.Shared.Damage; diff --git a/Content.Server/Administration/Commands/DSay.cs b/Content.Server/Administration/Commands/DSay.cs index f5e0b32793..60f81fce5d 100644 --- a/Content.Server/Administration/Commands/DSay.cs +++ b/Content.Server/Administration/Commands/DSay.cs @@ -1,5 +1,6 @@ using Content.Server.Chat.Systems; using Content.Shared.Administration; +using Content.Shared.Chat; using Robust.Shared.Console; namespace Content.Server.Administration.Commands; diff --git a/Content.Server/Administration/Commands/OSay.cs b/Content.Server/Administration/Commands/OSay.cs index 2f17bd9d70..9c5a20ef69 100644 --- a/Content.Server/Administration/Commands/OSay.cs +++ b/Content.Server/Administration/Commands/OSay.cs @@ -2,6 +2,7 @@ using System.Linq; using Content.Server.Administration.Logs; using Content.Server.Chat.Systems; using Content.Shared.Administration; +using Content.Shared.Chat; using Content.Shared.Database; using Robust.Shared.Console; diff --git a/Content.Server/Advertise/EntitySystems/SpeakOnUIClosedSystem.cs b/Content.Server/Advertise/EntitySystems/SpeakOnUIClosedSystem.cs index 94b20c7b77..812a016b37 100644 --- a/Content.Server/Advertise/EntitySystems/SpeakOnUIClosedSystem.cs +++ b/Content.Server/Advertise/EntitySystems/SpeakOnUIClosedSystem.cs @@ -1,6 +1,7 @@ using Content.Server.Chat.Systems; using Content.Shared.Advertise.Components; using Content.Shared.Advertise.Systems; +using Content.Shared.Chat; using Content.Shared.UserInterface; using Robust.Shared.Prototypes; using Robust.Shared.Random; diff --git a/Content.Server/Chat/Commands/LOOCCommand.cs b/Content.Server/Chat/Commands/LOOCCommand.cs index e303b9766d..3737b5d518 100644 --- a/Content.Server/Chat/Commands/LOOCCommand.cs +++ b/Content.Server/Chat/Commands/LOOCCommand.cs @@ -1,5 +1,6 @@ using Content.Server.Chat.Systems; using Content.Shared.Administration; +using Content.Shared.Chat; using Robust.Shared.Console; using Robust.Shared.Enums; diff --git a/Content.Server/Chat/Systems/ChatSystem.cs b/Content.Server/Chat/Systems/ChatSystem.cs index 4ec86df54b..ea4810992d 100644 --- a/Content.Server/Chat/Systems/ChatSystem.cs +++ b/Content.Server/Chat/Systems/ChatSystem.cs @@ -120,42 +120,24 @@ public sealed partial class ChatSystem : SharedChatSystem } } - /// - /// Sends an in-character chat message to relevant clients. - /// - /// The entity that is speaking - /// The message being spoken or emoted - /// The chat type - /// Whether or not this message should appear in the chat window - /// Whether or not this message should appear in the adminlog window - /// - /// The player doing the speaking - /// The name to use for the speaking entity. Usually this should just be modified via . If this is set, the event will not get raised. - public void TrySendInGameICMessage( + /// + public override void TrySendInGameICMessage( EntityUid source, string message, InGameICChatType desiredType, - bool hideChat, bool hideLog = false, + bool hideChat, + bool hideLog = false, IConsoleShell? shell = null, - ICommonSession? player = null, string? nameOverride = null, + ICommonSession? player = null, + string? nameOverride = null, bool checkRadioPrefix = true, bool ignoreActionBlocker = false) { TrySendInGameICMessage(source, message, desiredType, hideChat ? ChatTransmitRange.HideChat : ChatTransmitRange.Normal, hideLog, shell, player, nameOverride, checkRadioPrefix, ignoreActionBlocker); } - /// - /// Sends an in-character chat message to relevant clients. - /// - /// The entity that is speaking - /// The message being spoken or emoted - /// The chat type - /// Conceptual range of transmission, if it shows in the chat window, if it shows to far-away ghosts or ghosts at all... - /// - /// The player doing the speaking - /// The name to use for the speaking entity. Usually this should just be modified via . If this is set, the event will not get raised. - /// If set to true, action blocker will not be considered for whether an entity can send this message. - public void TrySendInGameICMessage( + /// + public override void TrySendInGameICMessage( EntityUid source, string message, InGameICChatType desiredType, @@ -252,7 +234,8 @@ public sealed partial class ChatSystem : SharedChatSystem } } - public void TrySendInGameOOCMessage( + /// + public override void TrySendInGameOOCMessage( EntityUid source, string message, InGameOOCChatType type, @@ -301,14 +284,8 @@ public sealed partial class ChatSystem : SharedChatSystem #region Announcements - /// - /// Dispatches an announcement to all. - /// - /// The contents of the message - /// The sender (Communications Console in Communications Console Announcement) - /// Play the announcement sound - /// Optional color for the announcement message - public void DispatchGlobalAnnouncement( + /// + public override void DispatchGlobalAnnouncement( string message, string? sender = null, bool playSound = true, @@ -327,17 +304,8 @@ public sealed partial class ChatSystem : SharedChatSystem _adminLogger.Add(LogType.Chat, LogImpact.Low, $"Global station announcement from {sender}: {message}"); } - /// - /// Dispatches an announcement to players selected by filter. - /// - /// Filter to select players who will recieve the announcement - /// The contents of the message - /// The entity making the announcement (used to determine the station) - /// The sender (Communications Console in Communications Console Announcement) - /// Play the announcement sound - /// Sound to play - /// Optional color for the announcement message - public void DispatchFilteredAnnouncement( + /// + public override void DispatchFilteredAnnouncement( Filter filter, string message, EntityUid? source = null, @@ -357,15 +325,8 @@ public sealed partial class ChatSystem : SharedChatSystem _adminLogger.Add(LogType.Chat, LogImpact.Low, $"Station Announcement from {sender}: {message}"); } - /// - /// Dispatches an announcement on a specific station - /// - /// The entity making the announcement (used to determine the station) - /// The contents of the message - /// The sender (Communications Console in Communications Console Announcement) - /// Play the announcement sound - /// Optional color for the announcement message - public void DispatchStationAnnouncement( + /// + public override void DispatchStationAnnouncement( EntityUid source, string message, string? sender = null, @@ -904,74 +865,3 @@ public sealed partial class ChatSystem : SharedChatSystem public record ExpandICChatRecipientsEvent(EntityUid Source, float VoiceRange, Dictionary Recipients) { } - -/// -/// Raised broadcast in order to transform speech.transmit -/// -public sealed class TransformSpeechEvent : EntityEventArgs -{ - public EntityUid Sender; - public string Message; - - public TransformSpeechEvent(EntityUid sender, string message) - { - Sender = sender; - Message = message; - } -} - -public sealed class CheckIgnoreSpeechBlockerEvent : EntityEventArgs -{ - public EntityUid Sender; - public bool IgnoreBlocker; - - public CheckIgnoreSpeechBlockerEvent(EntityUid sender, bool ignoreBlocker) - { - Sender = sender; - IgnoreBlocker = ignoreBlocker; - } -} - -/// -/// Raised on an entity when it speaks, either through 'say' or 'whisper'. -/// -public sealed class EntitySpokeEvent : EntityEventArgs -{ - public readonly EntityUid Source; - public readonly string Message; - public readonly string? ObfuscatedMessage; // not null if this was a whisper - - /// - /// If the entity was trying to speak into a radio, this was the channel they were trying to access. If a radio - /// message gets sent on this channel, this should be set to null to prevent duplicate messages. - /// - public RadioChannelPrototype? Channel; - - public EntitySpokeEvent(EntityUid source, string message, RadioChannelPrototype? channel, string? obfuscatedMessage) - { - Source = source; - Message = message; - Channel = channel; - ObfuscatedMessage = obfuscatedMessage; - } -} - -/// -/// InGame IC chat is for chat that is specifically ingame (not lobby) but is also in character, i.e. speaking. -/// -// ReSharper disable once InconsistentNaming -public enum InGameICChatType : byte -{ - Speak, - Emote, - Whisper -} - -/// -/// InGame OOC chat is for chat that is specifically ingame (not lobby) but is OOC, like deadchat or LOOC. -/// -public enum InGameOOCChatType : byte -{ - Looc, - Dead -} diff --git a/Content.Server/Cloning/CloningPodSystem.cs b/Content.Server/Cloning/CloningPodSystem.cs index 588b0c75a5..f413a1863f 100644 --- a/Content.Server/Cloning/CloningPodSystem.cs +++ b/Content.Server/Cloning/CloningPodSystem.cs @@ -11,6 +11,7 @@ using Content.Shared.Atmos; using Content.Shared.CCVar; using Content.Shared.Chemistry.Components; using Content.Shared.Cloning; +using Content.Shared.Chat; using Content.Shared.Damage; using Content.Shared.DeviceLinking.Events; using Content.Shared.Emag.Components; diff --git a/Content.Server/Delivery/DeliverySystem.cs b/Content.Server/Delivery/DeliverySystem.cs index 72d9427dff..496bc61a34 100644 --- a/Content.Server/Delivery/DeliverySystem.cs +++ b/Content.Server/Delivery/DeliverySystem.cs @@ -4,6 +4,7 @@ using Content.Server.Station.Systems; using Content.Server.StationRecords.Systems; using Content.Shared.Cargo.Components; using Content.Shared.Cargo.Prototypes; +using Content.Shared.Chat; using Content.Shared.Delivery; using Content.Shared.FingerprintReader; using Content.Shared.Labels.EntitySystems; diff --git a/Content.Server/Ghost/SpookySpeakerSystem.cs b/Content.Server/Ghost/SpookySpeakerSystem.cs index ce3a2705a0..e16c2cf9b3 100644 --- a/Content.Server/Ghost/SpookySpeakerSystem.cs +++ b/Content.Server/Ghost/SpookySpeakerSystem.cs @@ -1,5 +1,6 @@ using Content.Server.Chat.Systems; using Content.Server.Ghost.Components; +using Content.Shared.Chat; using Content.Shared.Random.Helpers; using Robust.Shared.Prototypes; using Robust.Shared.Random; diff --git a/Content.Server/Medical/DefibrillatorSystem.cs b/Content.Server/Medical/DefibrillatorSystem.cs index 94d62641ce..1578f11629 100644 --- a/Content.Server/Medical/DefibrillatorSystem.cs +++ b/Content.Server/Medical/DefibrillatorSystem.cs @@ -7,20 +7,17 @@ using Content.Server.Ghost; using Content.Server.Popups; using Content.Server.PowerCell; using Content.Shared.Traits.Assorted; +using Content.Shared.Chat; using Content.Shared.Damage; using Content.Shared.DoAfter; using Content.Shared.Interaction; -using Content.Shared.Interaction.Components; -using Content.Shared.Interaction.Events; using Content.Shared.Item.ItemToggle; using Content.Shared.Medical; using Content.Shared.Mind; using Content.Shared.Mobs; using Content.Shared.Mobs.Components; using Content.Shared.Mobs.Systems; -using Content.Shared.PowerCell; using Content.Shared.Timing; -using Content.Shared.Toggleable; using Robust.Shared.Audio.Systems; using Robust.Shared.Player; diff --git a/Content.Server/NPC/HTN/PrimitiveTasks/Operators/SayKeyOperator.cs b/Content.Server/NPC/HTN/PrimitiveTasks/Operators/SayKeyOperator.cs index 558b1fc04d..99227492af 100644 --- a/Content.Server/NPC/HTN/PrimitiveTasks/Operators/SayKeyOperator.cs +++ b/Content.Server/NPC/HTN/PrimitiveTasks/Operators/SayKeyOperator.cs @@ -1,4 +1,5 @@ using Content.Server.Chat.Systems; +using Content.Shared.Chat; namespace Content.Server.NPC.HTN.PrimitiveTasks.Operators; diff --git a/Content.Server/NPC/HTN/PrimitiveTasks/Operators/SpeakOperator.cs b/Content.Server/NPC/HTN/PrimitiveTasks/Operators/SpeakOperator.cs index f69a0771f9..f3b977518b 100644 --- a/Content.Server/NPC/HTN/PrimitiveTasks/Operators/SpeakOperator.cs +++ b/Content.Server/NPC/HTN/PrimitiveTasks/Operators/SpeakOperator.cs @@ -1,4 +1,5 @@ using Content.Server.Chat.Systems; +using Content.Shared.Chat; using Content.Shared.Dataset; using Content.Shared.Random.Helpers; using JetBrains.Annotations; diff --git a/Content.Server/NPC/HTN/PrimitiveTasks/Operators/Specific/MedibotInjectOperator.cs b/Content.Server/NPC/HTN/PrimitiveTasks/Operators/Specific/MedibotInjectOperator.cs index bac9cfcf40..20e3daec53 100644 --- a/Content.Server/NPC/HTN/PrimitiveTasks/Operators/Specific/MedibotInjectOperator.cs +++ b/Content.Server/NPC/HTN/PrimitiveTasks/Operators/Specific/MedibotInjectOperator.cs @@ -1,10 +1,7 @@ using Content.Server.Chat.Systems; -using Content.Shared.NPC.Components; +using Content.Shared.Chat; using Content.Shared.Chemistry.EntitySystems; -using Content.Shared.Damage; -using Content.Shared.Emag.Components; using Content.Shared.Interaction; -using Content.Shared.Mobs.Components; using Content.Shared.Popups; using Content.Shared.Silicons.Bots; using Robust.Shared.Audio.Systems; diff --git a/Content.Server/PowerSink/PowerSinkSystem.cs b/Content.Server/PowerSink/PowerSinkSystem.cs index df0980883d..d1071d3e38 100644 --- a/Content.Server/PowerSink/PowerSinkSystem.cs +++ b/Content.Server/PowerSink/PowerSinkSystem.cs @@ -1,4 +1,4 @@ -using Content.Server.Chat.Systems; +using Content.Server.Chat.Systems; using Content.Server.Explosion.EntitySystems; using Content.Server.Power.Components; using Content.Server.Power.EntitySystems; diff --git a/Content.Server/Radio/EntitySystems/HeadsetSystem.cs b/Content.Server/Radio/EntitySystems/HeadsetSystem.cs index 4d29e2f413..7d16687d5f 100644 --- a/Content.Server/Radio/EntitySystems/HeadsetSystem.cs +++ b/Content.Server/Radio/EntitySystems/HeadsetSystem.cs @@ -1,4 +1,4 @@ -using Content.Server.Chat.Systems; +using Content.Shared.Chat; using Content.Shared.Inventory.Events; using Content.Shared.Radio; using Content.Shared.Radio.Components; diff --git a/Content.Server/Radio/EntitySystems/RadioDeviceSystem.cs b/Content.Server/Radio/EntitySystems/RadioDeviceSystem.cs index b0f38c92fa..68067ae6f5 100644 --- a/Content.Server/Radio/EntitySystems/RadioDeviceSystem.cs +++ b/Content.Server/Radio/EntitySystems/RadioDeviceSystem.cs @@ -3,16 +3,16 @@ using Content.Server.Chat.Systems; using Content.Server.Interaction; using Content.Server.Popups; using Content.Server.Power.EntitySystems; -using Content.Shared.Radio.Components; +using Content.Shared.Chat; using Content.Shared.Examine; using Content.Shared.Interaction; using Content.Shared.Power; using Content.Shared.Radio; +using Content.Shared.Radio.Components; +using Content.Shared.Radio.EntitySystems; using Content.Shared.Speech; using Content.Shared.Speech.Components; -using Content.Shared.Chat; using Robust.Shared.Prototypes; -using Content.Shared.Radio.EntitySystems; namespace Content.Server.Radio.EntitySystems; diff --git a/Content.Server/RatKing/RatKingSystem.cs b/Content.Server/RatKing/RatKingSystem.cs index eb3bef6c02..a7d6ecfd47 100644 --- a/Content.Server/RatKing/RatKingSystem.cs +++ b/Content.Server/RatKing/RatKingSystem.cs @@ -6,6 +6,7 @@ using Content.Server.NPC.HTN; using Content.Server.NPC.Systems; using Content.Server.Popups; using Content.Shared.Atmos; +using Content.Shared.Chat; using Content.Shared.Dataset; using Content.Shared.Nutrition.Components; using Content.Shared.Nutrition.EntitySystems; @@ -13,7 +14,6 @@ using Content.Shared.Pointing; using Content.Shared.Random.Helpers; using Content.Shared.RatKing; using Robust.Shared.Map; -using Robust.Shared.Random; namespace Content.Server.RatKing { diff --git a/Content.Server/Speech/AccentSystem.cs b/Content.Server/Speech/AccentSystem.cs index e413dd52f8..275a4175c8 100644 --- a/Content.Server/Speech/AccentSystem.cs +++ b/Content.Server/Speech/AccentSystem.cs @@ -1,5 +1,5 @@ using System.Text.RegularExpressions; -using Content.Server.Chat.Systems; +using Content.Shared.Chat; using Content.Shared.Speech; namespace Content.Server.Speech; diff --git a/Content.Server/Speech/EntitySystems/ListeningSystem.cs b/Content.Server/Speech/EntitySystems/ListeningSystem.cs index 17513d80e7..35cb7f0eb4 100644 --- a/Content.Server/Speech/EntitySystems/ListeningSystem.cs +++ b/Content.Server/Speech/EntitySystems/ListeningSystem.cs @@ -1,4 +1,5 @@ using Content.Server.Chat.Systems; +using Content.Shared.Chat; using Content.Shared.Speech; using Content.Shared.Speech.Components; diff --git a/Content.Server/Speech/EntitySystems/SpeakOnActionSystem.cs b/Content.Server/Speech/EntitySystems/SpeakOnActionSystem.cs index ba7043e10c..6b52e69d7a 100644 --- a/Content.Server/Speech/EntitySystems/SpeakOnActionSystem.cs +++ b/Content.Server/Speech/EntitySystems/SpeakOnActionSystem.cs @@ -1,10 +1,10 @@ using Content.Server.Chat.Systems; -using Content.Shared.Speech.Components; +using Content.Shared.Actions.Events; +using Content.Shared.Chat; using Content.Shared.Speech; +using Content.Shared.Speech.Components; using Content.Shared.Speech.EntitySystems; using Content.Shared.Speech.Muting; -using Content.Shared.Actions.Events; - namespace Content.Server.Speech.EntitySystems; diff --git a/Content.Server/Speech/EntitySystems/UnblockableSpeechSystem.cs b/Content.Server/Speech/EntitySystems/UnblockableSpeechSystem.cs index 35a77c31f6..6d5f165d6c 100644 --- a/Content.Server/Speech/EntitySystems/UnblockableSpeechSystem.cs +++ b/Content.Server/Speech/EntitySystems/UnblockableSpeechSystem.cs @@ -1,5 +1,5 @@ -using Content.Server.Chat.Systems; using Content.Server.Speech.Components; +using Content.Shared.Chat; namespace Content.Server.Speech.EntitySystems { diff --git a/Content.Server/Speech/SpeechNoiseSystem.cs b/Content.Server/Speech/SpeechNoiseSystem.cs index 5530f3fe57..cc9d5feb60 100644 --- a/Content.Server/Speech/SpeechNoiseSystem.cs +++ b/Content.Server/Speech/SpeechNoiseSystem.cs @@ -1,12 +1,10 @@ -using Robust.Shared.Audio; -using Content.Server.Chat; -using Content.Server.Chat.Systems; +using Content.Shared.Chat; using Content.Shared.Speech; +using Robust.Shared.Audio; using Robust.Shared.Audio.Systems; -using Robust.Shared.Player; using Robust.Shared.Prototypes; -using Robust.Shared.Timing; using Robust.Shared.Random; +using Robust.Shared.Timing; namespace Content.Server.Speech { diff --git a/Content.Server/Trigger/Systems/SpeakOnTriggerSystem.cs b/Content.Server/Trigger/Systems/SpeakOnTriggerSystem.cs index 1e08587ce7..48ead11161 100644 --- a/Content.Server/Trigger/Systems/SpeakOnTriggerSystem.cs +++ b/Content.Server/Trigger/Systems/SpeakOnTriggerSystem.cs @@ -1,4 +1,5 @@ using Content.Server.Chat.Systems; +using Content.Shared.Chat; using Content.Shared.Trigger; using Content.Shared.Trigger.Components.Effects; using Robust.Shared.Prototypes; diff --git a/Content.Server/Weapons/Melee/MeleeWeaponSystem.cs b/Content.Server/Weapons/Melee/MeleeWeaponSystem.cs index 31d289217c..2efe94c20e 100644 --- a/Content.Server/Weapons/Melee/MeleeWeaponSystem.cs +++ b/Content.Server/Weapons/Melee/MeleeWeaponSystem.cs @@ -1,5 +1,6 @@ using Content.Server.Chat.Systems; using Content.Server.Movement.Systems; +using Content.Shared.Chat; using Content.Shared.Effects; using Content.Shared.Speech.Components; using Content.Shared.Weapons.Melee; diff --git a/Content.Shared/Chat/SharedChatEvents.cs b/Content.Shared/Chat/SharedChatEvents.cs index c187fd59a8..f9b706e57d 100644 --- a/Content.Shared/Chat/SharedChatEvents.cs +++ b/Content.Shared/Chat/SharedChatEvents.cs @@ -1,12 +1,13 @@ +using Content.Shared.Inventory; +using Content.Shared.Radio; using Content.Shared.Speech; using Robust.Shared.Prototypes; -using Content.Shared.Inventory; namespace Content.Shared.Chat; /// -/// This event should be sent everytime an entity talks (Radio, local chat, etc...). -/// The event is sent to both the entity itself, and all clothing (For stuff like voice masks). +/// This event should be sent everytime an entity talks (Radio, local chat, etc...). +/// The event is sent to both the entity itself, and all clothing (For stuff like voice masks). /// public sealed class TransformSpeakerNameEvent : EntityEventArgs, IInventoryRelayEvent { @@ -22,3 +23,54 @@ public sealed class TransformSpeakerNameEvent : EntityEventArgs, IInventoryRelay SpeechVerb = null; } } + +/// +/// Raised broadcast in order to transform speech.transmit +/// +public sealed class TransformSpeechEvent : EntityEventArgs +{ + public EntityUid Sender; + public string Message; + + public TransformSpeechEvent(EntityUid sender, string message) + { + Sender = sender; + Message = message; + } +} + +public sealed class CheckIgnoreSpeechBlockerEvent : EntityEventArgs +{ + public EntityUid Sender; + public bool IgnoreBlocker; + + public CheckIgnoreSpeechBlockerEvent(EntityUid sender, bool ignoreBlocker) + { + Sender = sender; + IgnoreBlocker = ignoreBlocker; + } +} + +/// +/// Raised on an entity when it speaks, either through 'say' or 'whisper'. +/// +public sealed class EntitySpokeEvent : EntityEventArgs +{ + public readonly EntityUid Source; + public readonly string Message; + public readonly string? ObfuscatedMessage; // not null if this was a whisper + + /// + /// If the entity was trying to speak into a radio, this was the channel they were trying to access. If a radio + /// message gets sent on this channel, this should be set to null to prevent duplicate messages. + /// + public RadioChannelPrototype? Channel; + + public EntitySpokeEvent(EntityUid source, string message, RadioChannelPrototype? channel, string? obfuscatedMessage) + { + Source = source; + Message = message; + Channel = channel; + ObfuscatedMessage = obfuscatedMessage; + } +} diff --git a/Content.Shared/Chat/SharedChatSystem.cs b/Content.Shared/Chat/SharedChatSystem.cs index eca84249c8..dc74109060 100644 --- a/Content.Shared/Chat/SharedChatSystem.cs +++ b/Content.Shared/Chat/SharedChatSystem.cs @@ -8,7 +8,9 @@ using Content.Shared.Speech; using Content.Shared.Whitelist; using Robust.Shared.Audio; using Robust.Shared.Audio.Systems; +using Robust.Shared.Console; using Robust.Shared.Network; +using Robust.Shared.Player; using Robust.Shared.Prototypes; using Robust.Shared.Random; using Robust.Shared.Utility; @@ -322,6 +324,132 @@ public abstract partial class SharedChatSystem : EntitySystem NetUserId? author = null ) { } + + /// + /// Sends an in-character chat message to relevant clients. + /// + /// The entity that is speaking. + /// The message being spoken or emoted. + /// The chat type. + /// Whether or not this message should appear in the chat window. + /// Whether or not this message should appear in the adminlog window. + /// + /// The player doing the speaking. + /// The name to use for the speaking entity. Usually this should just be modified via . If this is set, the event will not get raised. + /// Whether or not should be parsed with consideration of radio channel prefix text at start the start. + /// If set to true, action blocker will not be considered for whether an entity can send this message. + public virtual void TrySendInGameICMessage( + EntityUid source, + string message, + InGameICChatType desiredType, + bool hideChat, + bool hideLog = false, + IConsoleShell? shell = null, + ICommonSession? player = null, + string? nameOverride = null, + bool checkRadioPrefix = true, + bool ignoreActionBlocker = false) + { } + + /// + /// Sends an in-character chat message to relevant clients. + /// + /// The entity that is speaking. + /// The message being spoken or emoted. + /// The chat type. + /// Conceptual range of transmission, if it shows in the chat window, if it shows to far-away ghosts or ghosts at all... + /// Disables the admin log for this message if true. Used for entities that are not players, like vendors, cloning, etc. + /// + /// The player doing the speaking. + /// The name to use for the speaking entity. Usually this should just be modified via . If this is set, the event will not get raised. + /// If set to true, action blocker will not be considered for whether an entity can send this message. + public virtual void TrySendInGameICMessage( + EntityUid source, + string message, + InGameICChatType desiredType, + ChatTransmitRange range, + bool hideLog = false, + IConsoleShell? shell = null, + ICommonSession? player = null, + string? nameOverride = null, + bool checkRadioPrefix = true, + bool ignoreActionBlocker = false + ) + { } + + /// + /// Sends an out-of-character chat message to relevant clients. + /// + /// The entity that is speaking. + /// The message being spoken or emoted. + /// The chat type. + /// Whether or not to show the message in the chat window. + /// + /// The player doing the speaking. + public virtual void TrySendInGameOOCMessage( + EntityUid source, + string message, + InGameOOCChatType type, + bool hideChat, + IConsoleShell? shell = null, + ICommonSession? player = null + ) + { } + + /// + /// Dispatches an announcement to all. + /// + /// The contents of the message. + /// The sender (Communications Console in Communications Console Announcement). + /// Play the announcement sound. + /// Sound to play. + /// Optional color for the announcement message. + public virtual void DispatchGlobalAnnouncement( + string message, + string? sender = null, + bool playSound = true, + SoundSpecifier? announcementSound = null, + Color? colorOverride = null + ) + { } + + /// + /// Dispatches an announcement to players selected by filter. + /// + /// Filter to select players who will recieve the announcement. + /// The contents of the message. + /// The entity making the announcement (used to determine the station). + /// The sender (Communications Console in Communications Console Announcement). + /// Play the announcement sound. + /// Sound to play. + /// Optional color for the announcement message. + public virtual void DispatchFilteredAnnouncement( + Filter filter, + string message, + EntityUid? source = null, + string? sender = null, + bool playSound = true, + SoundSpecifier? announcementSound = null, + Color? colorOverride = null) + { } + + /// + /// Dispatches an announcement on a specific station. + /// + /// The entity making the announcement (used to determine the station). + /// The contents of the message. + /// The sender (Communications Console in Communications Console Announcement). + /// Play the announcement sound. + /// Sound to play. + /// Optional color for the announcement message. + public virtual void DispatchStationAnnouncement( + EntityUid source, + string message, + string? sender = null, + bool playDefaultSound = true, + SoundSpecifier? announcementSound = null, + Color? colorOverride = null) + { } } /// @@ -338,3 +466,23 @@ public enum ChatTransmitRange : byte /// Ghosts can't hear or see it at all. Regular players can if in-range. NoGhosts } + +/// +/// InGame IC chat is for chat that is specifically ingame (not lobby) but is also in character, i.e. speaking. +/// +// ReSharper disable once InconsistentNaming +public enum InGameICChatType : byte +{ + Speak, + Emote, + Whisper +} + +/// +/// InGame OOC chat is for chat that is specifically ingame (not lobby) but is OOC, like deadchat or LOOC. +/// +public enum InGameOOCChatType : byte +{ + Looc, + Dead +}