mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 14:12:56 +08:00
Allow beatmaps to load endlessly when entering Player
This commit is contained in:
parent
ac7b26a58f
commit
bfde334e77
@ -4,6 +4,7 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Audio;
|
||||
@ -181,7 +182,7 @@ namespace osu.Game.Screens.Play
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load(AudioManager audio, OsuConfigManager config, OsuGameBase game)
|
||||
private void load(AudioManager audio, OsuConfigManager config, OsuGameBase game, CancellationToken cancellationToken)
|
||||
{
|
||||
var gameplayMods = Mods.Value.Select(m => m.DeepClone()).ToArray();
|
||||
|
||||
@ -194,7 +195,7 @@ namespace osu.Game.Screens.Play
|
||||
if (Beatmap.Value is DummyWorkingBeatmap)
|
||||
return;
|
||||
|
||||
IBeatmap playableBeatmap = loadPlayableBeatmap(gameplayMods);
|
||||
IBeatmap playableBeatmap = loadPlayableBeatmap(gameplayMods, cancellationToken);
|
||||
|
||||
if (playableBeatmap == null)
|
||||
return;
|
||||
@ -483,7 +484,7 @@ namespace osu.Game.Screens.Play
|
||||
}
|
||||
}
|
||||
|
||||
private IBeatmap loadPlayableBeatmap(Mod[] gameplayMods)
|
||||
private IBeatmap loadPlayableBeatmap(Mod[] gameplayMods, CancellationToken cancellationToken)
|
||||
{
|
||||
IBeatmap playable;
|
||||
|
||||
@ -500,7 +501,7 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
try
|
||||
{
|
||||
playable = Beatmap.Value.GetPlayableBeatmap(ruleset.RulesetInfo, gameplayMods);
|
||||
playable = Beatmap.Value.GetPlayableBeatmap(ruleset.RulesetInfo, gameplayMods, cancellationToken);
|
||||
}
|
||||
catch (BeatmapInvalidForRulesetException)
|
||||
{
|
||||
@ -508,7 +509,7 @@ namespace osu.Game.Screens.Play
|
||||
rulesetInfo = Beatmap.Value.BeatmapInfo.Ruleset;
|
||||
ruleset = rulesetInfo.CreateInstance();
|
||||
|
||||
playable = Beatmap.Value.GetPlayableBeatmap(rulesetInfo, gameplayMods);
|
||||
playable = Beatmap.Value.GetPlayableBeatmap(rulesetInfo, gameplayMods, cancellationToken);
|
||||
}
|
||||
|
||||
if (playable.HitObjects.Count == 0)
|
||||
|
Loading…
Reference in New Issue
Block a user