mirror of
https://github.com/corvax-team/ss14-wl.git
synced 2026-02-15 03:31:38 +01:00
Fix voice mask TTS (#3064)
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using System.Threading.Tasks;
|
||||
using Content.Server.Chat.Systems;
|
||||
using Content.Server.Players.RateLimiting;
|
||||
using Content.Shared.Corvax.CCCVars;
|
||||
using Content.Shared.Corvax.TTS;
|
||||
using Content.Shared.GameTicking;
|
||||
@@ -150,15 +149,3 @@ public sealed partial class TTSSystem : EntitySystem
|
||||
return await _ttsManager.ConvertTextToSpeech(speaker, textSsml);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class TransformSpeakerVoiceEvent : EntityEventArgs
|
||||
{
|
||||
public EntityUid Sender;
|
||||
public string VoiceId;
|
||||
|
||||
public TransformSpeakerVoiceEvent(EntityUid sender, string voiceId)
|
||||
{
|
||||
Sender = sender;
|
||||
VoiceId = voiceId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using Content.Server.Corvax.TTS;
|
||||
using Content.Shared.Corvax.TTS;
|
||||
using Content.Shared.Corvax.TTS;
|
||||
using Content.Shared.Inventory;
|
||||
using Content.Shared.VoiceMask;
|
||||
|
||||
namespace Content.Server.VoiceMask;
|
||||
@@ -8,13 +8,13 @@ public partial class VoiceMaskSystem
|
||||
{
|
||||
private void InitializeTTS()
|
||||
{
|
||||
SubscribeLocalEvent<VoiceMaskComponent, TransformSpeakerVoiceEvent>(OnSpeakerVoiceTransform);
|
||||
SubscribeLocalEvent<VoiceMaskComponent, InventoryRelayedEvent<TransformSpeakerVoiceEvent>>(OnSpeakerVoiceTransform);
|
||||
SubscribeLocalEvent<VoiceMaskComponent, VoiceMaskChangeVoiceMessage>(OnChangeVoice);
|
||||
}
|
||||
|
||||
private void OnSpeakerVoiceTransform(EntityUid uid, VoiceMaskComponent component, TransformSpeakerVoiceEvent args)
|
||||
private void OnSpeakerVoiceTransform(EntityUid uid, VoiceMaskComponent component, InventoryRelayedEvent<TransformSpeakerVoiceEvent> args)
|
||||
{
|
||||
args.VoiceId = component.VoiceId;
|
||||
args.Args.VoiceId = component.VoiceId;
|
||||
}
|
||||
|
||||
private void OnChangeVoice(Entity<VoiceMaskComponent> entity, ref VoiceMaskChangeVoiceMessage msg)
|
||||
|
||||
17
Content.Shared/Corvax/TTS/TransformSpeakerVoiceEvent.cs
Normal file
17
Content.Shared/Corvax/TTS/TransformSpeakerVoiceEvent.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using Content.Shared.Inventory;
|
||||
|
||||
namespace Content.Shared.Corvax.TTS;
|
||||
|
||||
public sealed class TransformSpeakerVoiceEvent : EntityEventArgs, IInventoryRelayEvent
|
||||
{
|
||||
public SlotFlags TargetSlots => SlotFlags.MASK;
|
||||
public EntityUid Sender;
|
||||
public string VoiceId;
|
||||
|
||||
public TransformSpeakerVoiceEvent(EntityUid sender, string voiceId)
|
||||
{
|
||||
Sender = sender;
|
||||
VoiceId = voiceId;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,6 +3,7 @@ using Content.Shared.Chat;
|
||||
using Content.Shared.Chemistry;
|
||||
using Content.Shared.Chemistry.Hypospray.Events;
|
||||
using Content.Shared.Climbing.Events;
|
||||
using Content.Shared.Corvax.TTS;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.Electrocution;
|
||||
using Content.Shared.Explosion;
|
||||
@@ -43,6 +44,9 @@ public partial class InventorySystem
|
||||
SubscribeLocalEvent<InventoryComponent, SelfBeforeClimbEvent>(RelayInventoryEvent);
|
||||
SubscribeLocalEvent<InventoryComponent, CoefficientQueryEvent>(RelayInventoryEvent);
|
||||
|
||||
// Corvax-TTS
|
||||
SubscribeLocalEvent<InventoryComponent, TransformSpeakerVoiceEvent>(RelayInventoryEvent);
|
||||
|
||||
// by-ref events
|
||||
SubscribeLocalEvent<InventoryComponent, GetExplosionResistanceEvent>(RefRelayInventoryEvent);
|
||||
SubscribeLocalEvent<InventoryComponent, IsWeightlessEvent>(RefRelayInventoryEvent);
|
||||
|
||||
Reference in New Issue
Block a user