using Robust.Client.AutoGenerated; using Robust.Client.UserInterface.CustomControls; using Robust.Client.UserInterface.XAML; using Robust.Shared.Localization; namespace Content.Client.Traitor.Uplink { /// /// Window to select amount TC to withdraw from Uplink account /// Used as sub-window in Uplink UI /// [GenerateTypedNameReferences] public sealed partial class UplinkWithdrawWindow : DefaultWindow { public event System.Action? 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(); } } }