перенос файлов клиента из папки White в _White

This commit is contained in:
Remuchi
2024-01-28 17:32:55 +07:00
parent c80b10a688
commit 21dbccfec9
139 changed files with 345 additions and 434 deletions

View File

@@ -0,0 +1,58 @@
using Content.Shared.White.Economy;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
namespace Content.Client._White.Economy.Ui;
[GenerateTypedNameReferences]
public sealed partial class EftposWindow : DefaultWindow
{
public Action<EftposLockMessage>? OnCardButtonPressed;
public EftposWindow()
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
AmountLineEdit.OnTextChanged += _ =>
{
if (!int.TryParse((string?) AmountLineEdit.Text, out var result) || result <= 0)
AmountLineEdit.Text = string.Empty;
AmountLineEdit.Text = result.ToString();
};
CardButton.OnPressed += _ =>
{
if (!int.TryParse((string?) AmountLineEdit.Text, out var result) || result < 0)
result = 0;
OnCardButtonPressed?.Invoke(new EftposLockMessage(result));
};
}
public void UpdateState(BoundUserInterfaceState state)
{
if (state is not EftposBuiState eftState)
return;
AmountLineEdit.Text = eftState.Amount == 0 ? string.Empty : eftState.Amount.ToString();
if (eftState.Locked)
{
CardButton.Text = Loc.GetString("eftpos-ui-card-unlock-text");
CardButton.ToolTip = Loc.GetString("eftpos-ui-card-unlock-desc");
AmountLineEdit.Editable = false;
}
else
{
CardButton.Text = Loc.GetString("eftpos-ui-card-lock-text");
CardButton.ToolTip = Loc.GetString("eftpos-ui-card-lock-desc");
AmountLineEdit.Editable = true;
}
AccountLabel.Text = eftState.Owner == string.Empty
? string.Empty
: Loc.GetString("eftpos-ui-account-text", ("owner", eftState.Owner));
}
}