diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 898a2baccf..1a2555f3f1 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -577,15 +577,15 @@ protected override void LoadComplete() dependencies.CacheAs(idleTracker = new GameIdleTracker(6000)); - GameIdleTracker sessionIdleTracker = new GameIdleTracker(300_000); - Add(sessionIdleTracker); - - sessionIdleTracker.IsIdle.BindValueChanged(e => + var sessionIdleTracker = new GameIdleTracker(300000); + sessionIdleTracker.IsIdle.BindValueChanged(idle => { - if (e.NewValue) - Dependencies.Get().ResetValues(); + if (idle.NewValue) + SessionStatics.ResetValues(); }); + Add(new GameIdleTracker(300000)); + AddRange(new Drawable[] { new VolumeControlReceptor diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index 406819cbd2..fbe4022cc1 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -61,6 +61,8 @@ public class OsuGameBase : Framework.Game, ICanAcceptFiles protected OsuConfigManager LocalConfig; + protected SessionStatics SessionStatics { get; private set; } + protected BeatmapManager BeatmapManager; protected ScoreManager ScoreManager; @@ -289,7 +291,7 @@ List getBeatmapScores(BeatmapSetInfo set) if (powerStatus != null) dependencies.CacheAs(powerStatus); - dependencies.Cache(new SessionStatics()); + dependencies.Cache(SessionStatics = new SessionStatics()); dependencies.Cache(new OsuColour()); RegisterImportHandler(BeatmapManager);