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.Player;
|
||||||
using Robust.Client.UserInterface.Controls;
|
using Robust.Client.UserInterface.Controls;
|
||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
|
using Robust.Shared.Players;
|
||||||
|
|
||||||
namespace Content.Client.UserInterface.AdminMenu.CustomControls
|
namespace Content.Client.UserInterface.AdminMenu.CustomControls
|
||||||
{
|
{
|
||||||
[GenerateTypedNameReferences]
|
[GenerateTypedNameReferences]
|
||||||
public partial class PlayerListControl : VBoxContainer
|
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()
|
protected override void EnteredTree()
|
||||||
{
|
{
|
||||||
// Fill the Option data
|
// Fill the Option data
|
||||||
_data = IoCManager.Resolve<IPlayerManager>().Sessions.ToList();
|
_data = IoCManager.Resolve<IPlayerManager>().Sessions.OfType<ICommonSession>().ToList();
|
||||||
PopulateList();
|
PopulateList();
|
||||||
PlayerItemList.OnItemSelected += PlayerItemListOnOnItemSelected;
|
PlayerItemList.OnItemSelected += PlayerItemListOnOnItemSelected;
|
||||||
PlayerItemList.OnItemDeselected += PlayerItemListOnOnItemDeselected;
|
PlayerItemList.OnItemDeselected += PlayerItemListOnOnItemDeselected;
|
||||||
@@ -31,14 +32,14 @@ namespace Content.Client.UserInterface.AdminMenu.CustomControls
|
|||||||
PopulateList(FilterLineEdit.Text);
|
PopulateList(FilterLineEdit.Text);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string GetDisplayName(IPlayerSession session)
|
private static string GetDisplayName(ICommonSession session)
|
||||||
{
|
{
|
||||||
return $"{session.Name} ({session.AttachedEntity?.Name})";
|
return $"{session.Name} ({session.AttachedEntity?.Name})";
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PlayerItemListOnOnItemSelected(ItemList.ItemListSelectedEventArgs obj)
|
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);
|
OnSelectionChanged?.Invoke(selectedPlayer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Robust.Client.AutoGenerated;
|
using Robust.Client.AutoGenerated;
|
||||||
using Robust.Client.Console;
|
using Robust.Client.Console;
|
||||||
using Robust.Client.Player;
|
|
||||||
using Robust.Client.UserInterface.Controls;
|
using Robust.Client.UserInterface.Controls;
|
||||||
using Robust.Client.UserInterface.CustomControls;
|
using Robust.Client.UserInterface.CustomControls;
|
||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
|
using Robust.Shared.Players;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
|
||||||
namespace Content.Client.UserInterface.AdminMenu.Tabs.AdminTab
|
namespace Content.Client.UserInterface.AdminMenu.Tabs.AdminTab
|
||||||
@@ -14,7 +14,7 @@ namespace Content.Client.UserInterface.AdminMenu.Tabs.AdminTab
|
|||||||
[UsedImplicitly]
|
[UsedImplicitly]
|
||||||
public partial class KickWindow : SS14Window
|
public partial class KickWindow : SS14Window
|
||||||
{
|
{
|
||||||
private IPlayerSession? _selectedSession;
|
private ICommonSession? _selectedSession;
|
||||||
|
|
||||||
protected override void EnteredTree()
|
protected override void EnteredTree()
|
||||||
{
|
{
|
||||||
@@ -22,7 +22,7 @@ namespace Content.Client.UserInterface.AdminMenu.Tabs.AdminTab
|
|||||||
PlayerList.OnSelectionChanged += OnListOnOnSelectionChanged;
|
PlayerList.OnSelectionChanged += OnListOnOnSelectionChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnListOnOnSelectionChanged(IPlayerSession? obj)
|
private void OnListOnOnSelectionChanged(ICommonSession? obj)
|
||||||
{
|
{
|
||||||
_selectedSession = obj;
|
_selectedSession = obj;
|
||||||
SubmitButton.Disabled = _selectedSession == null;
|
SubmitButton.Disabled = _selectedSession == null;
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ using Robust.Client.Player;
|
|||||||
using Robust.Client.UserInterface.Controls;
|
using Robust.Client.UserInterface.Controls;
|
||||||
using Robust.Client.UserInterface.CustomControls;
|
using Robust.Client.UserInterface.CustomControls;
|
||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
|
using Robust.Shared.Players;
|
||||||
|
|
||||||
namespace Content.Client.UserInterface.AdminMenu.Tabs.AdminTab
|
namespace Content.Client.UserInterface.AdminMenu.Tabs.AdminTab
|
||||||
{
|
{
|
||||||
@@ -14,7 +15,7 @@ namespace Content.Client.UserInterface.AdminMenu.Tabs.AdminTab
|
|||||||
[UsedImplicitly]
|
[UsedImplicitly]
|
||||||
public partial class TeleportWindow : SS14Window
|
public partial class TeleportWindow : SS14Window
|
||||||
{
|
{
|
||||||
private IPlayerSession? _selectedSession;
|
private ICommonSession? _selectedSession;
|
||||||
|
|
||||||
protected override void EnteredTree()
|
protected override void EnteredTree()
|
||||||
{
|
{
|
||||||
@@ -22,7 +23,7 @@ namespace Content.Client.UserInterface.AdminMenu.Tabs.AdminTab
|
|||||||
PlayerList.OnSelectionChanged += OnListOnOnSelectionChanged;
|
PlayerList.OnSelectionChanged += OnListOnOnSelectionChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnListOnOnSelectionChanged(IPlayerSession? obj)
|
private void OnListOnOnSelectionChanged(ICommonSession? obj)
|
||||||
{
|
{
|
||||||
_selectedSession = obj;
|
_selectedSession = obj;
|
||||||
SubmitButton.Disabled = _selectedSession == null;
|
SubmitButton.Disabled = _selectedSession == null;
|
||||||
|
|||||||
Reference in New Issue
Block a user