From 786e6242e166d5a9651edb51e541ccdc79157506 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 20 Mar 2018 14:01:06 +0900 Subject: [PATCH] Make bdl beat divisor nullable --- osu.Game.Tests/Visual/TestCaseEditorSelectionLayer.cs | 2 -- osu.Game/Rulesets/Edit/HitObjectComposer.cs | 11 +++++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseEditorSelectionLayer.cs b/osu.Game.Tests/Visual/TestCaseEditorSelectionLayer.cs index 62289ea7cd..bbbfef477a 100644 --- a/osu.Game.Tests/Visual/TestCaseEditorSelectionLayer.cs +++ b/osu.Game.Tests/Visual/TestCaseEditorSelectionLayer.cs @@ -14,7 +14,6 @@ using osu.Game.Rulesets.Osu; using osu.Game.Rulesets.Osu.Edit; using osu.Game.Rulesets.Osu.Edit.Layers.Selection.Overlays; using osu.Game.Rulesets.Osu.Objects; -using osu.Game.Screens.Edit.Screens.Compose; using osu.Game.Screens.Edit.Screens.Compose.Layers; using osu.Game.Tests.Beatmaps; @@ -69,7 +68,6 @@ namespace osu.Game.Tests.Visual var clock = new DecoupleableInterpolatingFramedClock { IsCoupled = false }; dependencies.CacheAs(clock); dependencies.CacheAs(clock); - dependencies.Cache(new BindableBeatDivisor()); Child = new OsuHitObjectComposer(new OsuRuleset()); } diff --git a/osu.Game/Rulesets/Edit/HitObjectComposer.cs b/osu.Game/Rulesets/Edit/HitObjectComposer.cs index 7ab9ff9164..c076b53f51 100644 --- a/osu.Game/Rulesets/Edit/HitObjectComposer.cs +++ b/osu.Game/Rulesets/Edit/HitObjectComposer.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.Linq; +using JetBrains.Annotations; using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; @@ -32,7 +33,7 @@ namespace osu.Game.Rulesets.Edit private readonly List layerContainers = new List(); private readonly Bindable beatmap = new Bindable(); - private readonly Bindable beatDivisor = new Bindable(); + private readonly BindableBeatDivisor beatDivisor = new BindableBeatDivisor(); private IAdjustableClock adjustableClock; @@ -43,11 +44,13 @@ namespace osu.Game.Rulesets.Edit RelativeSizeAxes = Axes.Both; } - [BackgroundDependencyLoader] - private void load(OsuGameBase osuGame, IAdjustableClock adjustableClock, IFrameBasedClock framedClock, BindableBeatDivisor beatDivisor) + [BackgroundDependencyLoader(true)] + private void load([NotNull] OsuGameBase osuGame, [NotNull] IAdjustableClock adjustableClock, [NotNull] IFrameBasedClock framedClock, [CanBeNull] BindableBeatDivisor beatDivisor) { this.adjustableClock = adjustableClock; - this.beatDivisor.BindTo(beatDivisor); + + if (beatDivisor != null) + this.beatDivisor.BindTo(beatDivisor); beatmap.BindTo(osuGame.Beatmap);