Basic AHelp Panel, Ported & Fixed (#4776)

* Graft from https://github.com/space-wizards/space-station-14/pull/3049

* 'openahelp' command

* Add AHelp into escape menu

* Add a way to ahelp a player from the kick window

* bwoink: XAMLify, bugfix, etc.

* Rename the kick/bwoink window the Player Actions Panel

* Add the bwoink sound y'all know and love

adminhelp.ogg taken from d775e1ac80/sound/effects/adminhelp.ogg
 (available in master, therefore see master license: "All assets including icons and sound are under a Creative Commons 3.0 BY-SA license unless otherwise indicated.")
 "Changed the adminhelpsound to some creative commons sound I pinched. Until somebody can get a better one. I'm sick of MAAAAAAAAOOOOOOW."
 Actual source is https://freesound.org/people/martian/sounds/19261/ (CC0)
 The sound had been reversed and the volume altered.

* Actually play the bwoink sound on receiving an ahelp that you didn't send
This commit is contained in:
20kdc
2021-10-06 16:25:27 +01:00
committed by GitHub
parent 05b8d40071
commit b3f43509d1
15 changed files with 346 additions and 6 deletions

View File

@@ -7,7 +7,7 @@
MinSize="50 50">
<BoxContainer Orientation="Vertical">
<GridContainer Columns="4">
<cc:UICommandButton Command="kick" Text="{Loc Kick}" WindowType="{x:Type at:KickWindow}" />
<cc:UICommandButton Command="kick" Text="{Loc admin-kick-window-title}" WindowType="{x:Type at:KickWindow}" />
<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}" />

View File

@@ -1,14 +1,17 @@
<SS14Window
xmlns="https://spacestation14.io"
xmlns:cc="clr-namespace:Content.Client.Administration.UI.CustomControls"
Title="{Loc Kick}" MinSize="425 272">
Title="{Loc admin-kick-window-title}" MinSize="425 272">
<BoxContainer Orientation="Vertical">
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc Reason}" MinWidth="100" />
<Control MinWidth="50" />
<LineEdit Name="ReasonLine" MinWidth="100" HorizontalExpand="True" />
</BoxContainer>
<cc:PlayerListControl Name="PlayerList" />
<Button Name="SubmitButton" Text="{Loc Kick}" />
<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}" />
</BoxContainer>
</BoxContainer>
</SS14Window>

View File

@@ -18,13 +18,16 @@ namespace Content.Client.Administration.UI.Tabs.AdminTab
protected override void EnteredTree()
{
SubmitButton.OnPressed += SubmitButtonOnOnPressed;
SubmitAHButton.OnPressed += SubmitAHButtonOnOnPressed;
PlayerList.OnSelectionChanged += OnListOnOnSelectionChanged;
}
private void OnListOnOnSelectionChanged(ICommonSession? obj)
{
_selectedSession = obj;
SubmitButton.Disabled = _selectedSession == null;
var disableButtons = _selectedSession == null;
SubmitButton.Disabled = disableButtons;
SubmitAHButton.Disabled = disableButtons;
}
private void SubmitButtonOnOnPressed(BaseButton.ButtonEventArgs obj)
@@ -34,5 +37,13 @@ namespace Content.Client.Administration.UI.Tabs.AdminTab
IoCManager.Resolve<IClientConsoleHost>().ExecuteCommand(
$"kick \"{_selectedSession.Name}\" \"{CommandParsing.Escape(ReasonLine.Text)}\"");
}
private void SubmitAHButtonOnOnPressed(BaseButton.ButtonEventArgs obj)
{
if (_selectedSession == null)
return;
IoCManager.Resolve<IClientConsoleHost>().ExecuteCommand(
$"openahelp \"{_selectedSession.UserId}\"");
}
}
}