CatStation/Content.Client/VoiceMask/VoiceMaskBoundUserInterface.cs
KeTuFaisPiKiNut 00d4c4f8fe
Changeling voice mimicry (#43675)
* working yay

* fixed the thing I had removed

* there it works

* i know my coding I hope

* Update Resources/Textures/Interface/Actions/changeling2.rsi/meta.json

Co-authored-by: ScarKy0 <106310278+ScarKy0@users.noreply.github.com>

* Update Content.Server/VoiceMask/VoiceMaskSystem.cs

Co-authored-by: ScarKy0 <106310278+ScarKy0@users.noreply.github.com>

* Update Content.Server/VoiceMask/VoiceMaskSystem.cs

Co-authored-by: ScarKy0 <106310278+ScarKy0@users.noreply.github.com>

* Update Content.Server/VoiceMask/VoiceMaskSystem.cs

Co-authored-by: ScarKy0 <106310278+ScarKy0@users.noreply.github.com>

* Update Content.Server/VoiceMask/VoiceMaskSystem.cs

Co-authored-by: ScarKy0 <106310278+ScarKy0@users.noreply.github.com>

* Apply suggestions from code review

oh god you can just do batches oh my god

Co-authored-by: ScarKy0 <106310278+ScarKy0@users.noreply.github.com>

* Update changeling-catalog.ftl

new line at EOF

* Update changeling.yml

same

* Update changeling.yml

line

* Update StoreSystem.Ui.cs

* Update StoreSystem.Ui.cs

* Update StoreSystem.Ui.cs

just reverted it to master

* Apply suggestions from code review

Co-authored-by: ScarKy0 <106310278+ScarKy0@users.noreply.github.com>

* Update VoiceMaskSystem.cs

there ya go skar

* fixed the bug, yay

* clean

* GITHUB, DO YOUR THING

* [DataField] is in the air? WRONG.

* minor spelling mistake

* all is well all is well sometimes

* minor fix

* apathy

* it works

* VIVE LA RÉVOLUTION

* minor spelling mistake *dies*

* why the fuck are high-rez vest making tests fail

* stuff

* NEWLINENEWLINENEWLINE

* Update Content.Client/VoiceMask/VoiceMaskNameChangeWindow.xaml.cs

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

* Update Content.Server/VoiceMask/VoiceMaskSystem.cs

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

---------

Co-authored-by: nomdéraisonnablementlong <you@example.com>
Co-authored-by: ScarKy0 <106310278+ScarKy0@users.noreply.github.com>
Co-authored-by: ScarKy0 <scarky0@onet.eu>
Co-authored-by: beck-thompson <beck314159@hotmail.com>
Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
2026-04-26 16:58:20 +00:00

64 lines
1.6 KiB
C#

using Content.Shared.VoiceMask;
using Robust.Client.GameObjects;
using Robust.Client.UserInterface;
using Robust.Shared.Prototypes;
namespace Content.Client.VoiceMask;
public sealed class VoiceMaskBoundUserInterface : BoundUserInterface
{
[Dependency] private readonly IPrototypeManager _protomanager = default!;
[ViewVariables]
private VoiceMaskNameChangeWindow? _window;
public VoiceMaskBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
}
protected override void Open()
{
base.Open();
_window = this.CreateWindow<VoiceMaskNameChangeWindow>();
_window.ReloadVerbs(_protomanager);
_window.AddVerbs();
_window.OnNameChange += OnNameSelected;
_window.OnVerbChange += verb => SendMessage(new VoiceMaskChangeVerbMessage(verb));
_window.OnToggle += OnToggle;
_window.OnAccentToggle += OnAccentToggle;
}
private void OnNameSelected(string name)
{
SendMessage(new VoiceMaskChangeNameMessage(name));
}
private void OnToggle()
{
SendMessage(new VoiceMaskToggleMessage());
}
private void OnAccentToggle()
{
SendMessage(new VoiceMaskAccentToggleMessage());
}
protected override void UpdateState(BoundUserInterfaceState state)
{
if (state is not VoiceMaskBuiState cast || _window == null)
{
return;
}
_window.UpdateState(cast.Name, cast.Verb, cast.Active, cast.AccentHide, cast.TitleText);
}
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
_window?.Close();
}
}