Fix idle tracker assuming time starts at 0

`IdleTracker` in its construction quietly assumed that the clock it
receives from its parent starts ticking from 0 at the point at which it
is passed down. This is not necessarily the case when headless
executions are involved, which means that the initial state of the
tracker could be computed as idle incorrectly.

Resolve by explicitly reading the clock time at the point of
`LoadComplete()`.
This commit is contained in:
Bartłomiej Dach 2021-04-17 13:50:00 +02:00
parent 3eb2fb7e89
commit 250c7403e8

View File

@ -42,6 +42,12 @@ namespace osu.Game.Input
RelativeSizeAxes = Axes.Both;
}
protected override void LoadComplete()
{
base.LoadComplete();
updateLastInteractionTime();
}
protected override void Update()
{
base.Update();