better implementation

This commit is contained in:
n4b3l 2016-12-19 16:09:29 +01:00
parent 09f9f86b06
commit aebe87fefc

View File

@ -50,6 +50,7 @@ namespace osu.Game.Screens.Play
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(AudioManager audio, BeatmapDatabase beatmaps, OsuGameBase game) private void load(AudioManager audio, BeatmapDatabase beatmaps, OsuGameBase game)
{ {
dimLevel = game.Config.GetBindable<int>(OsuConfig.DimLevel);
try try
{ {
if (Beatmap == null) if (Beatmap == null)
@ -114,7 +115,6 @@ namespace osu.Game.Screens.Play
}, },
scoreOverlay, scoreOverlay,
}; };
dimLevel = game.Config.GetBindable<int>(OsuConfig.DimLevel);
} }
protected override void LoadComplete() protected override void LoadComplete()
@ -158,8 +158,7 @@ namespace osu.Game.Screens.Play
protected override bool OnExiting(GameMode next) protected override bool OnExiting(GameMode next)
{ {
if(dimLevel != null) dimLevel.ValueChanged -= dimChanged;
dimLevel.ValueChanged -= dimChanged;
Background?.FadeTo(1f, 200); Background?.FadeTo(1f, 200);
return base.OnExiting(next); return base.OnExiting(next);
} }