mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-10 02:41:18 +03:00
# Conflicts: # Content.Client/Administration/UI/AdminMenuWindow.xaml.cs # Content.Client/LateJoin/LateJoinGui.cs # Content.Client/Power/PowerMonitoringWindow.xaml.cs # Content.Client/VendingMachines/UI/VendingMachineMenu.xaml.cs # Content.Server/VoiceMask/VoiceMaskSystem.cs # Resources/Prototypes/Entities/Clothing/Head/hardsuit-helmets.yml # Resources/Prototypes/Entities/Objects/Misc/paper.yml # Resources/Prototypes/Roles/Jobs/Security/security_cadet.yml # Resources/Prototypes/Roles/Jobs/Security/security_officer.yml # Resources/Prototypes/secret_weights.yml # Resources/Textures/Clothing/Back/Backpacks/security.rsi/equipped-BACKPACK.png # Resources/Textures/Clothing/Back/Backpacks/security.rsi/meta.json # Resources/Textures/Clothing/OuterClothing/Vests/kevlar.rsi/equipped-OUTERCLOTHING.png # Resources/Textures/Clothing/OuterClothing/Vests/kevlar.rsi/icon.png # Resources/Textures/Clothing/OuterClothing/Vests/kevlar.rsi/inhand-left.png # Resources/Textures/Clothing/OuterClothing/Vests/kevlar.rsi/inhand-right.png # RobustToolbox
48 lines
1.1 KiB
C#
48 lines
1.1 KiB
C#
using Content.Shared.VoiceMask;
|
|
using Robust.Client.GameObjects;
|
|
|
|
namespace Content.Client.VoiceMask;
|
|
|
|
public sealed class VoiceMaskBoundUserInterface : BoundUserInterface
|
|
{
|
|
[ViewVariables]
|
|
private VoiceMaskNameChangeWindow? _window;
|
|
|
|
public VoiceMaskBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
|
{
|
|
}
|
|
|
|
protected override void Open()
|
|
{
|
|
base.Open();
|
|
|
|
_window = new();
|
|
|
|
_window.OpenCentered();
|
|
_window.OnNameChange += OnNameSelected;
|
|
_window.OnVoiceChange += (value) => SendMessage(new VoiceMaskChangeVoiceMessage(value)); // Corvax-TTS
|
|
_window.OnClose += Close;
|
|
}
|
|
|
|
private void OnNameSelected(string name)
|
|
{
|
|
SendMessage(new VoiceMaskChangeNameMessage(name));
|
|
}
|
|
|
|
protected override void UpdateState(BoundUserInterfaceState state)
|
|
{
|
|
if (state is not VoiceMaskBuiState cast || _window == null)
|
|
{
|
|
return;
|
|
}
|
|
|
|
_window.UpdateState(cast.Name, cast.Voice); // Corvax-TTS
|
|
}
|
|
|
|
protected override void Dispose(bool disposing)
|
|
{
|
|
base.Dispose(disposing);
|
|
|
|
_window?.Close();
|
|
}
|
|
}
|