mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 14:46:38 +09:00
Prevent overrides from messing with application/freeing
This commit is contained in:
@ -52,19 +52,9 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
});
|
||||
}
|
||||
|
||||
public override void Free()
|
||||
protected override void OnApply(HitObject hitObject)
|
||||
{
|
||||
IndexInCurrentComboBindable.UnbindFrom(HitObject.IndexInCurrentComboBindable);
|
||||
PositionBindable.UnbindFrom(HitObject.PositionBindable);
|
||||
StackHeightBindable.UnbindFrom(HitObject.StackHeightBindable);
|
||||
ScaleBindable.UnbindFrom(HitObject.ScaleBindable);
|
||||
|
||||
base.Free();
|
||||
}
|
||||
|
||||
public override void Apply(HitObject hitObject)
|
||||
{
|
||||
base.Apply(hitObject);
|
||||
base.OnApply(hitObject);
|
||||
|
||||
IndexInCurrentComboBindable.BindTo(HitObject.IndexInCurrentComboBindable);
|
||||
PositionBindable.BindTo(HitObject.PositionBindable);
|
||||
@ -72,6 +62,16 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
ScaleBindable.BindTo(HitObject.ScaleBindable);
|
||||
}
|
||||
|
||||
protected override void OnFree(HitObject hitObject)
|
||||
{
|
||||
base.OnFree(hitObject);
|
||||
|
||||
IndexInCurrentComboBindable.UnbindFrom(HitObject.IndexInCurrentComboBindable);
|
||||
PositionBindable.UnbindFrom(HitObject.PositionBindable);
|
||||
StackHeightBindable.UnbindFrom(HitObject.StackHeightBindable);
|
||||
ScaleBindable.UnbindFrom(HitObject.ScaleBindable);
|
||||
}
|
||||
|
||||
// Forward all internal management to shakeContainer.
|
||||
// This is a bit ugly but we don't have the concept of InternalContent so it'll have to do for now. (https://github.com/ppy/osu-framework/issues/1690)
|
||||
protected override void AddInternal(Drawable drawable) => shakeContainer.Add(drawable);
|
||||
|
@ -78,22 +78,22 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
Tracking.BindValueChanged(updateSlidingSample);
|
||||
}
|
||||
|
||||
public override void Free()
|
||||
protected override void OnApply(HitObject hitObject)
|
||||
{
|
||||
PathVersion.UnbindFrom(HitObject.Path.Version);
|
||||
|
||||
base.Free();
|
||||
}
|
||||
|
||||
public override void Apply(HitObject hitObject)
|
||||
{
|
||||
base.Apply(hitObject);
|
||||
base.OnApply(hitObject);
|
||||
|
||||
// Ensure that the version will change after the upcoming BindTo().
|
||||
pathVersion.Value = int.MaxValue;
|
||||
PathVersion.BindTo(HitObject.Path.Version);
|
||||
}
|
||||
|
||||
protected override void OnFree(HitObject hitObject)
|
||||
{
|
||||
base.OnFree(hitObject);
|
||||
|
||||
PathVersion.UnbindFrom(HitObject.Path.Version);
|
||||
}
|
||||
|
||||
private PausableSkinnableSound slidingSample;
|
||||
|
||||
protected override void LoadSamples()
|
||||
|
Reference in New Issue
Block a user