mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 06:36:31 +09:00
Add async workflow.
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using System.Threading;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.GameModes;
|
||||
using osu.Game.Configuration;
|
||||
@ -46,7 +47,7 @@ namespace osu.Game
|
||||
host.Size = new Vector2(Config.Get<int>(OsuConfig.Width), Config.Get<int>(OsuConfig.Height));
|
||||
}
|
||||
|
||||
public override void Load(BaseGame game)
|
||||
protected override void Load(BaseGame game)
|
||||
{
|
||||
if (!Host.IsPrimaryInstance)
|
||||
{
|
||||
@ -64,23 +65,18 @@ namespace osu.Game
|
||||
Audio.VolumeSample.Weld(Config.GetBindable<double>(OsuConfig.VolumeEffect));
|
||||
Audio.VolumeTrack.Weld(Config.GetBindable<double>(OsuConfig.VolumeMusic));
|
||||
|
||||
PlayMode = Config.GetBindable<PlayMode>(OsuConfig.PlayMode);
|
||||
|
||||
Add(new Drawable[] {
|
||||
new VolumeControlReceptor
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
ActivateRequested = delegate { volume.Show(); }
|
||||
},
|
||||
intro = new Intro
|
||||
mainContent = new Container
|
||||
{
|
||||
Beatmap = Beatmap
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
},
|
||||
Toolbar = new Toolbar
|
||||
{
|
||||
OnHome = delegate { MainMenu?.MakeCurrent(); },
|
||||
OnSettings = Options.ToggleVisibility,
|
||||
OnPlayModeChange = delegate (PlayMode m) { PlayMode.Value = m; },
|
||||
},
|
||||
Chat = new ChatConsole(API),
|
||||
volume = new VolumeControl
|
||||
{
|
||||
VolumeGlobal = Audio.Volume,
|
||||
@ -93,12 +89,31 @@ namespace osu.Game
|
||||
}
|
||||
});
|
||||
|
||||
intro.ModePushed += modeAdded;
|
||||
intro.Exited += modeRemoved;
|
||||
(intro = new Intro
|
||||
{
|
||||
Beatmap = Beatmap
|
||||
}).Preload(game, d =>
|
||||
{
|
||||
mainContent.Add(d);
|
||||
|
||||
PlayMode = Config.GetBindable<PlayMode>(OsuConfig.PlayMode);
|
||||
PlayMode.ValueChanged += delegate { Toolbar.SetGameMode(PlayMode.Value); };
|
||||
PlayMode.TriggerChange();
|
||||
intro.ModePushed += modeAdded;
|
||||
intro.Exited += modeRemoved;
|
||||
intro.DisplayAsRoot();
|
||||
});
|
||||
|
||||
(Chat = new ChatConsole(API)).Preload(game, Add);
|
||||
|
||||
(Toolbar = new Toolbar
|
||||
{
|
||||
OnHome = delegate { MainMenu?.MakeCurrent(); },
|
||||
OnSettings = Options.ToggleVisibility,
|
||||
OnPlayModeChange = delegate (PlayMode m) { PlayMode.Value = m; },
|
||||
}).Preload(game, t =>
|
||||
{
|
||||
PlayMode.ValueChanged += delegate { Toolbar.SetGameMode(PlayMode.Value); };
|
||||
PlayMode.TriggerChange();
|
||||
Add(Toolbar);
|
||||
});
|
||||
|
||||
Cursor.Alpha = 0;
|
||||
}
|
||||
@ -117,6 +132,8 @@ namespace osu.Game
|
||||
|
||||
public Action<GameMode> ModeChanged;
|
||||
|
||||
private Container mainContent;
|
||||
|
||||
private void modeChanged(GameMode newMode)
|
||||
{
|
||||
// - Ability to change window size
|
||||
|
Reference in New Issue
Block a user