1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 12:17:26 +08:00

Pass down ruleset to the buffered wedge

This commit is contained in:
smoogipoo 2018-05-11 14:10:53 +09:00
parent 2bab08c437
commit 816ad5c426

View File

@ -88,7 +88,7 @@ namespace osu.Game.Screens.Select
private void loadBeatmap()
{
LoadComponentAsync(new BufferedWedgeInfo(beatmap)
LoadComponentAsync(new BufferedWedgeInfo(beatmap, ruleset.Value)
{
Shear = -Shear,
Depth = Info?.Depth + 1 ?? 0,
@ -114,18 +114,18 @@ namespace osu.Game.Screens.Select
private UnicodeBindableString titleBinding;
private UnicodeBindableString artistBinding;
private RulesetInfo ruleset;
private readonly RulesetInfo ruleset;
public BufferedWedgeInfo(WorkingBeatmap working)
public BufferedWedgeInfo(WorkingBeatmap working, RulesetInfo userRuleset)
{
this.working = working;
ruleset = userRuleset ?? working.BeatmapInfo.Ruleset;
}
[BackgroundDependencyLoader(true)]
private void load([NotNull] LocalisationEngine localisation, [CanBeNull] OsuGame osuGame)
private void load([NotNull] LocalisationEngine localisation)
{
ruleset = osuGame?.Ruleset.Value ?? working.BeatmapInfo.Ruleset;
var beatmapInfo = working.BeatmapInfo;
var metadata = beatmapInfo.Metadata ?? working.BeatmapSetInfo?.Metadata ?? new BeatmapMetadata();