Resolve dependencies via Resolved Attribute

This commit is contained in:
Lucas A 2019-06-02 12:40:18 +02:00
parent 58564579e4
commit 0a867e37af
1 changed files with 7 additions and 6 deletions

View File

@ -18,11 +18,14 @@ namespace osu.Game.Overlays.Settings
{
public class SettingsFooter : FillFlowContainer
{
private OsuGameBase game;
private ChangelogOverlay changelog;
[Resolved]
private OsuGameBase game { get; set; }
[Resolved(CanBeNull = true)]
private ChangelogOverlay changelog { get; set; }
[BackgroundDependencyLoader(true)]
private void load(OsuGameBase game, OsuColour colours, RulesetStore rulesets, ChangelogOverlay changelog)
private void load(OsuGameBase game, OsuColour colours, RulesetStore rulesets)
{
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
@ -71,9 +74,6 @@ private void load(OsuGameBase game, OsuColour colours, RulesetStore rulesets, Ch
Colour = DebugUtils.IsDebug ? colours.Red : Color4.White,
},
};
this.game = game;
this.changelog = changelog;
}
protected override bool OnClick(ClickEvent e)
@ -82,6 +82,7 @@ protected override bool OnClick(ClickEvent e)
{
changelog?.ShowBuild("lazer", game.Version);
}
return true;
}
}