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