* basic eui and window * finish EUI, update defaults * unnecessary usings * convert to bounduserinterface * merge me up merge me up inside * Fix repeated define for component in prototype * impl swept UI suggestion * apply discord reviews * small changes
36 lines
991 B
C#
36 lines
991 B
C#
using Content.Shared.Chemistry;
|
|
using Content.Shared.Chemistry.Reagent;
|
|
using JetBrains.Annotations;
|
|
using Robust.Client.GameObjects;
|
|
using Robust.Shared.GameObjects;
|
|
|
|
namespace Content.Client.Chemistry.UI
|
|
{
|
|
[UsedImplicitly]
|
|
public class TransferAmountBoundUserInterface : BoundUserInterface
|
|
{
|
|
private TransferAmountWindow? _window;
|
|
|
|
protected override void Open()
|
|
{
|
|
base.Open();
|
|
_window = new TransferAmountWindow();
|
|
|
|
_window.applyButton.OnPressed += _ =>
|
|
{
|
|
if (int.TryParse(_window.amountLineEdit.Text, out var i))
|
|
{
|
|
SendMessage(new TransferAmountSetValueMessage(ReagentUnit.New(i)));
|
|
_window.Close();
|
|
}
|
|
};
|
|
|
|
_window.OpenCentered();
|
|
}
|
|
|
|
public TransferAmountBoundUserInterface(ClientUserInterfaceComponent owner, object uiKey) : base(owner, uiKey)
|
|
{
|
|
}
|
|
}
|
|
}
|