using Content.Shared.Inventory;
using Content.Shared.Radio;
using Content.Shared.Speech;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
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).
///
public sealed class TransformSpeakerNameEvent : EntityEventArgs, IInventoryRelayEvent
{
public SlotFlags TargetSlots { get; } = SlotFlags.WITHOUT_POCKET;
public EntityUid Sender;
public string VoiceName;
public ProtoId? SpeechVerb;
public TransformSpeakerNameEvent(EntityUid sender, string name)
{
Sender = sender;
VoiceName = name;
SpeechVerb = null;
}
}
///
/// Raised broadcast in order to transform speech.transmit
///
public sealed class TransformSpeechEvent : CancellableEntityEventArgs, IInventoryRelayEvent
{
public SlotFlags TargetSlots { get; } = SlotFlags.WITHOUT_POCKET;
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
public readonly string OriginalMessage; // Corvax-TTS
///
/// 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, string originalMessage, RadioChannelPrototype? channel, string? obfuscatedMessage)// Corvax-TTS originalMessage
{
Source = source;
Message = message;
OriginalMessage = originalMessage; // Corvax-TTS: Spec symbol sanitize
Channel = channel;
ObfuscatedMessage = obfuscatedMessage;
}
}
///
/// Checks if an entity link can be clicked on or not, so that it may be teleported to.
///
/// Target we are attempting to teleport to.
/// If pure is true, will only act as an attempt event. If pure is false, will teleport to the entity.
[ByRefEvent]
public record struct ClickEntityLinkEvent(EntityUid Target, bool Pure)
{
public bool Handled;
}
///
/// Net Message that is sent when a client clicks a link in the chat box.
///
/// Target entity of the text link
[Serializable, NetSerializable]
public sealed class ChatLinkClickedRequestEvent(NetEntity target) : EntityEventArgs
{
public readonly NetEntity Target = target;
}