main cult

This commit is contained in:
EnefFlow
2024-01-27 15:19:52 +03:00
committed by Aviu00
parent 6310813ce6
commit 4fab8188f0
429 changed files with 12281 additions and 9 deletions

View File

@@ -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();
}
}