Add the playable beatmap as check argument

This is different from the working beatmap's `.Beatmap` property in that it is mutated by the ruleset/editor.

So hit objects, for example, are actually of type `Slider` and such instead of the legacy `ConvertSlider`.

This should be preferred over `workingBeatmap.Beatmap`.
This commit is contained in:
Naxess
2021-04-20 01:31:51 +02:00
parent 9a69ca34a6
commit 8656176ab8
11 changed files with 36 additions and 29 deletions

View File

@ -30,9 +30,9 @@ namespace osu.Game.Rulesets.Edit.Checks
new IssueTemplateTooUncompressed(this)
};
public IEnumerable<Issue> Run(IWorkingBeatmap workingBeatmap)
public IEnumerable<Issue> Run(IBeatmap playableBeatmap, IWorkingBeatmap workingBeatmap)
{
var backgroundFile = workingBeatmap.Beatmap.Metadata?.BackgroundFile;
var backgroundFile = playableBeatmap.Metadata?.BackgroundFile;
if (backgroundFile == null)
yield break;
@ -48,7 +48,7 @@ namespace osu.Game.Rulesets.Edit.Checks
else if (texture.Width < low_width || texture.Height < low_height)
yield return new IssueTemplateLowResolution(this).Create(texture.Width, texture.Height);
string storagePath = workingBeatmap.Beatmap.BeatmapInfo.BeatmapSet.GetPathForFile(backgroundFile);
string storagePath = playableBeatmap.BeatmapInfo.BeatmapSet.GetPathForFile(backgroundFile);
double filesizeMb = workingBeatmap.GetStream(storagePath).Length / (1024d * 1024d);
if (filesizeMb > max_filesize_mb)