From 3a2482420feeca0da1f7955b733c5091ea3fd61b Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Sat, 14 Oct 2023 01:55:40 -0700 Subject: [PATCH] Show total playtime in player list and AHelp window (#20980) --- .../Administration/UI/Bwoink/BwoinkWindow.xaml.cs | 5 +++++ .../UI/Tabs/PlayerTab/PlayerTab.xaml.cs | 4 +++- .../UI/Tabs/PlayerTab/PlayerTabEntry.xaml | 4 ++++ .../UI/Tabs/PlayerTab/PlayerTabEntry.xaml.cs | 3 ++- .../UI/Tabs/PlayerTab/PlayerTabHeader.xaml | 6 ++++++ Content.Server/Administration/Systems/AdminSystem.cs | 12 +++++++++++- Content.Shared/Administration/PlayerInfo.cs | 9 ++++++++- Resources/Changelog/Admin.yml | 5 +++++ .../en-US/administration/ui/tabs/player-tab.ftl | 2 ++ Resources/Locale/en-US/generic.ftl | 2 ++ 10 files changed, 48 insertions(+), 4 deletions(-) diff --git a/Content.Client/Administration/UI/Bwoink/BwoinkWindow.xaml.cs b/Content.Client/Administration/UI/Bwoink/BwoinkWindow.xaml.cs index 984d8c5b1a..2562da3fa7 100644 --- a/Content.Client/Administration/UI/Bwoink/BwoinkWindow.xaml.cs +++ b/Content.Client/Administration/UI/Bwoink/BwoinkWindow.xaml.cs @@ -19,6 +19,11 @@ namespace Content.Client.Administration.UI.Bwoink if (sel is not null) { Title = $"{sel.CharacterName} / {sel.Username}"; + + if (sel.OverallPlaytime != null) + { + Title += $" | {Loc.GetString("generic-playtime-title")}: {sel.PlaytimeString()}"; + } } }; diff --git a/Content.Client/Administration/UI/Tabs/PlayerTab/PlayerTab.xaml.cs b/Content.Client/Administration/UI/Tabs/PlayerTab/PlayerTab.xaml.cs index 29f7005754..ad8e4392c2 100644 --- a/Content.Client/Administration/UI/Tabs/PlayerTab/PlayerTab.xaml.cs +++ b/Content.Client/Administration/UI/Tabs/PlayerTab/PlayerTab.xaml.cs @@ -120,9 +120,11 @@ namespace Content.Client.Administration.UI.Tabs.PlayerTab player.StartingJob, player.Antag ? "YES" : "NO", new StyleBoxFlat(useAltColor ? _altColor : _defaultColor), - player.Connected); + player.Connected, + player.PlaytimeString()); entry.PlayerEntity = player.NetEntity; entry.OnPressed += args => OnEntryPressed?.Invoke(args); + entry.ToolTip = Loc.GetString("player-tab-entry-tooltip"); PlayerList.AddChild(entry); useAltColor ^= true; diff --git a/Content.Client/Administration/UI/Tabs/PlayerTab/PlayerTabEntry.xaml b/Content.Client/Administration/UI/Tabs/PlayerTab/PlayerTabEntry.xaml index 93482c294c..883681a28a 100644 --- a/Content.Client/Administration/UI/Tabs/PlayerTab/PlayerTabEntry.xaml +++ b/Content.Client/Administration/UI/Tabs/PlayerTab/PlayerTabEntry.xaml @@ -24,5 +24,9 @@ SizeFlagsStretchRatio="2" HorizontalExpand="True" ClipText="True"/> +