mirror of
https://github.com/ppy/osu.git
synced 2025-03-14 05:47:20 +08:00
Expose StartTime
from gameplay clock
This commit is contained in:
parent
e664690fe2
commit
3f72e76348
@ -35,6 +35,15 @@ namespace osu.Game.Screens.Play
|
||||
UnderlyingClock = underlyingClock;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The time from which the clock should start. Will be seeked to on calling <see cref="GameplayClockContainer.Reset"/>.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// If not set, a value of zero will be used.
|
||||
/// Importantly, the value will be inferred from the current ruleset in <see cref="MasterGameplayClockContainer"/> unless specified.
|
||||
/// </remarks>
|
||||
public double? StartTime { get; internal set; }
|
||||
|
||||
public double CurrentTime => UnderlyingClock.CurrentTime;
|
||||
|
||||
public double Rate => UnderlyingClock.Rate;
|
||||
|
@ -44,6 +44,8 @@ namespace osu.Game.Screens.Play
|
||||
/// </summary>
|
||||
public event Action OnSeek;
|
||||
|
||||
private double? startTime;
|
||||
|
||||
/// <summary>
|
||||
/// The time from which the clock should start. Will be seeked to on calling <see cref="Reset"/>.
|
||||
/// </summary>
|
||||
@ -51,7 +53,17 @@ namespace osu.Game.Screens.Play
|
||||
/// If not set, a value of zero will be used.
|
||||
/// Importantly, the value will be inferred from the current ruleset in <see cref="MasterGameplayClockContainer"/> unless specified.
|
||||
/// </remarks>
|
||||
public double? StartTime { get; set; }
|
||||
public double? StartTime
|
||||
{
|
||||
get => startTime;
|
||||
set
|
||||
{
|
||||
startTime = value;
|
||||
|
||||
if (GameplayClock != null)
|
||||
GameplayClock.StartTime = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="GameplayClockContainer"/>.
|
||||
@ -72,6 +84,8 @@ namespace osu.Game.Screens.Play
|
||||
var dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
|
||||
|
||||
dependencies.CacheAs(GameplayClock = CreateGameplayClock(AdjustableSource));
|
||||
|
||||
GameplayClock.StartTime = StartTime;
|
||||
GameplayClock.IsPaused.BindTo(IsPaused);
|
||||
|
||||
return dependencies;
|
||||
|
Loading…
x
Reference in New Issue
Block a user