mirror of
https://github.com/ppy/osu.git
synced 2025-02-14 00:53:19 +08:00
Reset lifetime on HitObject.DefaultsApplied
This commit is contained in:
parent
972bd11ea9
commit
43bf734816
@ -35,7 +35,9 @@ namespace osu.Game.Rulesets.Objects
|
|||||||
HitObject = hitObject;
|
HitObject = hitObject;
|
||||||
|
|
||||||
startTimeBindable.BindTo(HitObject.StartTimeBindable);
|
startTimeBindable.BindTo(HitObject.StartTimeBindable);
|
||||||
startTimeBindable.BindValueChanged(onStartTimeChanged, true);
|
startTimeBindable.BindValueChanged(_ => setInitialLifetime(), true);
|
||||||
|
|
||||||
|
HitObject.DefaultsApplied += _ => setInitialLifetime();
|
||||||
}
|
}
|
||||||
|
|
||||||
// The lifetime, as set by the hitobject.
|
// The lifetime, as set by the hitobject.
|
||||||
@ -89,8 +91,8 @@ namespace osu.Game.Rulesets.Objects
|
|||||||
protected virtual double InitialLifetimeOffset => 10000;
|
protected virtual double InitialLifetimeOffset => 10000;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Resets <see cref="LifetimeEntry.LifetimeStart"/> according to the change in start time of the <see cref="HitObject"/>.
|
/// Set <see cref="LifetimeEntry.LifetimeStart"/> using <see cref="InitialLifetimeOffset"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void onStartTimeChanged(ValueChangedEvent<double> startTime) => LifetimeStart = HitObject.StartTime - InitialLifetimeOffset;
|
private void setInitialLifetime() => LifetimeStart = HitObject.StartTime - InitialLifetimeOffset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user