mirror of
https://github.com/ppy/osu.git
synced 2025-02-15 18:13:09 +08:00
Merge branch 'master' into difficulty-move-to-beatmap
This commit is contained in:
commit
d50443fdf2
@ -221,6 +221,8 @@ namespace osu.Game.Tests.Visual.Ranking
|
|||||||
list.SelectedScore.Value = middleScore;
|
list.SelectedScore.Value = middleScore;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
AddUntilStep("wait for all scores to be visible", () => list.ChildrenOfType<ScorePanelTrackingContainer>().All(t => t.IsPresent));
|
||||||
|
|
||||||
assertScoreState(highestScore, false);
|
assertScoreState(highestScore, false);
|
||||||
assertScoreState(middleScore, true);
|
assertScoreState(middleScore, true);
|
||||||
assertScoreState(lowestScore, false);
|
assertScoreState(lowestScore, false);
|
||||||
|
@ -255,6 +255,7 @@ namespace osu.Game.Online.Leaderboards
|
|||||||
}
|
}
|
||||||
|
|
||||||
private APIRequest getScoresRequest;
|
private APIRequest getScoresRequest;
|
||||||
|
private ScheduledDelegate getScoresRequestCallback;
|
||||||
|
|
||||||
protected abstract bool IsOnlineScope { get; }
|
protected abstract bool IsOnlineScope { get; }
|
||||||
|
|
||||||
@ -282,13 +283,16 @@ namespace osu.Game.Online.Leaderboards
|
|||||||
getScoresRequest?.Cancel();
|
getScoresRequest?.Cancel();
|
||||||
getScoresRequest = null;
|
getScoresRequest = null;
|
||||||
|
|
||||||
|
getScoresRequestCallback?.Cancel();
|
||||||
|
getScoresRequestCallback = null;
|
||||||
|
|
||||||
pendingUpdateScores?.Cancel();
|
pendingUpdateScores?.Cancel();
|
||||||
pendingUpdateScores = Schedule(() =>
|
pendingUpdateScores = Schedule(() =>
|
||||||
{
|
{
|
||||||
PlaceholderState = PlaceholderState.Retrieving;
|
PlaceholderState = PlaceholderState.Retrieving;
|
||||||
loading.Show();
|
loading.Show();
|
||||||
|
|
||||||
getScoresRequest = FetchScores(scores => Schedule(() =>
|
getScoresRequest = FetchScores(scores => getScoresRequestCallback = Schedule(() =>
|
||||||
{
|
{
|
||||||
Scores = scores.ToArray();
|
Scores = scores.ToArray();
|
||||||
PlaceholderState = Scores.Any() ? PlaceholderState.Successful : PlaceholderState.NoScores;
|
PlaceholderState = Scores.Any() ? PlaceholderState.Successful : PlaceholderState.NoScores;
|
||||||
@ -297,7 +301,7 @@ namespace osu.Game.Online.Leaderboards
|
|||||||
if (getScoresRequest == null)
|
if (getScoresRequest == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
getScoresRequest.Failure += e => Schedule(() =>
|
getScoresRequest.Failure += e => getScoresRequestCallback = Schedule(() =>
|
||||||
{
|
{
|
||||||
if (e is OperationCanceledException)
|
if (e is OperationCanceledException)
|
||||||
return;
|
return;
|
||||||
|
@ -110,10 +110,11 @@ namespace osu.Game.Rulesets.Difficulty
|
|||||||
private void preProcess(Mod[] mods)
|
private void preProcess(Mod[] mods)
|
||||||
{
|
{
|
||||||
playableMods = mods.Select(m => m.DeepClone()).ToArray();
|
playableMods = mods.Select(m => m.DeepClone()).ToArray();
|
||||||
Beatmap = beatmap.GetPlayableBeatmap(ruleset.RulesetInfo, mods);
|
|
||||||
|
Beatmap = beatmap.GetPlayableBeatmap(ruleset.RulesetInfo, playableMods);
|
||||||
|
|
||||||
var track = new TrackVirtual(10000);
|
var track = new TrackVirtual(10000);
|
||||||
mods.OfType<IApplicableToTrack>().ForEach(m => m.ApplyToTrack(track));
|
playableMods.OfType<IApplicableToTrack>().ForEach(m => m.ApplyToTrack(track));
|
||||||
clockRate = track.Rate;
|
clockRate = track.Rate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,6 +60,8 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
Current.Value = DisplayedCount = 0;
|
Current.Value = DisplayedCount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Mod[] clonedMods;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours, BeatmapDifficultyCache difficultyCache)
|
private void load(OsuColour colours, BeatmapDifficultyCache difficultyCache)
|
||||||
{
|
{
|
||||||
@ -67,8 +69,10 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
|
|
||||||
if (gameplayState != null)
|
if (gameplayState != null)
|
||||||
{
|
{
|
||||||
|
clonedMods = gameplayState.Mods.Select(m => m.DeepClone()).ToArray();
|
||||||
|
|
||||||
var gameplayWorkingBeatmap = new GameplayWorkingBeatmap(gameplayState.Beatmap);
|
var gameplayWorkingBeatmap = new GameplayWorkingBeatmap(gameplayState.Beatmap);
|
||||||
difficultyCache.GetTimedDifficultyAttributesAsync(gameplayWorkingBeatmap, gameplayState.Ruleset, gameplayState.Mods.ToArray(), loadCancellationSource.Token)
|
difficultyCache.GetTimedDifficultyAttributesAsync(gameplayWorkingBeatmap, gameplayState.Ruleset, clonedMods, loadCancellationSource.Token)
|
||||||
.ContinueWith(r => Schedule(() =>
|
.ContinueWith(r => Schedule(() =>
|
||||||
{
|
{
|
||||||
timedAttributes = r.Result;
|
timedAttributes = r.Result;
|
||||||
@ -116,7 +120,11 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var calculator = gameplayState.Ruleset.CreatePerformanceCalculator(attrib, gameplayState.Score.ScoreInfo);
|
// awkward but we need to make sure the true mods are not passed to PerformanceCalculator as it makes a mess of track applications.
|
||||||
|
var scoreInfo = gameplayState.Score.ScoreInfo.DeepClone();
|
||||||
|
scoreInfo.Mods = clonedMods;
|
||||||
|
|
||||||
|
var calculator = gameplayState.Ruleset.CreatePerformanceCalculator(attrib, scoreInfo);
|
||||||
|
|
||||||
Current.Value = (int)Math.Round(calculator?.Calculate() ?? 0, MidpointRounding.AwayFromZero);
|
Current.Value = (int)Math.Round(calculator?.Calculate() ?? 0, MidpointRounding.AwayFromZero);
|
||||||
IsValid = true;
|
IsValid = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user