Skip to content

Commit

Permalink
Resolve #112 Show PB times
Browse files Browse the repository at this point in the history
  • Loading branch information
GrimMaple committed Sep 17, 2024
1 parent a4481b0 commit f976414
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions SpeedTool/Platform/Run.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ public Run(Game game, Split[] splits, RunInfo? comparisonRun)
FlattenSplits();

if(comparisonRun != null && comparisonRun.Splits.Length == flattened.Length)
{
for(int i = 0; i < comparisonRun.Splits.Length; i++)
flattened[i].PBTimes = comparisonRun.Splits[i].Times;
comparison = comparisonRun;
}
}

public bool Started { get; private set; }
Expand Down
2 changes: 2 additions & 0 deletions SpeedTool/Splits/SplitDisplayInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ public static SplitDisplayInfo[] DeserializeJsonArray(JsonArray array)

public TimeCollection Times = new();

public TimeCollection PBTimes = new();

public JsonObject ToJson()
{
JsonObject o = new();
Expand Down
4 changes: 4 additions & 0 deletions SpeedTool/Windows/TimerUI/Classic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ public override void DoUI(ISplitsSource splits, ITimerSource source)
{
return (ColorsConfig.TextColor, displayInfo.Times[DisplayTimingMethod].ToSpeedToolTimerString());
}
else if(displayInfo.PBTimes[DisplayTimingMethod].Ticks != 0)
{
return (ColorsConfig.TextColor, displayInfo.PBTimes[DisplayTimingMethod].ToSpeedToolTimerString());
}

return (ColorsConfig.TextColor, "");
}
Expand Down

0 comments on commit f976414

Please sign in to comment.