1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 22:07:25 +08:00

basic background dim

This commit is contained in:
n4b3l 2016-12-16 17:13:24 +01:00
parent d39da80b1b
commit ba81222af6

View File

@ -21,6 +21,8 @@ using OpenTK;
using osu.Framework.GameModes;
using osu.Game.Modes.UI;
using osu.Game.Screens.Ranking;
using osu.Game.Configuration;
using osu.Framework.Configuration;
namespace osu.Game.Screens.Play
{
@ -42,6 +44,7 @@ namespace osu.Game.Screens.Play
private ScoreProcessor scoreProcessor;
private HitRenderer hitRenderer;
private Bindable<int> dimLevel;
[BackgroundDependencyLoader]
private void load(AudioManager audio, BeatmapDatabase beatmaps, OsuGameBase game)
@ -110,6 +113,7 @@ namespace osu.Game.Screens.Play
},
scoreOverlay,
};
dimLevel = game.Config.GetBindable<int>(OsuConfig.DimLevel);
}
protected override void LoadComplete()
@ -145,10 +149,17 @@ namespace osu.Game.Screens.Play
base.OnEntering(last);
(Background as BackgroundModeBeatmap)?.BlurTo(Vector2.Zero, 1000);
(Background as BackgroundModeBeatmap)?.FadeTo((100f- dimLevel)/100,1000);
Content.Alpha = 0;
}
protected override bool OnExiting(GameMode next)
{
(Background as BackgroundModeBeatmap)?.FadeTo(1f, 0);
return base.OnExiting(next);
}
class PlayerInputManager : UserInputManager
{
public PlayerInputManager(BasicGameHost host)