Remove usages of client IPlayerSession from content.
This commit is contained in:
@@ -6,20 +6,21 @@ using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.Player;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Players;
|
||||
|
||||
namespace Content.Client.UserInterface.AdminMenu.CustomControls
|
||||
{
|
||||
[GenerateTypedNameReferences]
|
||||
public partial class PlayerListControl : VBoxContainer
|
||||
{
|
||||
private List<IPlayerSession>? _data;
|
||||
private List<ICommonSession>? _data;
|
||||
|
||||
public event Action<IPlayerSession?>? OnSelectionChanged;
|
||||
public event Action<ICommonSession?>? OnSelectionChanged;
|
||||
|
||||
protected override void EnteredTree()
|
||||
{
|
||||
// Fill the Option data
|
||||
_data = IoCManager.Resolve<IPlayerManager>().Sessions.ToList();
|
||||
_data = IoCManager.Resolve<IPlayerManager>().Sessions.OfType<ICommonSession>().ToList();
|
||||
PopulateList();
|
||||
PlayerItemList.OnItemSelected += PlayerItemListOnOnItemSelected;
|
||||
PlayerItemList.OnItemDeselected += PlayerItemListOnOnItemDeselected;
|
||||
@@ -31,14 +32,14 @@ namespace Content.Client.UserInterface.AdminMenu.CustomControls
|
||||
PopulateList(FilterLineEdit.Text);
|
||||
}
|
||||
|
||||
private static string GetDisplayName(IPlayerSession session)
|
||||
private static string GetDisplayName(ICommonSession session)
|
||||
{
|
||||
return $"{session.Name} ({session.AttachedEntity?.Name})";
|
||||
}
|
||||
|
||||
private void PlayerItemListOnOnItemSelected(ItemList.ItemListSelectedEventArgs obj)
|
||||
{
|
||||
var selectedPlayer = (IPlayerSession) obj.ItemList[obj.ItemIndex].Metadata!;
|
||||
var selectedPlayer = (ICommonSession) obj.ItemList[obj.ItemIndex].Metadata!;
|
||||
OnSelectionChanged?.Invoke(selectedPlayer);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user