diff --git a/osu.Game/Screens/OnlinePlay/DailyChallenge/DailyChallengeIntro.cs b/osu.Game/Screens/OnlinePlay/DailyChallenge/DailyChallengeIntro.cs index e59031f663..0a1ac7a5a7 100644 --- a/osu.Game/Screens/OnlinePlay/DailyChallenge/DailyChallengeIntro.cs +++ b/osu.Game/Screens/OnlinePlay/DailyChallenge/DailyChallengeIntro.cs @@ -93,14 +93,15 @@ namespace osu.Game.Screens.OnlinePlay.DailyChallenge protected override BackgroundScreen CreateBackground() => new DailyChallengeIntroBackgroundScreen(colourProvider); [BackgroundDependencyLoader] - private void load(BeatmapDifficultyCache difficultyCache, BeatmapModelDownloader beatmapDownloader, OsuConfigManager config, AudioManager audio) + private void load(RulesetStore rulesets, BeatmapDifficultyCache difficultyCache, BeatmapModelDownloader beatmapDownloader, OsuConfigManager config, AudioManager audio) { const float horizontal_info_size = 500f; - Ruleset ruleset = Ruleset.Value.CreateInstance(); - StarRatingDisplay starRatingDisplay; + IBeatmapInfo beatmap = item.Beatmap; + Ruleset ruleset = rulesets.GetRuleset(item.Beatmap.Ruleset.ShortName)!.CreateInstance(); + InternalChildren = new Drawable[] { beatmapAvailabilityTracker, @@ -242,13 +243,13 @@ namespace osu.Game.Screens.OnlinePlay.DailyChallenge Origin = Anchor.TopCentre, Shear = new Vector2(-OsuGame.SHEAR, 0f), MaxWidth = horizontal_info_size, - Text = item.Beatmap.BeatmapSet!.Metadata.GetDisplayTitleRomanisable(false), + Text = beatmap.BeatmapSet!.Metadata.GetDisplayTitleRomanisable(false), Padding = new MarginPadding { Horizontal = 5f }, Font = OsuFont.GetFont(size: 26), }, new TruncatingSpriteText { - Text = $"Difficulty: {item.Beatmap.DifficultyName}", + Text = $"Difficulty: {beatmap.DifficultyName}", Font = OsuFont.GetFont(size: 20, italics: true), MaxWidth = horizontal_info_size, Shear = new Vector2(-OsuGame.SHEAR, 0f), @@ -257,7 +258,7 @@ namespace osu.Game.Screens.OnlinePlay.DailyChallenge }, new TruncatingSpriteText { - Text = $"by {item.Beatmap.Metadata.Author.Username}", + Text = $"by {beatmap.Metadata.Author.Username}", Font = OsuFont.GetFont(size: 16, italics: true), MaxWidth = horizontal_info_size, Shear = new Vector2(-OsuGame.SHEAR, 0f), @@ -309,14 +310,14 @@ namespace osu.Game.Screens.OnlinePlay.DailyChallenge } }; - starDifficulty = difficultyCache.GetBindableDifficulty(item.Beatmap); + starDifficulty = difficultyCache.GetBindableDifficulty(beatmap); starDifficulty.BindValueChanged(star => { if (star.NewValue != null) starRatingDisplay.Current.Value = star.NewValue.Value; }, true); - LoadComponentAsync(new OnlineBeatmapSetCover(item.Beatmap.BeatmapSet as IBeatmapSetOnlineInfo) + LoadComponentAsync(new OnlineBeatmapSetCover(beatmap.BeatmapSet as IBeatmapSetOnlineInfo) { RelativeSizeAxes = Axes.Both, Anchor = Anchor.Centre, @@ -334,8 +335,8 @@ namespace osu.Game.Screens.OnlinePlay.DailyChallenge if (config.Get(OsuSetting.AutomaticallyDownloadMissingBeatmaps)) { - if (!beatmapManager.IsAvailableLocally(new BeatmapSetInfo { OnlineID = item.Beatmap.BeatmapSet!.OnlineID })) - beatmapDownloader.Download(item.Beatmap.BeatmapSet!, config.Get(OsuSetting.PreferNoVideo)); + if (!beatmapManager.IsAvailableLocally(new BeatmapSetInfo { OnlineID = beatmap.BeatmapSet!.OnlineID })) + beatmapDownloader.Download(beatmap.BeatmapSet!, config.Get(OsuSetting.PreferNoVideo)); } dateWindupSample = audio.Samples.Get(@"DailyChallenge/date-windup");