submodule update & fixes the ahelpwindow further
This commit is contained in:
@@ -24,14 +24,6 @@ namespace Content.Client.Administration
|
||||
}
|
||||
}
|
||||
|
||||
public List<PlayerInfo> GetSortedPlayerList(Comparison<PlayerInfo> comparison)
|
||||
{
|
||||
if (_playerList == null) return new List<PlayerInfo>();
|
||||
var list = _playerList.Values.ToList();
|
||||
list.Sort(comparison);
|
||||
return list;
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
@@ -62,10 +62,10 @@ namespace Content.Client.Administration.UI
|
||||
return 0;
|
||||
|
||||
if (!aChannelExists)
|
||||
return -1;
|
||||
return 1;
|
||||
|
||||
if (!bChannelExists)
|
||||
return 1;
|
||||
return -1;
|
||||
|
||||
return bch!.LastMessage.CompareTo(ach!.LastMessage);
|
||||
};
|
||||
@@ -103,7 +103,8 @@ namespace Content.Client.Administration.UI
|
||||
var open = IsOpen;
|
||||
Open();
|
||||
|
||||
ChannelSelector.Refresh();
|
||||
ChannelSelector.RefreshDecorators();
|
||||
ChannelSelector.Sort();
|
||||
|
||||
if (!open)
|
||||
{
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Content.Client.Administration.UI.CustomControls
|
||||
public readonly NetUserId ChannelId;
|
||||
|
||||
public int Unread { get; private set; } = 0;
|
||||
public DateTime LastMessage { get; private set; }
|
||||
public DateTime LastMessage { get; private set; } = DateTime.MinValue;
|
||||
|
||||
public BwoinkPanel(BwoinkSystem bwoinkSys, NetUserId userId)
|
||||
{
|
||||
@@ -34,9 +34,10 @@ namespace Content.Client.Administration.UI.CustomControls
|
||||
|
||||
private void Input_OnTextEntered(LineEdit.LineEditEventArgs args)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(args.Text))
|
||||
_bwoinkSystem.Send(ChannelId, args.Text);
|
||||
if (string.IsNullOrWhiteSpace(args.Text))
|
||||
return;
|
||||
|
||||
_bwoinkSystem.Send(ChannelId, args.Text);
|
||||
SenderLineEdit.Clear();
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Submodule RobustToolbox updated: 579b21716d...f49a29cfb3
Reference in New Issue
Block a user