Files
OldThink/Content.Server/Actions/ActionsSystem.cs

30 lines
931 B
C#
Raw Normal View History

2022-03-30 22:21:58 -07:00
using Content.Server.Chat;
using Content.Server.Chat.Systems;
using Content.Shared.Actions;
using Content.Shared.Actions.ActionTypes;
using JetBrains.Annotations;
using Robust.Server.GameObjects;
namespace Content.Server.Actions
{
[UsedImplicitly]
public sealed class ActionsSystem : SharedActionsSystem
{
2022-03-30 22:21:58 -07:00
[Dependency] private readonly ChatSystem _chat = default!;
[Dependency] private readonly MetaDataSystem _metaSystem = default!;
2023-01-02 13:01:40 +13:00
protected override bool PerformBasicActions(EntityUid user, ActionType action, bool predicted)
{
2023-01-02 13:01:40 +13:00
var result = base.PerformBasicActions(user, action, predicted);
if (!string.IsNullOrWhiteSpace(action.Speech))
{
2022-03-30 22:21:58 -07:00
_chat.TrySendInGameICMessage(user, Loc.GetString(action.Speech), InGameICChatType.Speak, false);
result = true;
}
return result;
}
}
}