Read default beat divisor from beatmap

This commit is contained in:
smoogipoo 2019-11-08 17:12:47 +09:00
parent 6805c029e7
commit eb9fff96ba
1 changed files with 4 additions and 1 deletions

View File

@ -64,7 +64,10 @@ private void load(OsuColour colours, GameHost host)
{ {
this.host = host; this.host = host;
// TODO: should probably be done at a DrawableRuleset level to share logic with Player. beatDivisor.Value = Beatmap.Value.BeatmapInfo.BeatDivisor;
beatDivisor.BindValueChanged(divisor => Beatmap.Value.BeatmapInfo.BeatDivisor = divisor.NewValue);
// Todo: should probably be done at a DrawableRuleset level to share logic with Player.
var sourceClock = (IAdjustableClock)Beatmap.Value.Track ?? new StopwatchClock(); var sourceClock = (IAdjustableClock)Beatmap.Value.Track ?? new StopwatchClock();
clock = new EditorClock(Beatmap.Value, beatDivisor) { IsCoupled = false }; clock = new EditorClock(Beatmap.Value, beatDivisor) { IsCoupled = false };
clock.ChangeSource(sourceClock); clock.ChangeSource(sourceClock);