Merge pull request #18237 from peppy/editor-animation-toggle-refresh-immediately

Fix toggling hit animations on the editor not applying immediately
This commit is contained in:
Dan Balasescu
2022-05-12 18:51:04 +09:00
committed by GitHub
2 changed files with 6 additions and 1 deletions

View File

@ -50,6 +50,11 @@ namespace osu.Game.Rulesets.Osu.Edit
private void load(OsuConfigManager config)
{
hitAnimations = config.GetBindable<bool>(OsuSetting.EditorHitAnimations);
hitAnimations.BindValueChanged(_ =>
{
foreach (var d in HitObjectContainer.AliveObjects)
d.RefreshStateTransforms();
});
}
protected override void OnNewDrawableHitObject(DrawableHitObject d)

View File

@ -448,7 +448,7 @@ namespace osu.Game.Rulesets.Objects.Drawables
/// <summary>
/// Reapplies the current <see cref="ArmedState"/>.
/// </summary>
protected void RefreshStateTransforms() => updateState(State.Value, true);
public void RefreshStateTransforms() => updateState(State.Value, true);
/// <summary>
/// Apply (generally fade-in) transforms leading into the <see cref="HitObject"/> start time.