mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-20 15:31:09 +03:00
* Remove all IPrototypeManager instances * Remove redundant IComponentFactory instances too * Found some stragglers * DestructibleSystem.PrototypeManager: no dependency * not based
28 lines
727 B
C#
28 lines
727 B
C#
using Content.Shared.Chat;
|
|
using Content.Server.Chat.Systems;
|
|
|
|
namespace Content.Server.Speech;
|
|
|
|
public sealed partial class EmotesMenuSystem : EntitySystem
|
|
{
|
|
[Dependency] private ChatSystem _chat = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeAllEvent<PlayEmoteMessage>(OnPlayEmote);
|
|
}
|
|
|
|
private void OnPlayEmote(PlayEmoteMessage msg, EntitySessionEventArgs args)
|
|
{
|
|
var player = args.SenderSession.AttachedEntity;
|
|
if (!player.HasValue)
|
|
return;
|
|
|
|
if (!ProtoMan.Resolve(msg.ProtoId, out var proto) || proto.ChatTriggers.Count == 0)
|
|
return;
|
|
|
|
_chat.TryEmoteWithChat(player.Value, msg.ProtoId);
|
|
}
|
|
}
|