-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
520 changed files
with
11,215 additions
and
1,302 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.