mirror of
https://github.com/ppy/osu.git
synced 2024-12-13 05:22:54 +08:00
Tidy up initialisation code and avoid using DI on inherited class
This commit is contained in:
parent
2b6caf9b65
commit
dbb8f7f4a9
@ -577,15 +577,15 @@ namespace osu.Game
|
||||
|
||||
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<SessionStatics>().ResetValues();
|
||||
if (idle.NewValue)
|
||||
SessionStatics.ResetValues();
|
||||
});
|
||||
|
||||
Add(new GameIdleTracker(300000));
|
||||
|
||||
AddRange(new Drawable[]
|
||||
{
|
||||
new VolumeControlReceptor
|
||||
|
@ -61,6 +61,8 @@ namespace osu.Game
|
||||
|
||||
protected OsuConfigManager LocalConfig;
|
||||
|
||||
protected SessionStatics SessionStatics { get; private set; }
|
||||
|
||||
protected BeatmapManager BeatmapManager;
|
||||
|
||||
protected ScoreManager ScoreManager;
|
||||
@ -289,7 +291,7 @@ namespace osu.Game
|
||||
if (powerStatus != null)
|
||||
dependencies.CacheAs(powerStatus);
|
||||
|
||||
dependencies.Cache(new SessionStatics());
|
||||
dependencies.Cache(SessionStatics = new SessionStatics());
|
||||
dependencies.Cache(new OsuColour());
|
||||
|
||||
RegisterImportHandler(BeatmapManager);
|
||||
|
Loading…
Reference in New Issue
Block a user