Cult spells update (#607)
* - add: CultSystem.BloodSpells. * - add: Cleanup.
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using Content.Client.Eui;
|
||||
using Content.Client.Ghost.UI;
|
||||
using Content.Shared._White.Cult.UI;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.Graphics;
|
||||
|
||||
@@ -4,7 +4,7 @@ using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.CustomControls;
|
||||
using static Robust.Client.UserInterface.Controls.BoxContainer;
|
||||
|
||||
namespace Content.Client.Ghost.UI;
|
||||
namespace Content.Client._White.Cult.UI.ApocalypseRuneEui;
|
||||
|
||||
public sealed class ApocalypseRuneMenu : DefaultWindow
|
||||
{
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
using Content.Client.Eui;
|
||||
using Content.Shared._White.Cult.UI;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.Graphics;
|
||||
|
||||
namespace Content.Client._White.Cult.UI.CultBloodSpellsEui;
|
||||
|
||||
[UsedImplicitly]
|
||||
public sealed class CultBloodSpellsEui : BaseEui
|
||||
{
|
||||
private readonly CultBloodSpellsMenu _menu;
|
||||
private bool _messageSent;
|
||||
|
||||
public CultBloodSpellsEui()
|
||||
{
|
||||
_menu = new CultBloodSpellsMenu();
|
||||
|
||||
_menu.OnClose += () =>
|
||||
{
|
||||
if (_messageSent)
|
||||
return;
|
||||
SendMessage(new BloodSpellMessage(BloodSpellMessageState.Cancel));
|
||||
_messageSent = true;
|
||||
};
|
||||
|
||||
_menu.RemoveButton.OnPressed += _ =>
|
||||
{
|
||||
Send(BloodSpellMessageState.Remove);
|
||||
};
|
||||
|
||||
_menu.CreateButton.OnPressed += _ =>
|
||||
{
|
||||
Send(BloodSpellMessageState.Create);
|
||||
};
|
||||
}
|
||||
|
||||
private void Send(BloodSpellMessageState state)
|
||||
{
|
||||
SendMessage(new BloodSpellMessage(state));
|
||||
_messageSent = true;
|
||||
_menu.Close();
|
||||
}
|
||||
|
||||
public override void Opened()
|
||||
{
|
||||
IoCManager.Resolve<IClyde>().RequestWindowAttention();
|
||||
_menu.OpenCentered();
|
||||
}
|
||||
|
||||
public override void Closed()
|
||||
{
|
||||
base.Closed();
|
||||
|
||||
_menu.Close();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
using System.Numerics;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.CustomControls;
|
||||
using static Robust.Client.UserInterface.Controls.BoxContainer;
|
||||
|
||||
namespace Content.Client._White.Cult.UI.CultBloodSpellsEui;
|
||||
|
||||
public sealed class CultBloodSpellsMenu : DefaultWindow
|
||||
{
|
||||
public readonly Button RemoveButton;
|
||||
public readonly Button CreateButton;
|
||||
|
||||
public CultBloodSpellsMenu()
|
||||
{
|
||||
Title = Loc.GetString("blood-spells-title");
|
||||
|
||||
Contents.AddChild(new BoxContainer
|
||||
{
|
||||
Orientation = LayoutOrientation.Vertical,
|
||||
Children =
|
||||
{
|
||||
new BoxContainer
|
||||
{
|
||||
Orientation = LayoutOrientation.Vertical,
|
||||
Children =
|
||||
{
|
||||
(new Label()
|
||||
{
|
||||
Text = Loc.GetString("blood-spells-text")
|
||||
}),
|
||||
new BoxContainer
|
||||
{
|
||||
Orientation = LayoutOrientation.Horizontal,
|
||||
Align = AlignMode.Center,
|
||||
Children =
|
||||
{
|
||||
(CreateButton = new Button
|
||||
{
|
||||
Text = Loc.GetString("blood-spells-create-button"),
|
||||
}),
|
||||
|
||||
(new Control()
|
||||
{
|
||||
MinSize = new Vector2(20, 0)
|
||||
}),
|
||||
|
||||
(RemoveButton = new Button
|
||||
{
|
||||
Text = Loc.GetString("blood-spells-remove-button"),
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user