1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 06:07:25 +08:00

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.
This commit is contained in:
Bartłomiej Dach 2024-07-08 16:28:52 +02:00
parent 449d50a46a
commit 275b959c02
No known key found for this signature in database

View File

@ -1023,11 +1023,15 @@ namespace osu.Game.Screens.Edit
/// <summary>
/// Forces a reload of the compose screen after significant configuration changes.
/// </summary>
/// <remarks>
/// 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 <see cref="onModeChanged"/> will re-instantiate the screen whenever it is requested next.
/// </remarks>
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;