2021-06-19 10:03:24 +02:00
|
|
|
|
using Robust.Shared.GameObjects;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Content.Shared.Emoting
|
|
|
|
|
|
{
|
|
|
|
|
|
public class EmoteSystem : EntitySystem
|
|
|
|
|
|
{
|
|
|
|
|
|
public override void Initialize()
|
|
|
|
|
|
{
|
|
|
|
|
|
base.Initialize();
|
|
|
|
|
|
|
2022-01-08 00:57:20 +13:00
|
|
|
|
SubscribeLocalEvent<EmoteAttemptEvent>(OnEmoteAttempt);
|
2021-06-19 10:03:24 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-01-08 00:57:20 +13:00
|
|
|
|
private void OnEmoteAttempt(EmoteAttemptEvent args)
|
2021-06-19 10:03:24 +02:00
|
|
|
|
{
|
2022-01-08 00:57:20 +13:00
|
|
|
|
if (!TryComp(args.Uid, out SharedEmotingComponent? emote) || !emote.Enabled)
|
|
|
|
|
|
args.Cancel();
|
2021-06-19 10:03:24 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|