Update all beatmap overlay views to use APIBeatmap/APIBeatmapSet

This commit is contained in:
Dean Herbert
2021-10-29 17:58:46 +09:00
parent b8ee7e05f4
commit a16c8f1ebc
45 changed files with 471 additions and 613 deletions

View File

@ -223,7 +223,7 @@ namespace osu.Game.Screens.Play
onlineBeatmapRequest.Success += res => Schedule(() =>
{
onlineBeatmap = res.ToBeatmapSet(rulesets);
beatmapPanelContainer.Child = new GridBeatmapPanel(onlineBeatmap);
beatmapPanelContainer.Child = new GridBeatmapPanel(res);
checkForAutomaticDownload();
});

View File

@ -57,7 +57,7 @@ namespace osu.Game.Screens.Select
beatmapInfo = value;
failTimes = beatmapInfo?.OnlineInfo?.FailTimes;
ratings = beatmapInfo?.BeatmapSet?.Ratings;
ratings = beatmapInfo?.BeatmapSet?.OnlineInfo?.Ratings;
Scheduler.AddOnce(updateStatistics);
}
@ -182,7 +182,7 @@ namespace osu.Game.Screens.Select
source.Text = BeatmapInfo?.Metadata?.Source;
tags.Text = BeatmapInfo?.Metadata?.Tags;
// metrics may have been previously fetched
// failTimes may have been previously fetched
if (ratings != null && failTimes != null)
{
updateMetrics();

View File

@ -38,9 +38,9 @@ namespace osu.Game.Screens.Select.Details
protected readonly StatisticRow FirstValue, HpDrain, Accuracy, ApproachRate;
private readonly StatisticRow starDifficulty;
private BeatmapInfo beatmapInfo;
private IBeatmapInfo beatmapInfo;
public BeatmapInfo BeatmapInfo
public IBeatmapInfo BeatmapInfo
{
get => beatmapInfo;
set
@ -106,7 +106,7 @@ namespace osu.Game.Screens.Select.Details
private void updateStatistics()
{
IBeatmapDifficultyInfo baseDifficulty = BeatmapInfo?.BaseDifficulty;
IBeatmapDifficultyInfo baseDifficulty = BeatmapInfo?.Difficulty;
BeatmapDifficulty adjustedDifficulty = null;
if (baseDifficulty != null && mods.Value.Any(m => m is IApplicableToDifficulty))
@ -117,7 +117,7 @@ namespace osu.Game.Screens.Select.Details
mod.ApplyToDifficulty(adjustedDifficulty);
}
switch (BeatmapInfo?.Ruleset?.ID ?? 0)
switch (BeatmapInfo?.Ruleset.OnlineID)
{
case 3:
// Account for mania differences locally for now