Skip to content

Commit

Permalink
Fix incorrect play time display - hours would wrap to 0 for >24
Browse files Browse the repository at this point in the history
  • Loading branch information
FenPhoenix committed Jun 5, 2024
1 parent 0695c36 commit fd247d3
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion AngelLoader/Forms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4251,8 +4251,19 @@ static string FormatSize(ulong size) =>
break;

case Column.PlayTime:
e.Value = fm.PlayTime.ToString(@"%h\:mm\:ss");
{
// Manual hours display to avoid hours being reset back to 0 when days increments to 1
TimeSpan playTime = fm.PlayTime;
string sep = CultureInfo.CurrentCulture.DateTimeFormat.TimeSeparator;
string final = playTime.ToString(@"mm\" + sep + "ss");
double totalHours = playTime.TotalHours;
if (totalHours >= 1.0d)
{
final = ((int)Math.Floor(totalHours)).ToStrInv() + sep + final;
}
e.Value = final;
break;
}

case Column.DisabledMods:
e.Value = fm.DisableAllMods ? LText.FMsList.AllModsDisabledMessage : fm.DisabledMods;
Expand Down

0 comments on commit fd247d3

Please sign in to comment.