Merge pull request #22483 from peppy/test-output-gameplay-time

Output gameplay clock progress in `PlayerTestScene`s
This commit is contained in:
Bartłomiej Dach 2023-02-01 22:55:10 +01:00 committed by GitHub
commit 292016d31e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 19 additions and 0 deletions

View File

@ -7,6 +7,7 @@
using System.Linq;
using JetBrains.Annotations;
using osu.Framework.Allocation;
using osu.Framework.Logging;
using osu.Framework.Testing;
using osu.Game.Configuration;
using osu.Game.Rulesets;
@ -25,6 +26,24 @@ public abstract partial class PlayerTestScene : RateAdjustedBeatmapTestScene
protected OsuConfigManager LocalConfig;
private double lastReportedTime;
protected override void Update()
{
base.Update();
if (Player?.GameplayClockContainer != null)
{
int roundedTime = (int)Player.GameplayClockContainer.CurrentTime / 1000;
if (roundedTime != lastReportedTime)
{
lastReportedTime = roundedTime;
Logger.Log($"⏱️ Gameplay clock reached {lastReportedTime * 1000:N0} ms");
}
}
}
[BackgroundDependencyLoader]
private void load()
{