H.O.N.K. mech (#14670)

Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
deltanedas
2023-05-05 13:21:13 +00:00
committed by GitHub
parent 19b313b218
commit bc101e1fb5
49 changed files with 822 additions and 8 deletions

View File

@@ -0,0 +1,36 @@
using Content.Client.UserInterface.Fragments;
using Content.Shared.Mech;
using Robust.Client.GameObjects;
using Robust.Client.UserInterface;
namespace Content.Client.Mech.Ui.Equipment;
public sealed class MechSoundboardUi : UIFragment
{
private MechSoundboardUiFragment? _fragment;
public override Control GetUIFragmentRoot()
{
return _fragment!;
}
public override void Setup(BoundUserInterface userInterface, EntityUid? fragmentOwner)
{
if (fragmentOwner == null)
return;
_fragment = new MechSoundboardUiFragment();
_fragment.OnPlayAction += sound =>
{
userInterface.SendMessage(new MechSoundboardPlayMessage(fragmentOwner.Value, sound));
};
}
public override void UpdateState(BoundUserInterfaceState state)
{
if (state is not MechSoundboardUiState soundboardState)
return;
_fragment?.UpdateContents(soundboardState);
}
}