Emotes Menu (#26702)
* Basic emote radial menu * Move out from corvax * Move to UI controller & add to top menu bar and key bind * Make emote play * Add name localization for emotes * Localize chat messages * Fix emote menu * Add categories localization * Fixes * Fix * Add emotes entity blacklist * Fix entity whitelist required all logic * Remove unused wagging emote * Revert sprite * Set default texture for emote icon * Update Resources/keybinds.yml --------- Co-authored-by: Kara <lunarautomaton6@gmail.com>
This commit is contained in:
30
Content.Server/Speech/EmotesMenuSystem.cs
Normal file
30
Content.Server/Speech/EmotesMenuSystem.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using Content.Server.Chat.Systems;
|
||||
using Content.Shared.Chat;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Server.Speech;
|
||||
|
||||
public sealed partial class EmotesMenuSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private readonly 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 (!_prototypeManager.TryIndex(msg.ProtoId, out var proto) || proto.ChatTriggers.Count == 0)
|
||||
return;
|
||||
|
||||
_chat.TryEmoteWithChat(player.Value, msg.ProtoId);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user