Fix & extend add reagent verb (#4954)
* AddReagentWindow * addReagent command * functional UI * fix networking * add comments & docstrings * Remove unecesary system * cleanup & close-eui * tweak default window size * fix EUI closing error * fix merge issues * fix merge
This commit is contained in:
54
Content.Server/Administration/UI/EditSolutionsEui.cs
Normal file
54
Content.Server/Administration/UI/EditSolutionsEui.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using Content.Server.Chemistry.Components.SolutionManager;
|
||||
using Content.Server.EUI;
|
||||
using Content.Shared.Administration;
|
||||
using Content.Shared.Eui;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
|
||||
namespace Content.Server.Administration.UI
|
||||
{
|
||||
/// <summary>
|
||||
/// Admin Eui for displaying and editing the reagents in a solution.
|
||||
/// </summary>
|
||||
[UsedImplicitly]
|
||||
public sealed class EditSolutionsEui : BaseEui
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
public readonly EntityUid Target;
|
||||
|
||||
public EditSolutionsEui(EntityUid entity)
|
||||
{
|
||||
IoCManager.InjectDependencies(this);
|
||||
Target = entity;
|
||||
}
|
||||
|
||||
public override void Opened()
|
||||
{
|
||||
base.Opened();
|
||||
StateDirty();
|
||||
}
|
||||
|
||||
public override void Closed()
|
||||
{
|
||||
base.Closed();
|
||||
EntitySystem.Get<AdminVerbSystem>().OnEditSolutionsEuiClosed(Player);
|
||||
}
|
||||
|
||||
public override EuiStateBase GetNewState()
|
||||
{
|
||||
var solutions = _entityManager.GetComponentOrNull<SolutionContainerManagerComponent>(Target)?.Solutions;
|
||||
return new EditSolutionsEuiState(Target, solutions);
|
||||
}
|
||||
|
||||
public override void HandleMessage(EuiMessageBase msg)
|
||||
{
|
||||
switch (msg)
|
||||
{
|
||||
case EditSolutionsEuiMsg.Close:
|
||||
Close();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user