mirror of https://github.com/ppy/osu
Remove lifetime override of `DrawableManiaHitObject`
The `AlwaysAlive` logic is now in all DHOs and it is now not necessary (and potentially conflicting).
This commit is contained in:
parent
9dcd0bf311
commit
a4f362dca6
|
@ -85,63 +85,6 @@ protected override void OnFree()
|
|||
AccentColour.UnbindFrom(ParentHitObject.AccentColour);
|
||||
}
|
||||
|
||||
private double computedLifetimeStart;
|
||||
|
||||
public override double LifetimeStart
|
||||
{
|
||||
get => base.LifetimeStart;
|
||||
set
|
||||
{
|
||||
computedLifetimeStart = value;
|
||||
|
||||
if (!AlwaysAlive)
|
||||
base.LifetimeStart = value;
|
||||
}
|
||||
}
|
||||
|
||||
private double computedLifetimeEnd;
|
||||
|
||||
public override double LifetimeEnd
|
||||
{
|
||||
get => base.LifetimeEnd;
|
||||
set
|
||||
{
|
||||
computedLifetimeEnd = value;
|
||||
|
||||
if (!AlwaysAlive)
|
||||
base.LifetimeEnd = value;
|
||||
}
|
||||
}
|
||||
|
||||
private bool alwaysAlive;
|
||||
|
||||
/// <summary>
|
||||
/// Whether this <see cref="DrawableManiaHitObject"/> should always remain alive.
|
||||
/// </summary>
|
||||
internal bool AlwaysAlive
|
||||
{
|
||||
get => alwaysAlive;
|
||||
set
|
||||
{
|
||||
if (alwaysAlive == value)
|
||||
return;
|
||||
|
||||
alwaysAlive = value;
|
||||
|
||||
if (value)
|
||||
{
|
||||
// Set the base lifetimes directly, to avoid mangling the computed lifetimes
|
||||
base.LifetimeStart = double.MinValue;
|
||||
base.LifetimeEnd = double.MaxValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
LifetimeStart = computedLifetimeStart;
|
||||
LifetimeEnd = computedLifetimeEnd;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void OnDirectionChanged(ValueChangedEvent<ScrollingDirection> e)
|
||||
{
|
||||
Anchor = Origin = e.NewValue == ScrollingDirection.Up ? Anchor.TopCentre : Anchor.BottomCentre;
|
||||
|
|
Loading…
Reference in New Issue