-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<!-- This is a semi-strict format, you can add/remove sections as needed but the order/format should be kept the same Remove these comments before submitting --> # Description <!-- Explain this PR in as much detail as applicable Some example prompts to consider: How might this affect the game? The codebase? What might be some alternatives to this? How/Who does this benefit/hurt [the game/codebase]? --> Link to every PR I cherry-picked: 1. new-frontiers-14/frontier-station-14#2283 2. space-wizards/space-station-14#29219 3. space-wizards/space-station-14#30075 4. space-wizards/space-station-14#28639 5. space-wizards/space-station-14#32527 6. space-wizards/space-station-14#28030 7. space-wizards/space-station-14#28178 The main purpose of this PR is the first cherry-picked PR. It adds the ability for admins to reply to ahelps via discord using an HTTP POST request. See all relevant details in the initial PR by Myzumi. --------- Co-authored-by: Myzumi <[email protected]> Co-authored-by: Whatstone <[email protected]> Co-authored-by: Whatstone <[email protected]> Co-authored-by: Pieter-Jan Briers <[email protected]> Co-authored-by: to4no_fix <[email protected]> Co-authored-by: Repo <[email protected]> Co-authored-by: Chief-Engineer <[email protected]> Co-authored-by: metalgearsloth <[email protected]> Co-authored-by: Leon Friedrich <[email protected]> Co-authored-by: ShadowCommander <[email protected]>
- Loading branch information
1 parent
2eafa0d
commit b8e75da
Showing
48 changed files
with
1,715 additions
and
391 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
Content.Client/Administration/UI/CustomControls/PlayerListEntry.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<BoxContainer xmlns="https://spacestation14.io" | ||
Orientation="Horizontal" HorizontalExpand="true"> | ||
<Label Name="PlayerEntryLabel" Text="" ClipText="True" HorizontalExpand="True" /> | ||
<TextureButton Name="PlayerEntryPinButton" | ||
HorizontalAlignment="Right" /> | ||
</BoxContainer> |
58 changes: 58 additions & 0 deletions
58
Content.Client/Administration/UI/CustomControls/PlayerListEntry.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
using Content.Client.Stylesheets; | ||
using Content.Shared.Administration; | ||
using Robust.Client.AutoGenerated; | ||
using Robust.Client.GameObjects; | ||
using Robust.Client.UserInterface.Controls; | ||
using Robust.Client.UserInterface.XAML; | ||
using Robust.Shared.Utility; | ||
|
||
namespace Content.Client.Administration.UI.CustomControls; | ||
|
||
[GenerateTypedNameReferences] | ||
public sealed partial class PlayerListEntry : BoxContainer | ||
{ | ||
public PlayerListEntry() | ||
{ | ||
RobustXamlLoader.Load(this); | ||
} | ||
|
||
public event Action<PlayerInfo>? OnPinStatusChanged; | ||
|
||
public void Setup(PlayerInfo info, Func<PlayerInfo, string, string>? overrideText) | ||
{ | ||
Update(info, overrideText); | ||
PlayerEntryPinButton.OnPressed += HandlePinButtonPressed(info); | ||
} | ||
|
||
private Action<BaseButton.ButtonEventArgs> HandlePinButtonPressed(PlayerInfo info) | ||
{ | ||
return args => | ||
{ | ||
info.IsPinned = !info.IsPinned; | ||
UpdatePinButtonTexture(info.IsPinned); | ||
OnPinStatusChanged?.Invoke(info); | ||
}; | ||
} | ||
|
||
private void Update(PlayerInfo info, Func<PlayerInfo, string, string>? overrideText) | ||
{ | ||
PlayerEntryLabel.Text = overrideText?.Invoke(info, $"{info.CharacterName} ({info.Username})") ?? | ||
$"{info.CharacterName} ({info.Username})"; | ||
|
||
UpdatePinButtonTexture(info.IsPinned); | ||
} | ||
|
||
private void UpdatePinButtonTexture(bool isPinned) | ||
{ | ||
if (isPinned) | ||
{ | ||
PlayerEntryPinButton?.RemoveStyleClass(StyleNano.StyleClassPinButtonUnpinned); | ||
PlayerEntryPinButton?.AddStyleClass(StyleNano.StyleClassPinButtonPinned); | ||
} | ||
else | ||
{ | ||
PlayerEntryPinButton?.RemoveStyleClass(StyleNano.StyleClassPinButtonPinned); | ||
PlayerEntryPinButton?.AddStyleClass(StyleNano.StyleClassPinButtonUnpinned); | ||
} | ||
} | ||
} |
26 changes: 12 additions & 14 deletions
26
Content.Client/Administration/UI/Tabs/PlayerTab/PlayerTab.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,19 @@ | ||
<Control xmlns="https://spacestation14.io" | ||
xmlns:pt="clr-namespace:Content.Client.Administration.UI.Tabs.PlayerTab" | ||
xmlns:cc="clr-namespace:Content.Client.Administration.UI.CustomControls"> | ||
xmlns:cc="clr-namespace:Content.Client.Administration.UI.CustomControls" | ||
xmlns:co="clr-namespace:Content.Client.UserInterface.Controls"> | ||
<BoxContainer Orientation="Vertical"> | ||
<BoxContainer Orientation="Horizontal"> | ||
<Label Name="PlayerCount" HorizontalExpand="True" SizeFlagsStretchRatio="0.50" | ||
Text="{Loc Player Count}" /> | ||
<Button Name="ShowDisconnectedButton" HorizontalExpand="True" SizeFlagsStretchRatio="0.25" | ||
Text="{Loc player-tab-show-disconnected}" ToggleMode="True"/> | ||
<Button Name="OverlayButton" HorizontalExpand="True" SizeFlagsStretchRatio="0.25" | ||
Text="{Loc player-tab-overlay}" ToggleMode="True"/> | ||
<Label Name="PlayerCount" HorizontalExpand="True" Text="{Loc Player Count}" /> | ||
<LineEdit Name="SearchLineEdit" HorizontalExpand="True" | ||
PlaceHolder="{Loc player-tab-filter-line-edit-placeholder}" /> | ||
<Button Name="ShowDisconnectedButton" HorizontalExpand="True" | ||
Text="{Loc player-tab-show-disconnected}" ToggleMode="True" /> | ||
<Button Name="OverlayButton" HorizontalExpand="True" Text="{Loc player-tab-overlay}" ToggleMode="True" /> | ||
</BoxContainer> | ||
<Control MinSize="0 5" /> | ||
<ScrollContainer HorizontalExpand="True" VerticalExpand="True"> | ||
<BoxContainer Orientation="Vertical" Name="PlayerList"> | ||
<pt:PlayerTabHeader Name="ListHeader" /> | ||
<cc:HSeparator /> | ||
</BoxContainer> | ||
</ScrollContainer> | ||
<Control MinSize="0 5"/> | ||
<pt:PlayerTabHeader Name="ListHeader"/> | ||
<cc:HSeparator/> | ||
<co:SearchListContainer Name="SearchList" Access="Public" VerticalExpand="True"/> | ||
</BoxContainer> | ||
</Control> |
Oops, something went wrong.