Files
wwdpublic/Content.Client/RadialSelector/AttachedRadialSelectorMenuBUI.cs
Remuchi 4c8c415eed [Fix] Парад фиксов (#1110)
* fix: thermals and night vision now work

* fix: it has to be this way

Signed-off-by: Remuchi <RemuchiOfficial@gmail.com>

* fix: I hate the way they are separated

* fix: now cult actions close examine menu (#1046)

Signed-off-by: Remuchi <RemuchiOfficial@gmail.com>

* fix: railins and some other things now dont snap to south upon being built (#1029)

* fix: who did this translation wtf

* fix: assball bat can now wideswing (#1030)

Signed-off-by: Remuchi <RemuchiOfficial@gmail.com>

* fix: spend flares are actually spent now (#959)

Signed-off-by: Remuchi <RemuchiOfficial@gmail.com>

* fix: made part exchange system a bit less shitty

I really have no time or interest in it to rewrite it completely rn

Signed-off-by: Remuchi <RemuchiOfficial@gmail.com>

* fix: fixed cult factories timers being broken

Also fixed them being openable by anyone.

Signed-off-by: Remuchi <RemuchiOfficial@gmail.com>

* Apply suggestions from code review

Co-authored-by: Spatison <137375981+Spatison@users.noreply.github.com>
Co-authored-by: RedFoxIV <38788538+RedFoxIV@users.noreply.github.com>

---------

Signed-off-by: Remuchi <RemuchiOfficial@gmail.com>
Co-authored-by: Spatison <137375981+Spatison@users.noreply.github.com>
Co-authored-by: RedFoxIV <38788538+RedFoxIV@users.noreply.github.com>
2026-04-16 10:53:08 +03:00

58 lines
1.7 KiB
C#

using Content.Client.UserInterface.Controls;
using Content.Shared.RadialSelector;
using JetBrains.Annotations;
using Robust.Client.Graphics;
using Robust.Client.Input;
// ReSharper disable InconsistentNaming
namespace Content.Client.RadialSelector;
[UsedImplicitly]
public sealed class AttachedRadialSelectorMenuBUI(EntityUid owner, Enum uiKey)
: BasedRadialSelectorMenuBUI(owner, uiKey) // WD EDIT: make it more generic
{
[Dependency] private readonly IClyde _displayManager = default!;
[Dependency] private readonly IInputManager _inputManager = default!;
private readonly RadialMenu _menu = new()
{
HorizontalExpand = true,
VerticalExpand = true,
BackButtonStyleClass = "RadialMenuBackButton",
CloseButtonStyleClass = "RadialMenuCloseButton"
};
private bool _openCentered;
protected override void Open()
{
base.Open(); //WWDP EDIT - Summary: Overriders MUST ALWAYS call base function
_menu.OnClose += Close;
if (_openCentered)
_menu.OpenCentered();
else
_menu.OpenCenteredAt(_inputManager.MouseScreenPosition.Position / _displayManager.ScreenSize);
}
protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);
if (state is not RadialSelectorState radialSelectorState)
return;
ClearExistingContainers(_menu);
CreateMenu(radialSelectorState.Entries, _menu);
_openCentered = radialSelectorState.OpenCentered;
}
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (disposing)
_menu.Dispose();
}
}