Fix playtime formatting (#32974)

This commit is contained in:
Stalen
2024-10-28 21:00:00 +03:00
committed by GitHub
parent ee445c4938
commit 24f79c3ecc
9 changed files with 34 additions and 9 deletions

View File

@@ -1,4 +1,5 @@
using System.Diagnostics.CodeAnalysis;
using Content.Shared.Localizations;
using Content.Shared.Players.PlayTimeTracking;
using Content.Shared.Preferences;
using Content.Shared.Roles.Jobs;
@@ -36,7 +37,7 @@ public sealed partial class RoleTimeRequirement : JobRequirement
playTimes.TryGetValue(proto, out var roleTime);
var roleDiffSpan = Time - roleTime;
var roleDiff = roleDiffSpan.TotalMinutes;
var formattedRoleDiff = roleDiffSpan.ToString(Loc.GetString("role-timer-time-format"));
var formattedRoleDiff = ContentLocalizationManager.FormatPlaytime(roleDiffSpan);
var departmentColor = Color.Yellow;
if (entManager.EntitySysManager.TryGetEntitySystem(out SharedJobSystem? jobSystem))