fixes adminmenus sins (fixes it)

This commit is contained in:
Paul
2021-11-10 20:38:18 +01:00
parent 30c528d0a1
commit aeffabbea4
4 changed files with 28 additions and 22 deletions

View File

@@ -1,4 +1,5 @@
using JetBrains.Annotations;
using Content.Shared.Administration;
using JetBrains.Annotations;
using Robust.Client.AutoGenerated;
using Robust.Client.Console;
using Robust.Client.UserInterface.Controls;
@@ -12,7 +13,7 @@ namespace Content.Client.Administration.UI.Tabs.AdminTab
[UsedImplicitly]
public partial class TeleportWindow : SS14Window
{
private ICommonSession? _selectedSession;
private PlayerInfo? _selectedPlayer;
protected override void EnteredTree()
{
@@ -20,19 +21,19 @@ namespace Content.Client.Administration.UI.Tabs.AdminTab
PlayerList.OnSelectionChanged += OnListOnOnSelectionChanged;
}
private void OnListOnOnSelectionChanged(ICommonSession? obj)
private void OnListOnOnSelectionChanged(PlayerInfo? obj)
{
_selectedSession = obj;
SubmitButton.Disabled = _selectedSession == null;
_selectedPlayer = obj;
SubmitButton.Disabled = _selectedPlayer == null;
}
private void SubmitButtonOnOnPressed(BaseButton.ButtonEventArgs obj)
{
if (_selectedSession == null)
if (_selectedPlayer == null)
return;
// Execute command
IoCManager.Resolve<IClientConsoleHost>().ExecuteCommand(
$"tpto \"{_selectedSession.Name}\"");
$"tpto \"{_selectedPlayer.Username}\"");
}
}
}