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

Implement mania note deletion

This commit is contained in:
smoogipoo 2018-11-20 17:26:00 +09:00
parent 51c192d4b7
commit dc8cd51e15
4 changed files with 20 additions and 2 deletions

View File

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

View File

@ -52,6 +52,8 @@ namespace osu.Game.Rulesets.Mania.UI
public override void Add(DrawableHitObject h) => getStageByColumn(((ManiaHitObject)h.HitObject).Column).Add(h);
public override void Remove(DrawableHitObject h) => getStageByColumn(((ManiaHitObject)h.HitObject).Column).Remove(h);
public void Add(BarLine barline) => stages.ForEach(s => s.Add(barline));
private ManiaStage getStageByColumn(int column)

View File

@ -157,6 +157,15 @@ namespace osu.Game.Rulesets.Mania.UI
h.OnNewResult += OnNewResult;
}
public override void Remove(DrawableHitObject h)
{
var maniaObject = (ManiaHitObject)h.HitObject;
int columnIndex = maniaObject.Column - firstColumnIndex;
Columns.ElementAt(columnIndex).Remove(h);
h.OnNewResult -= OnNewResult;
}
public void Add(BarLine barline) => base.Add(new DrawableBarLine(barline));
internal void OnNewResult(DrawableHitObject judgedObject, JudgementResult result)

View File

@ -91,8 +91,8 @@ namespace osu.Game.Rulesets.Edit
// Process the beatmap
var processor = ruleset.CreateBeatmapProcessor(beatmap);
processor.PreProcess();
processor.PostProcess();
processor?.PreProcess();
processor?.PostProcess();
// Remove visual representation
var drawableObject = Playfield.AllHitObjects.Single(d => d.HitObject == hitObject);