]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
fix playtime stats window (#32856)
authorslarticodefast <161409025+slarticodefast@users.noreply.github.com>
Thu, 17 Oct 2024 21:32:59 +0000 (23:32 +0200)
committerGitHub <noreply@github.com>
Thu, 17 Oct 2024 21:32:59 +0000 (23:32 +0200)
Content.Client/Info/PlaytimeStats/PlaytimeStatsEntry.cs

index aff01800f943ad9e3f62c41a475bbe2d89555570..16e8f55a7e274e8788763fe39b26c623d819900c 100644 (file)
@@ -16,19 +16,10 @@ public sealed partial class PlaytimeStatsEntry : ContainerButton
 
         RoleLabel.Text = role;
         Playtime = playtime;  // store the TimeSpan value directly
-        PlaytimeLabel.Text = ConvertTimeSpanToHoursMinutes(playtime);  // convert to string for display
+        PlaytimeLabel.Text = playtime.ToString(Loc.GetString("ui-playtime-time-format"));  // convert to string for display
         BackgroundColorPanel.PanelOverride = styleBox;
     }
 
-    private static string ConvertTimeSpanToHoursMinutes(TimeSpan timeSpan)
-    {
-        var hours = (int)timeSpan.TotalHours;
-        var minutes = timeSpan.Minutes;
-
-        var formattedTimeLoc = Loc.GetString("ui-playtime-time-format", ("hours", hours), ("minutes", minutes));
-        return formattedTimeLoc;
-    }
-
     public void UpdateShading(StyleBoxFlat styleBox)
     {
         BackgroundColorPanel.PanelOverride = styleBox;