1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 14:02:55 +08:00

Fix multiselection operation not flushing on close

This commit is contained in:
Bartłomiej Dach 2022-04-17 20:32:45 +02:00
parent 746a4a7403
commit fe59f4ae58
No known key found for this signature in database
GPG Key ID: BCECCD4FA41F6497
2 changed files with 15 additions and 4 deletions

View File

@ -364,6 +364,15 @@ namespace osu.Game.Overlays.Mods
pendingSelectionOperations.Enqueue(() => button.Active.Value = false);
}
/// <summary>
/// Play out all remaining animations immediately to leave mods in a good (final) state.
/// </summary>
public void FlushAnimation()
{
while (pendingSelectionOperations.TryDequeue(out var dequeuedAction))
dequeuedAction();
}
private class ToggleAllCheckbox : OsuCheckbox
{
private Color4 accentColour;

View File

@ -313,10 +313,12 @@ namespace osu.Game.Overlays.Mods
{
const float distance = 700;
columnFlow[i].Column
.TopLevelContent
.MoveToY(i % 2 == 0 ? -distance : distance, fade_out_duration, Easing.OutQuint)
.FadeOut(fade_out_duration, Easing.OutQuint);
var column = columnFlow[i].Column;
column.FlushAnimation();
column.TopLevelContent
.MoveToY(i % 2 == 0 ? -distance : distance, fade_out_duration, Easing.OutQuint)
.FadeOut(fade_out_duration, Easing.OutQuint);
}
}