Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> Co-authored-by: ArtisticRoomba <145879011+ArtisticRoomba@users.noreply.github.com>
41 lines
1.1 KiB
C#
41 lines
1.1 KiB
C#
using Content.Shared.Silicons.StationAi;
|
|
using Robust.Shared.Prototypes;
|
|
|
|
namespace Content.Client.Silicons.StationAi;
|
|
|
|
public sealed class StationAiCustomizationBoundUserInterface : BoundUserInterface
|
|
{
|
|
private StationAiCustomizationMenu? _menu;
|
|
|
|
public StationAiCustomizationBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
|
{
|
|
|
|
}
|
|
|
|
protected override void Open()
|
|
{
|
|
base.Open();
|
|
|
|
_menu = new StationAiCustomizationMenu(Owner);
|
|
_menu.OpenCentered();
|
|
_menu.OnClose += Close;
|
|
|
|
_menu.SendStationAiCustomizationMessageAction += SendStationAiCustomizationMessage;
|
|
}
|
|
|
|
public void SendStationAiCustomizationMessage(ProtoId<StationAiCustomizationGroupPrototype> groupProtoId, ProtoId<StationAiCustomizationPrototype> customizationProtoId)
|
|
{
|
|
SendPredictedMessage(new StationAiCustomizationMessage(groupProtoId, customizationProtoId));
|
|
}
|
|
|
|
protected override void Dispose(bool disposing)
|
|
{
|
|
base.Dispose(disposing);
|
|
|
|
if (!disposing)
|
|
return;
|
|
|
|
_menu?.Dispose();
|
|
}
|
|
}
|