[feat] TTS
# Conflicts: # Content.Client/Options/UI/Tabs/AudioTab.xaml.cs # Content.Client/Preferences/UI/HumanoidProfileEditor.xaml # Content.Client/Preferences/UI/HumanoidProfileEditor.xaml.cs # Content.Server/Database/ServerDbBase.cs # Content.Server/Entry/EntryPoint.cs # Content.Server/Humanoid/Systems/HumanoidAppearanceSystem.cs # Content.Server/IoC/ServerContentIoC.cs # Content.Server/VoiceMask/VoiceMaskSystem.cs # Resources/Prototypes/Entities/Mobs/Species/base.yml
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
using Content.Shared.Humanoid;
|
||||
|
||||
namespace Content.Server.VoiceMask;
|
||||
|
||||
[RegisterComponent]
|
||||
@@ -6,4 +8,7 @@ public sealed partial class VoiceMaskComponent : Component
|
||||
[ViewVariables(VVAccess.ReadWrite)] public bool Enabled = true;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)] public string VoiceName = "Unknown";
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)] public string VoiceId = SharedHumanoidAppearanceSystem.DefaultVoice; //TTS
|
||||
|
||||
}
|
||||
|
||||
@@ -21,6 +21,8 @@ public sealed partial class VoiceMaskSystem
|
||||
|
||||
var comp = EnsureComp<VoiceMaskComponent>(user);
|
||||
comp.VoiceName = component.LastSetName;
|
||||
if (component.LastSetVoice != null)
|
||||
comp.VoiceId = component.LastSetVoice;
|
||||
|
||||
_actions.AddAction(user, ref component.ActionEntity, component.Action, uid);
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ public sealed partial class VoiceMaskSystem : EntitySystem
|
||||
SubscribeLocalEvent<VoiceMaskerComponent, GotUnequippedEvent>(OnUnequip);
|
||||
SubscribeLocalEvent<VoiceMaskSetNameEvent>(OnSetName);
|
||||
// SubscribeLocalEvent<VoiceMaskerComponent, GetVerbsEvent<AlternativeVerb>>(GetVerbs);
|
||||
InitializeTTS();
|
||||
}
|
||||
|
||||
private void OnSetName(VoiceMaskSetNameEvent ev)
|
||||
@@ -93,6 +94,6 @@ public sealed partial class VoiceMaskSystem : EntitySystem
|
||||
}
|
||||
|
||||
if (_uiSystem.TryGetUi(owner, VoiceMaskUIKey.Key, out var bui))
|
||||
_uiSystem.SetUiState(bui, new VoiceMaskBuiState(component.VoiceName));
|
||||
_uiSystem.SetUiState(bui, new VoiceMaskBuiState(component.VoiceName, component.VoiceId));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ namespace Content.Server.VoiceMask;
|
||||
public sealed partial class VoiceMaskerComponent : Component
|
||||
{
|
||||
[ViewVariables(VVAccess.ReadWrite)] public string LastSetName = "Unknown";
|
||||
[ViewVariables(VVAccess.ReadWrite)] public string? LastSetVoice; // tts
|
||||
|
||||
[DataField("action", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
|
||||
public string Action = "ActionChangeVoiceMask";
|
||||
|
||||
Reference in New Issue
Block a user