mirror of
https://github.com/ppy/osu.git
synced 2025-02-15 04:52:57 +08:00
account for gameplay start time
This commit is contained in:
parent
a222278710
commit
45c11f2b7b
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
@ -20,9 +21,12 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
{
|
{
|
||||||
public bool UsesFixedAnchor { get; set; }
|
public bool UsesFixedAnchor { get; set; }
|
||||||
|
|
||||||
[Resolved]
|
[Resolved(canBeNull: true)]
|
||||||
private GameplayClock gameplayClock { get; set; }
|
private GameplayClock gameplayClock { get; set; }
|
||||||
|
|
||||||
|
[Resolved(canBeNull: true)]
|
||||||
|
private GameplayClockContainer gameplayClockContainer { get; set; }
|
||||||
|
|
||||||
[Resolved(canBeNull: true)]
|
[Resolved(canBeNull: true)]
|
||||||
private DrawableRuleset drawableRuleset { get; set; }
|
private DrawableRuleset drawableRuleset { get; set; }
|
||||||
|
|
||||||
@ -69,12 +73,13 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
if (objects == null)
|
if (objects == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
double gameplayTime = gameplayClock?.CurrentTime ?? Time.Current;
|
double gameplayTime = gameplayClockContainer?.GameplayClock.CurrentTime ?? gameplayClock?.CurrentTime ?? Time.Current;
|
||||||
double frameStableTime = referenceClock?.CurrentTime ?? gameplayTime;
|
double frameStableTime = referenceClock?.CurrentTime ?? gameplayTime;
|
||||||
|
|
||||||
if (frameStableTime < FirstHitTime)
|
if (frameStableTime < FirstHitTime)
|
||||||
{
|
{
|
||||||
UpdateProgress((frameStableTime - FirstEventTime) / (FirstHitTime - FirstEventTime), gameplayTime, true);
|
double earliest = Math.Min(FirstEventTime, gameplayClockContainer?.StartTime ?? 0);
|
||||||
|
UpdateProgress((frameStableTime - earliest) / (FirstHitTime - earliest), gameplayTime, true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user