1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 08:32:57 +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; Container logoContainer;
BackButton.Receptor receptor; BackButton.Receptor receptor;
dependencies.CacheAs(MusicController = new MusicController());
dependencies.CacheAs(idleTracker = new GameIdleTracker(6000)); dependencies.CacheAs(idleTracker = new GameIdleTracker(6000));
AddRange(new Drawable[] AddRange(new Drawable[]
@ -581,8 +580,6 @@ namespace osu.Game
ScreenStack.ScreenPushed += screenPushed; ScreenStack.ScreenPushed += screenPushed;
ScreenStack.ScreenExited += screenExited; ScreenStack.ScreenExited += screenExited;
loadComponentSingleFile(MusicController, Add);
loadComponentSingleFile(osuLogo, logo => loadComponentSingleFile(osuLogo, logo =>
{ {
logoContainer.Add(logo); logoContainer.Add(logo);
@ -925,8 +922,6 @@ namespace osu.Game
private ScalingContainer screenContainer; private ScalingContainer screenContainer;
protected MusicController MusicController { get; private set; }
protected override bool OnExiting() protected override bool OnExiting()
{ {
if (ScreenStack.CurrentScreen is Loader) if (ScreenStack.CurrentScreen is Loader)

View File

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