mirror of
https://github.com/ppy/osu
synced 2025-01-17 11:30:52 +00:00
Add fallback case when EditorChangeHandler is not present (for tests)
This commit is contained in:
parent
501e02db09
commit
b7c276093d
@ -40,7 +40,7 @@ namespace osu.Game.Rulesets.Edit
|
||||
Playfield.DisplayJudgements.Value = false;
|
||||
}
|
||||
|
||||
[Resolved]
|
||||
[Resolved(canBeNull: true)]
|
||||
private IEditorChangeHandler changeHandler { get; set; }
|
||||
|
||||
protected override void LoadComplete()
|
||||
@ -50,8 +50,15 @@ namespace osu.Game.Rulesets.Edit
|
||||
beatmap.HitObjectAdded += addHitObject;
|
||||
beatmap.HitObjectRemoved += removeHitObject;
|
||||
|
||||
// for now only regenerate replay on a finalised state change, not HitObjectUpdated.
|
||||
changeHandler.OnStateChange += updateReplay;
|
||||
if (changeHandler != null)
|
||||
{
|
||||
// for now only regenerate replay on a finalised state change, not HitObjectUpdated.
|
||||
changeHandler.OnStateChange += updateReplay;
|
||||
}
|
||||
else
|
||||
{
|
||||
beatmap.HitObjectUpdated += _ => updateReplay();
|
||||
}
|
||||
}
|
||||
|
||||
private void updateReplay() => drawableRuleset.RegenerateAutoplay();
|
||||
|
Loading…
Reference in New Issue
Block a user