Fix not being able to message players that weren't filtered by the ahelp menu (#13553)

This commit is contained in:
Kara
2023-01-17 16:11:20 -06:00
committed by GitHub
parent b1fd33e000
commit 25df5bc0a4
2 changed files with 19 additions and 2 deletions

View File

@@ -1,10 +1,12 @@
using System.Text; using System.Linq;
using System.Text;
using System.Threading; using System.Threading;
using Content.Client.Administration.Managers; using Content.Client.Administration.Managers;
using Content.Client.Administration.UI.CustomControls; using Content.Client.Administration.UI.CustomControls;
using Content.Client.Administration.UI.Tabs.AdminTab; using Content.Client.Administration.UI.Tabs.AdminTab;
using Content.Client.Stylesheets; using Content.Client.Stylesheets;
using Content.Client.UserInterface.Systems.Bwoink; using Content.Client.UserInterface.Systems.Bwoink;
using Content.Client.UserInterface.Systems.Chat.Controls;
using Content.Shared.Administration; using Content.Shared.Administration;
using Robust.Client.AutoGenerated; using Robust.Client.AutoGenerated;
using Robust.Client.Console; using Robust.Client.Console;
@@ -171,13 +173,23 @@ namespace Content.Client.Administration.UI.Bwoink
ChannelSelector.PopulateList(); ChannelSelector.PopulateList();
} }
public void SelectChannel(NetUserId channel) public void SelectChannel(NetUserId channel)
{ {
if (!ChannelSelector.PlayerInfo.TryFirstOrDefault( if (!ChannelSelector.PlayerInfo.TryFirstOrDefault(
i => i.SessionId == channel, out var info)) i => i.SessionId == channel, out var info))
return; return;
// clear filter if we're trying to select a channel for a player that isn't currently filtered
// i.e. through the message verb.
var data = new PlayerListData(info);
if (!ChannelSelector.PlayerListContainer.Data.Contains(data))
{
ChannelSelector.StopFiltering();
}
ChannelSelector.PopulateList(); ChannelSelector.PopulateList();
ChannelSelector.PlayerListContainer.Select(new PlayerListData(info)); ChannelSelector.PlayerListContainer.Select(data);
} }
private void FixButtons() private void FixButtons()

View File

@@ -62,6 +62,11 @@ namespace Content.Client.Administration.UI.CustomControls
} }
} }
public void StopFiltering()
{
FilterLineEdit.Text = string.Empty;
}
private void FilterList() private void FilterList()
{ {
_sortedPlayerList.Clear(); _sortedPlayerList.Clear();