перенос файлов сервера из папки White в _White
This commit is contained in:
35
Content.Server/_White/Animations/EmoteAnimationSystem.cs
Normal file
35
Content.Server/_White/Animations/EmoteAnimationSystem.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using Content.Server.Chat.Systems;
|
||||
using Content.Shared.Chat.Prototypes;
|
||||
using Content.Shared.White.Animations;
|
||||
using Robust.Shared.GameStates;
|
||||
using static Content.Shared.White.Animations.EmoteAnimationComponent;
|
||||
|
||||
namespace Content.Server._White.Animations;
|
||||
|
||||
public sealed class EmoteAnimationSystem : EntitySystem
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
SubscribeLocalEvent<EmoteAnimationComponent, ComponentGetState>(OnGetState);
|
||||
SubscribeLocalEvent<EmoteAnimationComponent, EmoteEvent>(OnEmote);
|
||||
}
|
||||
|
||||
private void OnGetState(EntityUid uid, EmoteAnimationComponent component, ref ComponentGetState args)
|
||||
{
|
||||
args.State = new EmoteAnimationComponentState(component.AnimationId);
|
||||
}
|
||||
|
||||
private void OnEmote(EntityUid uid, EmoteAnimationComponent component, ref EmoteEvent args)
|
||||
{
|
||||
if (args.Handled || !args.Emote.Category.HasFlag(EmoteCategory.Gesture))
|
||||
return;
|
||||
|
||||
PlayEmoteAnimation(uid, component, args.Emote.ID);
|
||||
}
|
||||
|
||||
public void PlayEmoteAnimation(EntityUid uid, EmoteAnimationComponent component, string emoteId)
|
||||
{
|
||||
component.AnimationId = emoteId;
|
||||
Dirty(component);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user