2022-05-13 00:59:03 -07:00
|
|
|
|
namespace Content.Shared.Emoting
|
2021-06-19 10:03:24 +02:00
|
|
|
|
{
|
2022-02-16 00:23:23 -07:00
|
|
|
|
public sealed class EmoteSystem : EntitySystem
|
2021-06-19 10:03:24 +02:00
|
|
|
|
{
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|