Renames KickWindow, adds a Respawn command button. (#4791)
* Renames KickWindow, adds a Respawn command button. * Additionally fix PlayerActionsWindow not correctly having the buttons disabled on open.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
MinSize="50 50">
|
||||
<BoxContainer Orientation="Vertical">
|
||||
<GridContainer Columns="4">
|
||||
<cc:UICommandButton Command="kick" Text="{Loc admin-kick-window-title}" WindowType="{x:Type at:KickWindow}" />
|
||||
<cc:UICommandButton Command="kick" Text="{Loc admin-player-actions-window-title}" WindowType="{x:Type at:PlayerActionsWindow}" />
|
||||
<cc:UICommandButton Command="ban" Text="{Loc Ban}" WindowType="{x:Type at:BanWindow}" />
|
||||
<cc:CommandButton Command="aghost" Text="{Loc Admin Ghost}" />
|
||||
<cc:UICommandButton Command="tpto" Text="{Loc Teleport}" WindowType="{x:Type at:TeleportWindow}" />
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<SS14Window
|
||||
xmlns="https://spacestation14.io"
|
||||
xmlns:cc="clr-namespace:Content.Client.Administration.UI.CustomControls"
|
||||
Title="{Loc admin-kick-window-title}" MinSize="425 272">
|
||||
Title="{Loc admin-player-actions-window-title}" MinSize="425 272">
|
||||
<BoxContainer Orientation="Vertical">
|
||||
<BoxContainer Orientation="Horizontal">
|
||||
<Label Text="{Loc Reason}" MinWidth="100" />
|
||||
@@ -10,8 +10,9 @@
|
||||
</BoxContainer>
|
||||
<cc:PlayerListControl Name="PlayerList" VerticalExpand="True" />
|
||||
<BoxContainer Orientation="Horizontal">
|
||||
<Button Name="SubmitButton" Text="{Loc admin-kick-window-kick-text}" />
|
||||
<Button Name="SubmitAHButton" Text="{Loc admin-kick-window-ahelp-text}" />
|
||||
<Button Name="SubmitKickButton" Text="{Loc admin-player-actions-window-kick-text}" Disabled="True"/>
|
||||
<Button Name="SubmitAHelpButton" Text="{Loc admin-player-actions-window-ahelp-text}" Disabled="True"/>
|
||||
<Button Name="SubmitRespawnButton" Text="{Loc admin-player-actions-window-respawn-text}" Disabled="True"/>
|
||||
</BoxContainer>
|
||||
</BoxContainer>
|
||||
</SS14Window>
|
||||
@@ -11,14 +11,15 @@ namespace Content.Client.Administration.UI.Tabs.AdminTab
|
||||
{
|
||||
[GenerateTypedNameReferences]
|
||||
[UsedImplicitly]
|
||||
public partial class KickWindow : SS14Window
|
||||
public partial class PlayerActionsWindow : SS14Window
|
||||
{
|
||||
private ICommonSession? _selectedSession;
|
||||
|
||||
protected override void EnteredTree()
|
||||
{
|
||||
SubmitButton.OnPressed += SubmitButtonOnOnPressed;
|
||||
SubmitAHButton.OnPressed += SubmitAHButtonOnOnPressed;
|
||||
SubmitKickButton.OnPressed += SubmitKickButtonOnPressed;
|
||||
SubmitAHelpButton.OnPressed += SubmitAhelpButtonOnPressed;
|
||||
SubmitRespawnButton.OnPressed += SubmitRespawnButtonOnPressed;
|
||||
PlayerList.OnSelectionChanged += OnListOnOnSelectionChanged;
|
||||
}
|
||||
|
||||
@@ -26,11 +27,12 @@ namespace Content.Client.Administration.UI.Tabs.AdminTab
|
||||
{
|
||||
_selectedSession = obj;
|
||||
var disableButtons = _selectedSession == null;
|
||||
SubmitButton.Disabled = disableButtons;
|
||||
SubmitAHButton.Disabled = disableButtons;
|
||||
SubmitKickButton.Disabled = disableButtons;
|
||||
SubmitAHelpButton.Disabled = disableButtons;
|
||||
SubmitRespawnButton.Disabled = disableButtons;
|
||||
}
|
||||
|
||||
private void SubmitButtonOnOnPressed(BaseButton.ButtonEventArgs obj)
|
||||
private void SubmitKickButtonOnPressed(BaseButton.ButtonEventArgs obj)
|
||||
{
|
||||
if (_selectedSession == null)
|
||||
return;
|
||||
@@ -38,12 +40,20 @@ namespace Content.Client.Administration.UI.Tabs.AdminTab
|
||||
$"kick \"{_selectedSession.Name}\" \"{CommandParsing.Escape(ReasonLine.Text)}\"");
|
||||
}
|
||||
|
||||
private void SubmitAHButtonOnOnPressed(BaseButton.ButtonEventArgs obj)
|
||||
private void SubmitAhelpButtonOnPressed(BaseButton.ButtonEventArgs obj)
|
||||
{
|
||||
if (_selectedSession == null)
|
||||
return;
|
||||
IoCManager.Resolve<IClientConsoleHost>().ExecuteCommand(
|
||||
$"openahelp \"{_selectedSession.UserId}\"");
|
||||
}
|
||||
|
||||
private void SubmitRespawnButtonOnPressed(BaseButton.ButtonEventArgs obj)
|
||||
{
|
||||
if (_selectedSession == null)
|
||||
return;
|
||||
IoCManager.Resolve<IClientConsoleHost>().ExecuteCommand(
|
||||
$"respawn \"{_selectedSession.Name}\"");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
admin-kick-window-title = Player Actions Panel
|
||||
admin-kick-window-kick-text = Kick
|
||||
admin-kick-window-ahelp-text = AHelp
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
admin-player-actions-window-title = Player Actions Panel
|
||||
admin-player-actions-window-kick-text = Kick
|
||||
admin-player-actions-window-ahelp-text = AHelp
|
||||
admin-player-actions-window-respawn-text = Respawn
|
||||
Reference in New Issue
Block a user