mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-16 21:17:39 +03:00
50 lines
1.3 KiB
C#
50 lines
1.3 KiB
C#
using Content.Client._White.UserInterface.Controls;
|
|
using Content.Shared._White.RadialSelector;
|
|
using JetBrains.Annotations;
|
|
|
|
// ReSharper disable InconsistentNaming
|
|
|
|
namespace Content.Client._White.RadialSelector;
|
|
|
|
[UsedImplicitly]
|
|
public sealed class TrackedRadialSelectorMenuBUI(EntityUid owner, Enum uiKey) : BasedRadialSelectorMenuBUI(owner, uiKey)
|
|
{
|
|
private readonly TrackedRadialMenu _menu = new()
|
|
{
|
|
HorizontalExpand = true,
|
|
VerticalExpand = true,
|
|
BackButtonStyleClass = "RadialMenuBackButton",
|
|
CloseButtonStyleClass = "RadialMenuCloseButton"
|
|
};
|
|
|
|
private EntityUid? _trackedEntity;
|
|
|
|
protected override void Open()
|
|
{
|
|
base.Open();
|
|
|
|
_menu.OnClose += Close;
|
|
_menu.Track(_trackedEntity ?? Owner);
|
|
}
|
|
|
|
protected override void UpdateState(BoundUserInterfaceState state)
|
|
{
|
|
base.UpdateState(state);
|
|
|
|
if (state is not TrackedRadialSelectorState trackedRadialSelectorState)
|
|
return;
|
|
|
|
ClearExistingContainers(_menu);
|
|
CreateMenu(trackedRadialSelectorState.Entries, _menu);
|
|
|
|
_trackedEntity = EntMan.GetEntity(trackedRadialSelectorState.TrackedEntity);
|
|
}
|
|
|
|
protected override void Dispose(bool disposing)
|
|
{
|
|
base.Dispose(disposing);
|
|
if (disposing)
|
|
_menu.Dispose();
|
|
}
|
|
}
|