* - tweak: Cult door not bump openable. * - tweak: Better summoning and Narsie * - tweak: Construct update. * - tweak: Eldrich blade fits in suit storage. * - tweak: More spell limit. * - fix: Fix pylon desc. * - tweak: Teleport works on cuffed targets. * - tweak: More popups if target is holy. * - fix: No rune drawing using fingers. * - tweak: Better pylon placement & less pylon healing range. * - tweak: More blood rites charge. * - fix: Fix max spell amount. * - tweak: Less cult door and wall health. * - fix: Constructs are dead IC. * - add: Revive rune now notifies player. * - add: Narsie summon rune eui. * - fix: Fix narsie summon sound not playing for reapers. * - tweak: Whatever. * - add: Conceal presence spell. * - tweak: Tweakz. * - add: Blood spear. * - add: Blood boil barrage. * - tweak: Artificer flies. * - tweak: Blood bolt color tweaks. * - tweak: Runic door is bump openable again. * - fix: Fix concealed door outline. * - add: Update concealable name and desc. * - tweak: Remove the unremoveable. * - tweak: Gift ignore. * - add: Organs regenerate on rejuvenate. * - tweak: Brainless cultist is fine. * - add: Added more fun. * - add: Add rune descriptions. * - fix: Fixes. * - tweak: Blood rites now uses verb. * - tweak: Bring it back.
109 lines
2.9 KiB
C#
109 lines
2.9 KiB
C#
using Content.Client._White.UserInterface.Radial;
|
|
using Content.Client.Construction;
|
|
using Content.Shared.Construction.Prototypes;
|
|
using Content.Shared.Popups;
|
|
using Content.Shared._White.Cult.Structures;
|
|
using Robust.Client.Placement;
|
|
using Robust.Client.Player;
|
|
using Robust.Shared.Enums;
|
|
using Robust.Shared.Prototypes;
|
|
|
|
namespace Content.Client._White.Cult.UI.StructureRadial;
|
|
|
|
public sealed class StructureCraftBoundUserInterface : BoundUserInterface
|
|
{
|
|
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
|
[Dependency] private readonly IPlacementManager _placement = default!;
|
|
[Dependency] private readonly IEntitySystemManager _systemManager = default!;
|
|
[Dependency] private readonly IPlayerManager _player = default!;
|
|
[Dependency] private readonly IEntityManager _entMan = default!;
|
|
|
|
private RadialContainer? _radialContainer;
|
|
|
|
public StructureCraftBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
|
{
|
|
IoCManager.InjectDependencies(this);
|
|
}
|
|
|
|
private void CreateUI()
|
|
{
|
|
if (_radialContainer != null)
|
|
ResetUI();
|
|
|
|
_radialContainer = new RadialContainer();
|
|
|
|
foreach (var prototype in _prototypeManager.EnumeratePrototypes<CultStructurePrototype>())
|
|
{
|
|
var radialButton = _radialContainer.AddButton(prototype.StructureName, prototype.Icon);
|
|
radialButton.Controller.OnPressed += _ =>
|
|
{
|
|
Select(prototype.StructureId);
|
|
};
|
|
}
|
|
|
|
_radialContainer.OpenAttachedLocalPlayer();
|
|
}
|
|
|
|
private void ResetUI()
|
|
{
|
|
_radialContainer?.Close();
|
|
_radialContainer = null;
|
|
}
|
|
|
|
protected override void Open()
|
|
{
|
|
base.Open();
|
|
|
|
CreateUI();
|
|
}
|
|
|
|
protected override void Dispose(bool disposing)
|
|
{
|
|
base.Dispose(disposing);
|
|
|
|
ResetUI();
|
|
}
|
|
|
|
private void Select(string id)
|
|
{
|
|
CreateBlueprint(id);
|
|
ResetUI();
|
|
Close();
|
|
}
|
|
|
|
private void CreateBlueprint(string id)
|
|
{
|
|
var newObj = new PlacementInformation
|
|
{
|
|
Range = 2,
|
|
IsTile = false,
|
|
EntityType = id,
|
|
PlacementOption = "SnapgridCenter"
|
|
};
|
|
|
|
_prototypeManager.TryIndex<ConstructionPrototype>(id, out var construct);
|
|
|
|
if (construct == null)
|
|
return;
|
|
|
|
var player = _player.LocalEntity;
|
|
|
|
if (player == null)
|
|
return;
|
|
|
|
PlacementHijack hijack;
|
|
|
|
if (construct.ID == "CultPylon")
|
|
{
|
|
hijack = new CultPylonPlacementHijack(construct, _entMan, player.Value);
|
|
}
|
|
else
|
|
{
|
|
var constructSystem = _systemManager.GetEntitySystem<ConstructionSystem>();
|
|
hijack = new ConstructionPlacementHijack(constructSystem, construct);
|
|
}
|
|
|
|
_placement.BeginPlacing(newObj, hijack);
|
|
}
|
|
}
|