Files

24 lines
747 B
C#
Raw Permalink Normal View History

using Content.Shared._White.TTS;
2023-05-04 17:51:53 +03:00
using Robust.Shared.Network;
namespace Content.Client._White.TTS;
2023-05-04 17:51:53 +03:00
// ReSharper disable once InconsistentNaming
public sealed class TTSManager
{
[Dependency] private readonly IClientNetManager _netMgr = default!;
[Dependency] private readonly EntityManager _entityManager = default!;
2023-05-04 17:51:53 +03:00
public void Initialize()
{
_netMgr.RegisterNetMessage<MsgRequestTTS>();
}
// ReSharper disable once InconsistentNaming
public void RequestTTS(EntityUid uid, string text, string voiceId)
{
var netEntity = _entityManager.GetNetEntity(uid);
var msg = new MsgRequestTTS() { Text = text, Uid = netEntity, VoiceId = voiceId };
2023-05-04 17:51:53 +03:00
_netMgr.ClientSendMessage(msg);
}
}