submodule update & fixes the ahelpwindow further

This commit is contained in:
Paul
2022-01-03 04:14:10 +01:00
parent 7e266b41ff
commit 33572c5cc8
5 changed files with 25 additions and 17 deletions

View File

@@ -53,13 +53,25 @@ namespace Content.Client.Administration.UI.CustomControls
OnSelectionChanged?.Invoke(null);
}
public void Refresh() => PopulateList();
public void RefreshDecorators()
{
foreach (var item in PlayerItemList)
{
DecoratePlayer?.Invoke((PlayerInfo) item.Metadata!, item);
}
}
public void Sort()
{
if(Comparison != null)
PlayerItemList.Sort((a, b) => Comparison((PlayerInfo) a.Metadata!, (PlayerInfo) b.Metadata!));
}
private void PopulateList(IReadOnlyList<PlayerInfo> _ = null!)
{
PlayerItemList.Clear();
foreach (var info in Comparison == null ? _adminSystem.PlayerList : _adminSystem.GetSortedPlayerList(Comparison))
foreach (var info in _adminSystem.PlayerList)
{
var displayName = $"{info.CharacterName} ({info.Username})";
if (!string.IsNullOrEmpty(FilterLineEdit.Text) &&
@@ -76,6 +88,8 @@ namespace Content.Client.Administration.UI.CustomControls
DecoratePlayer?.Invoke(info, item);
PlayerItemList.Add(item);
}
Sort();
}
}
}