mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 11:35:35 +08:00
Avoid using CreateChildDependencies with a *child* bindable
Don't do this.
This commit is contained in:
parent
3e3ff81229
commit
ce19b2ed36
@ -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)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user