mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Convert everything to DI pattern
This commit is contained in:
@ -20,6 +20,7 @@ using OpenTK.Input;
|
||||
using osu.Framework.Logging;
|
||||
using osu.Game.Graphics.UserInterface.Volume;
|
||||
using osu.Game.Database;
|
||||
using osu.Framework.Allocation;
|
||||
|
||||
namespace osu.Game
|
||||
{
|
||||
@ -51,7 +52,8 @@ namespace osu.Game
|
||||
host.Size = new Vector2(Config.Get<int>(OsuConfig.Width), Config.Get<int>(OsuConfig.Height));
|
||||
}
|
||||
|
||||
protected override void Load(BaseGame game)
|
||||
[Initializer]
|
||||
private void Load()
|
||||
{
|
||||
if (!Host.IsPrimaryInstance)
|
||||
{
|
||||
@ -59,8 +61,6 @@ namespace osu.Game
|
||||
Environment.Exit(0);
|
||||
}
|
||||
|
||||
base.Load(game);
|
||||
|
||||
if (args?.Length > 0)
|
||||
Schedule(delegate { Dependencies.Get<BeatmapDatabase>().Import(args); });
|
||||
|
||||
@ -98,7 +98,7 @@ namespace osu.Game
|
||||
(intro = new Intro
|
||||
{
|
||||
Beatmap = Beatmap
|
||||
}).Preload(game, d =>
|
||||
}).Preload(this, d =>
|
||||
{
|
||||
mainContent.Add(d);
|
||||
|
||||
@ -107,8 +107,8 @@ namespace osu.Game
|
||||
intro.DisplayAsRoot();
|
||||
});
|
||||
|
||||
(Chat = new ChatConsole(API)).Preload(game, Add);
|
||||
(MusicController = new MusicController()).Preload(game, Add);
|
||||
(Chat = new ChatConsole(API)).Preload(this, Add);
|
||||
(MusicController = new MusicController()).Preload(this, Add);
|
||||
|
||||
(Toolbar = new Toolbar
|
||||
{
|
||||
@ -116,7 +116,7 @@ namespace osu.Game
|
||||
OnSettings = Options.ToggleVisibility,
|
||||
OnPlayModeChange = delegate (PlayMode m) { PlayMode.Value = m; },
|
||||
OnMusicController = MusicController.ToggleVisibility
|
||||
}).Preload(game, t =>
|
||||
}).Preload(this, t =>
|
||||
{
|
||||
PlayMode.ValueChanged += delegate { Toolbar.SetGameMode(PlayMode.Value); };
|
||||
PlayMode.TriggerChange();
|
||||
|
Reference in New Issue
Block a user