Privatise game ruleset and access via DI

Also decouples the bindable at SongSelect, where it is debounced in line with the carousel being updated.
This commit is contained in:
Dean Herbert
2018-06-26 16:32:20 +09:00
parent a8579c49f9
commit b0a1b25983
9 changed files with 39 additions and 37 deletions

View File

@ -53,10 +53,10 @@ namespace osu.Game.Screens.Select
}
[BackgroundDependencyLoader(true)]
private void load([CanBeNull] OsuGame osuGame)
private void load([CanBeNull] Bindable<RulesetInfo> parentRuleset)
{
if (osuGame != null)
ruleset.BindTo(osuGame.Ruleset);
if (parentRuleset != null)
ruleset.BindTo(parentRuleset);
ruleset.ValueChanged += _ => updateDisplay();
}