Show ban and note count in ahelp window (#15328)
This commit is contained in:
@@ -10,10 +10,11 @@
|
||||
<cc:PlayerListControl Access="Public" Name="ChannelSelector" HorizontalExpand="True" SizeFlagsStretchRatio="1" />
|
||||
<BoxContainer Orientation="Vertical" HorizontalExpand="True" SizeFlagsStretchRatio="2">
|
||||
<BoxContainer Access="Public" Name="BwoinkArea" VerticalExpand="True" />
|
||||
<BoxContainer Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<Button Margin="0 0 10 0" Visible="True" Name="PopOut" Access="Public" Text="{Loc 'admin-logs-pop-out'}"/>
|
||||
<Button Visible="False" Name="Bans" Text="{Loc 'admin-player-actions-bans'}" />
|
||||
<Button Visible="False" Name="Notes" Text="{Loc 'admin-player-actions-notes'}" />
|
||||
<BoxContainer Orientation="Horizontal" HorizontalExpand="True">
|
||||
<Button Margin="0 0 10 0" Visible="True" Name="PopOut" Access="Public" Text="{Loc 'admin-logs-pop-out'}"
|
||||
HorizontalAlignment="Left"/>
|
||||
<Button Visible="False" Name="Bans" />
|
||||
<Button Visible="False" Name="Notes" />
|
||||
<Button Visible="False" Name="Kick" Text="{Loc 'admin-player-actions-kick'}" />
|
||||
<Button Visible="False" Name="Ban" Text="{Loc 'admin-player-actions-ban'}" />
|
||||
<Button Visible="False" Name="Respawn" Text="{Loc 'admin-player-actions-respawn'}" />
|
||||
|
||||
@@ -6,13 +6,11 @@ using Content.Client.Administration.UI.CustomControls;
|
||||
using Content.Client.Administration.UI.Tabs.AdminTab;
|
||||
using Content.Client.Stylesheets;
|
||||
using Content.Client.UserInterface.Systems.Bwoink;
|
||||
using Content.Client.UserInterface.Systems.Chat.Controls;
|
||||
using Content.Shared.Administration;
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.Console;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.CustomControls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
using Robust.Shared.Network;
|
||||
using Robust.Shared.Utility;
|
||||
@@ -51,9 +49,17 @@ namespace Content.Client.Administration.UI.Bwoink
|
||||
ChannelSelector.OnSelectionChanged += sel =>
|
||||
{
|
||||
_currentPlayer = sel;
|
||||
if (sel is not null)
|
||||
if (sel == null)
|
||||
{
|
||||
SetPlayerActionsVisibility(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
SwitchToChannel(sel.SessionId);
|
||||
|
||||
SetPlayerActionsVisibility(true);
|
||||
Bans.Text = Loc.GetString("admin-player-actions-bans", ("count", sel.Bans));
|
||||
Notes.Text = Loc.GetString("admin-player-actions-notes", ("count", sel.Notes));
|
||||
}
|
||||
|
||||
ChannelSelector.PlayerListContainer.DirtyList();
|
||||
@@ -164,6 +170,8 @@ namespace Content.Client.Administration.UI.Bwoink
|
||||
{
|
||||
uiController.PopOut();
|
||||
};
|
||||
|
||||
SetPlayerActionsVisibility(_currentPlayer != null);
|
||||
}
|
||||
|
||||
private Dictionary<Control, (CancellationTokenSource cancellation, string? originalText)> Confirmations { get; } = new();
|
||||
@@ -245,8 +253,7 @@ namespace Content.Client.Administration.UI.Bwoink
|
||||
{
|
||||
foreach (var bw in BwoinkArea.Children)
|
||||
bw.Visible = false;
|
||||
var panel = AHelpHelper.EnsurePanel(ch);
|
||||
panel.Visible = true;
|
||||
AHelpHelper.EnsurePanel(ch).Visible = true;
|
||||
}
|
||||
|
||||
private bool TryConfirm(Button button)
|
||||
@@ -273,5 +280,15 @@ namespace Content.Client.Administration.UI.Bwoink
|
||||
button.Text = Loc.GetString("admin-player-actions-confirm");
|
||||
return false;
|
||||
}
|
||||
|
||||
private void SetPlayerActionsVisibility(bool visible)
|
||||
{
|
||||
Bans.Visible = visible;
|
||||
Notes.Visible = visible;
|
||||
Kick.Visible = visible;
|
||||
Ban.Visible = visible;
|
||||
Respawn.Visible = visible;
|
||||
Teleport.Visible = visible;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<DefaultWindow xmlns="https://spacestation14.io"
|
||||
xmlns:cc="clr-namespace:Content.Client.Administration.UI.Bwoink"
|
||||
SetSize="900 500"
|
||||
SetSize="1000 500"
|
||||
HeaderClass="windowHeaderAlert"
|
||||
TitleClass="windowTitleAlert"
|
||||
Title="{Loc 'bwoink-user-title'}" >
|
||||
|
||||
@@ -1,20 +1,6 @@
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using Content.Client.Administration.Managers;
|
||||
using Content.Client.Administration.UI.CustomControls;
|
||||
using Content.Client.Administration.UI.Tabs.AdminTab;
|
||||
using Content.Client.Stylesheets;
|
||||
using Content.Client.UserInterface.Systems.Bwoink;
|
||||
using Content.Shared.Administration;
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.Console;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.CustomControls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
using Robust.Shared.Network;
|
||||
using Robust.Shared.Utility;
|
||||
using Timer = Robust.Shared.Timing.Timer;
|
||||
|
||||
namespace Content.Client.Administration.UI.Bwoink
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user