mirror of
https://github.com/osukey/osukey.git
synced 2025-05-30 01:47:30 +09:00
Async workflow on music controller.
This commit is contained in:
parent
859a59a8ab
commit
a19bb1270d
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Threading.Tasks;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
using osu.Framework;
|
using osu.Framework;
|
||||||
@ -177,13 +178,18 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
beatmapSource = osuGame?.Beatmap ?? new Bindable<WorkingBeatmap>();
|
beatmapSource = osuGame?.Beatmap ?? new Bindable<WorkingBeatmap>();
|
||||||
beatmapSource.ValueChanged += workingChanged;
|
beatmapSource.ValueChanged += workingChanged;
|
||||||
workingChanged();
|
|
||||||
playList = database.GetAllWithChildren<BeatmapSetInfo>();
|
playList = database.GetAllWithChildren<BeatmapSetInfo>();
|
||||||
|
|
||||||
backgroundSprite = getScaledSprite(game.Textures.Get(@"Backgrounds/bg4"));
|
backgroundSprite = getScaledSprite(game.Textures.Get(@"Backgrounds/bg4"));
|
||||||
AddInternal(backgroundSprite);
|
AddInternal(backgroundSprite);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void LoadComplete()
|
||||||
|
{
|
||||||
|
workingChanged();
|
||||||
|
base.LoadComplete();
|
||||||
|
}
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
@ -240,10 +246,13 @@ namespace osu.Game.Overlays
|
|||||||
private void play(BeatmapInfo info, bool? isNext)
|
private void play(BeatmapInfo info, bool? isNext)
|
||||||
{
|
{
|
||||||
current = database.GetWorkingBeatmap(info, current);
|
current = database.GetWorkingBeatmap(info, current);
|
||||||
trackManager.SetExclusive(current.Track);
|
Task.Factory.StartNew(() =>
|
||||||
current.Track.Start();
|
{
|
||||||
beatmapSource.Value = current;
|
trackManager.SetExclusive(current.Track);
|
||||||
updateCurrent(current, isNext);
|
current.Track.Start();
|
||||||
|
beatmapSource.Value = current;
|
||||||
|
updateCurrent(current, isNext);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateCurrent(WorkingBeatmap beatmap, bool? isNext)
|
private void updateCurrent(WorkingBeatmap beatmap, bool? isNext)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user