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

Ensure regenerateDisplay is eventually performed if originally called before load

This commit is contained in:
Dean Herbert 2023-10-05 22:55:23 +09:00
parent 76cc2f9f22
commit 61fd4186af
No known key found for this signature in database

View File

@ -94,7 +94,7 @@ namespace osu.Game.Screens.Edit.Timing
controlPointGroups.BindTo(editorBeatmap.ControlPointInfo.Groups); controlPointGroups.BindTo(editorBeatmap.ControlPointInfo.Groups);
controlPointGroups.BindCollectionChanged((_, _) => updateTimingGroup()); controlPointGroups.BindCollectionChanged((_, _) => updateTimingGroup());
beatLength.BindValueChanged(_ => regenerateDisplay(true), true); beatLength.BindValueChanged(_ => Scheduler.AddOnce(regenerateDisplay, true), true);
displayLocked.BindValueChanged(locked => displayLocked.BindValueChanged(locked =>
{ {
@ -186,14 +186,17 @@ namespace osu.Game.Screens.Edit.Timing
return; return;
displayedTime = time; displayedTime = time;
regenerateDisplay(animated); Scheduler.AddOnce(regenerateDisplay, animated);
} }
private void regenerateDisplay(bool animated) private void regenerateDisplay(bool animated)
{ {
// Before a track is loaded, it won't have a valid length, which will break things. // Before a track is loaded, it won't have a valid length, which will break things.
if (!beatmap.Value.Track.IsLoaded) if (!beatmap.Value.Track.IsLoaded)
{
Scheduler.AddOnce(regenerateDisplay, animated);
return; return;
}
double index = (displayedTime - selectedGroupStartTime) / timingPoint.BeatLength; double index = (displayedTime - selectedGroupStartTime) / timingPoint.BeatLength;