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
1 changed files with 6 additions and 6 deletions

View File

@ -88,7 +88,7 @@ public void UpdateBeatmap(WorkingBeatmap beatmap)
private void loadBeatmap()
{
LoadComponentAsync(new BufferedWedgeInfo(beatmap)
LoadComponentAsync(new BufferedWedgeInfo(beatmap, ruleset.Value)
{
Shear = -Shear,
Depth = Info?.Depth + 1 ?? 0,
@ -114,18 +114,18 @@ public class BufferedWedgeInfo : BufferedContainer
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();