Add player list to the ban window
the peptide special
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
using JetBrains.Annotations;
|
||||
using Content.Shared.Administration;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.Console;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.CustomControls;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Utility;
|
||||
using static Robust.Client.UserInterface.Controls.LineEdit;
|
||||
|
||||
namespace Content.Client.Administration.UI.Tabs.AdminTab
|
||||
{
|
||||
@@ -12,18 +14,29 @@ namespace Content.Client.Administration.UI.Tabs.AdminTab
|
||||
[UsedImplicitly]
|
||||
public partial class BanWindow : SS14Window
|
||||
{
|
||||
|
||||
protected override void EnteredTree()
|
||||
{
|
||||
PlayerNameLine.OnTextChanged += PlayerNameLineOnOnTextChanged;
|
||||
PlayerList.OnSelectionChanged += OnPlayerSelectionChanged;
|
||||
SubmitButton.OnPressed += SubmitButtonOnOnPressed;
|
||||
}
|
||||
|
||||
private void PlayerNameLineOnOnTextChanged(LineEdit.LineEditEventArgs obj)
|
||||
private void OnPlayerNameChanged()
|
||||
{
|
||||
SubmitButton.Disabled = string.IsNullOrEmpty(PlayerNameLine.Text);
|
||||
}
|
||||
|
||||
private void PlayerNameLineOnOnTextChanged(LineEditEventArgs obj)
|
||||
{
|
||||
OnPlayerNameChanged();
|
||||
}
|
||||
|
||||
private void OnPlayerSelectionChanged(PlayerInfo? player)
|
||||
{
|
||||
PlayerNameLine.Text = player?.Username ?? string.Empty;
|
||||
OnPlayerNameChanged();
|
||||
}
|
||||
|
||||
private void SubmitButtonOnOnPressed(BaseButton.ButtonEventArgs obj)
|
||||
{
|
||||
// Small verification if Player Name exists
|
||||
|
||||
Reference in New Issue
Block a user