1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-22 00:07:19 +08:00

Move ruleset into ReplayPlayerLoader as well

This commit is contained in:
David Zhao 2019-07-08 17:37:20 +09:00
parent e78e326f34
commit fbd300e664
2 changed files with 4 additions and 6 deletions

View File

@ -282,7 +282,6 @@ namespace osu.Game
performFromMainMenu(() =>
{
Ruleset.Value = databasedScoreInfo.Ruleset;
Beatmap.Value = BeatmapManager.GetWorkingBeatmap(databasedBeatmap);
menuScreen.Push(new ReplayPlayerLoader(databasedScore));

View File

@ -1,21 +1,19 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using osu.Framework.Allocation;
using osu.Game.Rulesets.Mods;
using osu.Game.Scoring;
namespace osu.Game.Screens.Play
{
public class ReplayPlayerLoader : PlayerLoader
{
private readonly IReadOnlyList<Mod> mods;
private readonly ScoreInfo scoreInfo;
public ReplayPlayerLoader(Score score)
: base(() => new ReplayPlayer(score))
{
mods = score.ScoreInfo.Mods;
scoreInfo = score.ScoreInfo;
}
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
@ -23,7 +21,8 @@ namespace osu.Game.Screens.Play
var dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
// Overwrite the global mods here for use in the mod hud.
Mods.Value = mods;
Mods.Value = scoreInfo.Mods;
Ruleset.Value = scoreInfo.Ruleset;
return dependencies;
}