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:
@@ -0,0 +1,43 @@
|
||||
using Content.Client.Eui;
|
||||
using Content.Shared.Administration;
|
||||
using Content.Shared.Eui;
|
||||
using JetBrains.Annotations;
|
||||
|
||||
namespace Content.Client.Administration.UI.ManageSolutions
|
||||
{
|
||||
/// <summary>
|
||||
/// Admin Eui for displaying and editing the reagents in a solution.
|
||||
/// </summary>
|
||||
[UsedImplicitly]
|
||||
public sealed class EditSolutionsEui : BaseEui
|
||||
{
|
||||
private readonly EditSolutionsWindow _window;
|
||||
|
||||
public EditSolutionsEui()
|
||||
{
|
||||
_window = new EditSolutionsWindow();
|
||||
_window.OnClose += () => SendMessage(new EditSolutionsEuiMsg.Close());
|
||||
}
|
||||
|
||||
public override void Opened()
|
||||
{
|
||||
base.Opened();
|
||||
_window.OpenCentered();
|
||||
}
|
||||
|
||||
public override void Closed()
|
||||
{
|
||||
base.Closed();
|
||||
_window.OnClose -= () => SendMessage(new EditSolutionsEuiMsg.Close());
|
||||
_window.Close();
|
||||
}
|
||||
|
||||
public override void HandleState(EuiStateBase baseState)
|
||||
{
|
||||
var state = (EditSolutionsEuiState) baseState;
|
||||
_window.SetTargetEntity(state.Target);
|
||||
_window.UpdateSolutions(state.Solutions);
|
||||
_window.UpdateReagents();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user