H.O.N.K. mech (#14670)
Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using Content.Shared.Mech;
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
|
||||
namespace Content.Client.Mech.Ui.Equipment;
|
||||
|
||||
[GenerateTypedNameReferences]
|
||||
public sealed partial class MechSoundboardUiFragment : BoxContainer
|
||||
{
|
||||
public event Action<int>? OnPlayAction;
|
||||
|
||||
public MechSoundboardUiFragment()
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
IoCManager.InjectDependencies(this);
|
||||
}
|
||||
|
||||
public void UpdateContents(MechSoundboardUiState state)
|
||||
{
|
||||
foreach (var sound in state.Sounds)
|
||||
{
|
||||
Sounds.AddItem(Loc.GetString($"mech-soundboard-{sound}")).OnSelected += item => {
|
||||
OnPlayAction?.Invoke(Sounds.IndexOf(item));
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user