Files
tbd-station-14/Content.Client/Traitor/Uplink/UplinkWithdrawWindow.xaml.cs
Alex Evgrashin 4002aa5852 Uplink UI icons and withdraw button (#4929)
* Uplink menu has icons now

* Add item icons

* Add few descriptions

* Better withdraw window

* Finished with withdraw window

* Refactored withdraw ui and fix some bugs

* Basic withdraw

* Quick fixes

* Removed uplink listing for TCs

* Move slider to separate control

* Final touches

* A bit more

* Not again...

* Fixed names

* Address review

* Fixed robust

* Non necessary check
2021-10-29 11:40:47 +02:00

35 lines
1005 B
C#

using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Localization;
namespace Content.Client.Traitor.Uplink
{
/// <summary>
/// Window to select amount TC to withdraw from Uplink account
/// Used as sub-window in Uplink UI
/// </summary>
[GenerateTypedNameReferences]
public partial class UplinkWithdrawWindow : SS14Window
{
public event System.Action<int>? OnWithdrawAttempt;
public UplinkWithdrawWindow(int tcCount)
{
RobustXamlLoader.Load(this);
// setup withdraw slider
WithdrawSlider.MinValue = 1;
WithdrawSlider.MaxValue = tcCount;
// and buttons
ApplyButton.OnButtonDown += _ =>
{
OnWithdrawAttempt?.Invoke(WithdrawSlider.Value);
Close();
};
CancelButton.OnButtonDown += _ => Close();
}
}
}