1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 20:32:55 +08:00

Set loadable beatmap track to clock immediately in BDL

This reverts commit 84da247002.

Use loadable beatmap track for clock directly in BDL
This commit is contained in:
Salman Ahmed 2021-05-07 07:18:43 +03:00
parent 84da247002
commit 539643c72b

View File

@ -144,8 +144,7 @@ namespace osu.Game.Screens.Edit
// Todo: should probably be done at a DrawableRuleset level to share logic with Player.
clock = new EditorClock(playableBeatmap, beatDivisor) { IsCoupled = false };
updateClockSource(loadableBeatmap);
clock.ChangeSource(loadableBeatmap.Track);
dependencies.CacheAs(clock);
AddInternal(clock);
@ -308,11 +307,9 @@ namespace osu.Game.Screens.Edit
/// <summary>
/// If the beatmap's track has changed, this method must be called to keep the editor in a valid state.
/// </summary>
public void UpdateClockSource() => updateClockSource(Beatmap.Value);
private void updateClockSource(WorkingBeatmap beatmap)
public void UpdateClockSource()
{
var sourceClock = (IAdjustableClock)beatmap.Track ?? new StopwatchClock();
var sourceClock = (IAdjustableClock)Beatmap.Value.Track ?? new StopwatchClock();
clock.ChangeSource(sourceClock);
}