mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 07:22:54 +08:00
Forcefully regenerate autoplay on editor changes
This commit is contained in:
parent
ff7c904996
commit
524c2b678c
@ -45,15 +45,21 @@ namespace osu.Game.Rulesets.Edit
|
||||
base.LoadComplete();
|
||||
|
||||
beatmap.HitObjectAdded += addHitObject;
|
||||
beatmap.HitObjectUpdated += updateReplay;
|
||||
beatmap.HitObjectRemoved += removeHitObject;
|
||||
}
|
||||
|
||||
private void updateReplay(HitObject obj = null) =>
|
||||
drawableRuleset.RegenerateAutoplay();
|
||||
|
||||
private void addHitObject(HitObject hitObject)
|
||||
{
|
||||
var drawableObject = drawableRuleset.CreateDrawableRepresentation((TObject)hitObject);
|
||||
|
||||
drawableRuleset.Playfield.Add(drawableObject);
|
||||
drawableRuleset.Playfield.PostProcess();
|
||||
|
||||
updateReplay();
|
||||
}
|
||||
|
||||
private void removeHitObject(HitObject hitObject)
|
||||
@ -62,6 +68,8 @@ namespace osu.Game.Rulesets.Edit
|
||||
|
||||
drawableRuleset.Playfield.Remove(drawableObject);
|
||||
drawableRuleset.Playfield.PostProcess();
|
||||
|
||||
drawableRuleset.RegenerateAutoplay();
|
||||
}
|
||||
|
||||
public override bool PropagatePositionalInputSubTree => false;
|
||||
|
@ -151,8 +151,11 @@ namespace osu.Game.Rulesets.UI
|
||||
|
||||
public virtual PlayfieldAdjustmentContainer CreatePlayfieldAdjustmentContainer() => new PlayfieldAdjustmentContainer();
|
||||
|
||||
[Resolved]
|
||||
private OsuConfigManager config { get; set; }
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuConfigManager config, CancellationToken? cancellationToken)
|
||||
private void load(CancellationToken? cancellationToken)
|
||||
{
|
||||
InternalChildren = new Drawable[]
|
||||
{
|
||||
@ -178,11 +181,18 @@ namespace osu.Game.Rulesets.UI
|
||||
.WithChild(ResumeOverlay)));
|
||||
}
|
||||
|
||||
applyRulesetMods(Mods, config);
|
||||
RegenerateAutoplay();
|
||||
|
||||
loadObjects(cancellationToken);
|
||||
}
|
||||
|
||||
public void RegenerateAutoplay()
|
||||
{
|
||||
// for now this is applying mods which aren't just autoplay.
|
||||
// we'll need to reconsider this flow in the future.
|
||||
applyRulesetMods(Mods, config);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates and adds drawable representations of hit objects to the play field.
|
||||
/// </summary>
|
||||
|
Loading…
Reference in New Issue
Block a user