mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 20:07:29 +08:00
Merge pull request #3744 from smoogipoo/fix-deletion-crash
Implement mania note deletion
This commit is contained in:
commit
e94c5dfabe
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user