1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 05:22:54 +08:00

Move MusicController to OsuGameBase

This commit is contained in:
smoogipoo 2020-08-06 19:01:23 +09:00
parent f8279dab32
commit adf4f56dce
2 changed files with 6 additions and 5 deletions

View File

@ -538,7 +538,6 @@ namespace osu.Game
Container logoContainer;
BackButton.Receptor receptor;
dependencies.CacheAs(MusicController = new MusicController());
dependencies.CacheAs(idleTracker = new GameIdleTracker(6000));
AddRange(new Drawable[]
@ -581,8 +580,6 @@ namespace osu.Game
ScreenStack.ScreenPushed += screenPushed;
ScreenStack.ScreenExited += screenExited;
loadComponentSingleFile(MusicController, Add);
loadComponentSingleFile(osuLogo, logo =>
{
logoContainer.Add(logo);
@ -925,8 +922,6 @@ namespace osu.Game
private ScalingContainer screenContainer;
protected MusicController MusicController { get; private set; }
protected override bool OnExiting()
{
if (ScreenStack.CurrentScreen is Loader)

View File

@ -30,6 +30,7 @@ using osu.Game.Database;
using osu.Game.Input;
using osu.Game.Input.Bindings;
using osu.Game.IO;
using osu.Game.Overlays;
using osu.Game.Resources;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Mods;
@ -73,6 +74,8 @@ namespace osu.Game
protected MenuCursorContainer MenuCursorContainer;
protected MusicController MusicController;
private Container content;
protected override Container<Drawable> Content => content;
@ -265,6 +268,9 @@ namespace osu.Game
dependencies.Cache(previewTrackManager = new PreviewTrackManager());
Add(previewTrackManager);
AddInternal(MusicController = new MusicController());
dependencies.CacheAs(MusicController);
Ruleset.BindValueChanged(onRulesetChanged);
}