fixes adminmenus sins (fixes it)
This commit is contained in:
@@ -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;
|
||||
@@ -13,7 +14,7 @@ namespace Content.Client.Administration.UI.Tabs.AdminTab
|
||||
[UsedImplicitly]
|
||||
public partial class PlayerActionsWindow : SS14Window
|
||||
{
|
||||
private ICommonSession? _selectedSession;
|
||||
private PlayerInfo? _selectedPlayer;
|
||||
|
||||
protected override void EnteredTree()
|
||||
{
|
||||
@@ -23,10 +24,10 @@ namespace Content.Client.Administration.UI.Tabs.AdminTab
|
||||
PlayerList.OnSelectionChanged += OnListOnOnSelectionChanged;
|
||||
}
|
||||
|
||||
private void OnListOnOnSelectionChanged(ICommonSession? obj)
|
||||
private void OnListOnOnSelectionChanged(PlayerInfo? obj)
|
||||
{
|
||||
_selectedSession = obj;
|
||||
var disableButtons = _selectedSession == null;
|
||||
_selectedPlayer = obj;
|
||||
var disableButtons = _selectedPlayer == null;
|
||||
SubmitKickButton.Disabled = disableButtons;
|
||||
SubmitAHelpButton.Disabled = disableButtons;
|
||||
SubmitRespawnButton.Disabled = disableButtons;
|
||||
@@ -34,26 +35,27 @@ namespace Content.Client.Administration.UI.Tabs.AdminTab
|
||||
|
||||
private void SubmitKickButtonOnPressed(BaseButton.ButtonEventArgs obj)
|
||||
{
|
||||
if (_selectedSession == null)
|
||||
if (_selectedPlayer == null)
|
||||
return;
|
||||
IoCManager.Resolve<IClientConsoleHost>().ExecuteCommand(
|
||||
$"kick \"{_selectedSession.Name}\" \"{CommandParsing.Escape(ReasonLine.Text)}\"");
|
||||
$"kick \"{_selectedPlayer.Username}\" \"{CommandParsing.Escape(ReasonLine.Text)}\"");
|
||||
}
|
||||
|
||||
private void SubmitAhelpButtonOnPressed(BaseButton.ButtonEventArgs obj)
|
||||
{
|
||||
if (_selectedSession == null)
|
||||
if (_selectedPlayer == null)
|
||||
return;
|
||||
|
||||
IoCManager.Resolve<IClientConsoleHost>().ExecuteCommand(
|
||||
$"openahelp \"{_selectedSession.UserId}\"");
|
||||
$"openahelp \"{_selectedPlayer.SessionId}\"");
|
||||
}
|
||||
|
||||
private void SubmitRespawnButtonOnPressed(BaseButton.ButtonEventArgs obj)
|
||||
{
|
||||
if (_selectedSession == null)
|
||||
if (_selectedPlayer == null)
|
||||
return;
|
||||
IoCManager.Resolve<IClientConsoleHost>().ExecuteCommand(
|
||||
$"respawn \"{_selectedSession.Name}\"");
|
||||
$"respawn \"{_selectedPlayer.Username}\"");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user