From 275b959c02801f43563afa471f2ccd0bdd02b9f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 8 Jul 2024 16:28:52 +0200 Subject: [PATCH] Fix composer disappearing when undoing change to control points As mentioned in https://github.com/ppy/osu/issues/28752. Regressed in https://github.com/ppy/osu/pull/28444. --- osu.Game/Screens/Edit/Editor.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/osu.Game/Screens/Edit/Editor.cs b/osu.Game/Screens/Edit/Editor.cs index 2278af040f..a8a28ef0b8 100644 --- a/osu.Game/Screens/Edit/Editor.cs +++ b/osu.Game/Screens/Edit/Editor.cs @@ -1023,11 +1023,15 @@ namespace osu.Game.Screens.Edit /// /// Forces a reload of the compose screen after significant configuration changes. /// - /// - /// This can be necessary for scrolling rulesets, as they do not easily support control points changing under them. - /// The reason that this works is that will re-instantiate the screen whenever it is requested next. - /// - public void ReloadComposeScreen() => screenContainer.SingleOrDefault(s => s.Type == EditorScreenMode.Compose)?.RemoveAndDisposeImmediately(); + public void ReloadComposeScreen() + { + screenContainer.SingleOrDefault(s => s.Type == EditorScreenMode.Compose)?.RemoveAndDisposeImmediately(); + + // If not currently on compose screen, the reload will happen on next mode change. + // That said, control points *can* change on compose screen (e.g. via undo), so we have to handle that case too. + if (Mode.Value == EditorScreenMode.Compose) + Mode.TriggerChange(); + } [CanBeNull] private ScheduledDelegate playbackDisabledDebounce;