1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 12:57:36 +08:00

Unbind event when column changes

This commit is contained in:
smoogipoo 2018-11-19 16:20:21 +09:00
parent ce956d7fd4
commit 595e2ffbff
2 changed files with 10 additions and 1 deletions

View File

@ -145,6 +145,15 @@ namespace osu.Game.Rulesets.Mania.UI
HitObjectContainer.Add(hitObject);
}
public override bool Remove(DrawableHitObject h)
{
if (!base.Remove(h))
return false;
h.OnNewResult -= OnNewResult;
return true;
}
internal void OnNewResult(DrawableHitObject judgedObject, JudgementResult result)
{
if (!result.IsHit || !judgedObject.DisplayResult || !DisplayJudgements)

View File

@ -80,7 +80,7 @@ namespace osu.Game.Rulesets.UI
/// Remove a DrawableHitObject from this Playfield.
/// </summary>
/// <param name="h">The DrawableHitObject to remove.</param>
public virtual void Remove(DrawableHitObject h) => HitObjectContainer.Remove(h);
public virtual bool Remove(DrawableHitObject h) => HitObjectContainer.Remove(h);
/// <summary>
/// Registers a <see cref="Playfield"/> as a nested <see cref="Playfield"/>.