main cult
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
using Content.Client._White.UserInterface.Radial;
|
||||
using Content.Shared.White.Cult;
|
||||
using Content.Shared.White.Cult.Components;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.Utility;
|
||||
|
||||
namespace Content.Client._White.Cult.UI.SpellSelector;
|
||||
|
||||
public sealed class SpellSelectorBUI : BoundUserInterface
|
||||
{
|
||||
|
||||
private RadialContainer? _radialContainer;
|
||||
|
||||
public SpellSelectorBUI(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
IoCManager.InjectDependencies(this);
|
||||
}
|
||||
|
||||
protected override void Open()
|
||||
{
|
||||
base.Open();
|
||||
_radialContainer = new RadialContainer();
|
||||
_radialContainer.Closed += Close;
|
||||
|
||||
foreach (var action in CultistComponent.CultistActions)
|
||||
{
|
||||
var button = _radialContainer.AddButton(action.DisplayName, action.Icon?.Frame0());
|
||||
|
||||
button.Controller.OnPressed += _ =>
|
||||
{
|
||||
SendMessage(new CultEmpowerSelectedBuiMessage(action));
|
||||
Close();
|
||||
};
|
||||
}
|
||||
|
||||
_radialContainer.OpenAttachedLocalPlayer();
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
base.Dispose(disposing);
|
||||
_radialContainer?.Close();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user