mirror of
https://github.com/osukey/osukey.git
synced 2025-05-30 01:47:30 +09:00
Add a sane default lifetime end for scrolling hitobjects
This commit is contained in:
parent
7fd63b39fe
commit
fb1cd9e5e7
@ -12,8 +12,13 @@ namespace osu.Game.Rulesets.UI.Scrolling
|
||||
{
|
||||
public class ScrollingHitObjectContainer : HitObjectContainer
|
||||
{
|
||||
private readonly IBindable<double> timeRange = new BindableDouble();
|
||||
/// <summary>
|
||||
/// A multiplier applied to the length of the scrolling area to determine a safe default lifetime end for hitobjects.
|
||||
/// This is only used to limit the lifetime end within reason, as proper lifetime management should be implemented on hitobjects themselves.
|
||||
/// </summary>
|
||||
private const float safe_lifetime_end_multiplier = 2;
|
||||
|
||||
private readonly IBindable<double> timeRange = new BindableDouble();
|
||||
private readonly IBindable<ScrollingDirection> direction = new Bindable<ScrollingDirection>();
|
||||
|
||||
[Resolved]
|
||||
@ -92,6 +97,8 @@ namespace osu.Game.Rulesets.UI.Scrolling
|
||||
|
||||
if (hitObject.HitObject is IHasEndTime endTime)
|
||||
{
|
||||
hitObject.LifetimeEnd = scrollingInfo.Algorithm.TimeAt(scrollLength * safe_lifetime_end_multiplier, endTime.EndTime, timeRange.Value, scrollLength);
|
||||
|
||||
switch (direction.Value)
|
||||
{
|
||||
case ScrollingDirection.Up:
|
||||
@ -105,6 +112,8 @@ namespace osu.Game.Rulesets.UI.Scrolling
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
hitObject.LifetimeEnd = scrollingInfo.Algorithm.TimeAt(scrollLength * safe_lifetime_end_multiplier, hitObject.HitObject.StartTime, timeRange.Value, scrollLength);
|
||||
|
||||
foreach (var obj in hitObject.NestedHitObjects)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user