1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 15:12:57 +08:00

Resolve dependencies via Resolved Attribute

This commit is contained in:
Lucas A 2019-06-02 12:40:18 +02:00
parent 58564579e4
commit 0a867e37af

View File

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