Better notes and bans (#14228)
Co-authored-by: Chief-Engineer <119664036+Chief-Engineer@users.noreply.github.com>
This commit is contained in:
48
Content.Client/Administration/UI/BanPanel/BanPanelEui.cs
Normal file
48
Content.Client/Administration/UI/BanPanel/BanPanelEui.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Content.Client.Eui;
|
||||
using Content.Shared.Administration;
|
||||
using Content.Shared.Eui;
|
||||
using JetBrains.Annotations;
|
||||
|
||||
namespace Content.Client.Administration.UI.BanPanel;
|
||||
|
||||
[UsedImplicitly]
|
||||
public sealed class BanPanelEui : BaseEui
|
||||
{
|
||||
private BanPanel BanPanel { get; }
|
||||
|
||||
public BanPanelEui()
|
||||
{
|
||||
BanPanel = new BanPanel();
|
||||
BanPanel.OnClose += () => SendMessage(new CloseEuiMessage());
|
||||
BanPanel.BanSubmitted += (player, ip, useLastIp, hwid, useLastHwid, minutes, reason, severity, roles)
|
||||
=> SendMessage(new BanPanelEuiStateMsg.CreateBanRequest(player, ip, useLastIp, hwid, useLastHwid, minutes, reason, severity, roles));
|
||||
BanPanel.PlayerChanged += player => SendMessage(new BanPanelEuiStateMsg.GetPlayerInfoRequest(player));
|
||||
}
|
||||
|
||||
public override void HandleState(EuiStateBase state)
|
||||
{
|
||||
if (state is not BanPanelEuiState s)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
BanPanel.UpdateBanFlag(s.HasBan);
|
||||
BanPanel.UpdatePlayerData(s.PlayerName);
|
||||
}
|
||||
|
||||
public override void Opened()
|
||||
{
|
||||
BanPanel.OpenCentered();
|
||||
}
|
||||
|
||||
public override void Closed()
|
||||
{
|
||||
BanPanel.Close();
|
||||
BanPanel.Dispose();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user