1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 10:52:53 +08:00

Avoid using CreateChildDependencies with a *child* bindable

Don't do this.
This commit is contained in:
Dean Herbert 2019-10-31 17:16:26 +09:00
parent 3e3ff81229
commit ce19b2ed36

View File

@ -50,6 +50,9 @@ namespace osu.Game.Overlays.BeatmapSet
private readonly LoadingAnimation loading; private readonly LoadingAnimation loading;
[Cached(typeof(IBindable<RulesetInfo>))]
private readonly Bindable<RulesetInfo> ruleset = new Bindable<RulesetInfo>();
public Header() public Header()
{ {
ExternalLinkButton externalLink; ExternalLinkButton externalLink;
@ -80,6 +83,7 @@ namespace osu.Game.Overlays.BeatmapSet
}, },
RulesetSelector = new BeatmapRulesetSelector RulesetSelector = new BeatmapRulesetSelector
{ {
Current = ruleset,
Anchor = Anchor.BottomCentre, Anchor = Anchor.BottomCentre,
Origin = Anchor.BottomCentre, Origin = Anchor.BottomCentre,
} }
@ -222,13 +226,6 @@ namespace osu.Game.Overlays.BeatmapSet
}; };
} }
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
{
var dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
dependencies.CacheAs<IBindable<RulesetInfo>>(RulesetSelector.Current);
return dependencies;
}
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours) private void load(OsuColour colours)
{ {