public void FilterSongList(ref List <BeatmapDetails> detailsList) { if (!_isInitialized || (!_oneSaberAppliedValue && !_lightshowAppliedValue && _mappingExtensionsAppliedValue == SongRequirement.Off)) { return; } for (int i = 0; i < detailsList.Count;) { BeatmapDetails beatmap = detailsList[i]; List <CustomPreviewBeatmapLevel> customLevels = null; if (_mappingExtensionsAppliedValue != SongRequirement.Off) { customLevels = Loader.CustomLevels.Values.ToList(); } if (_lightshowAppliedValue && !beatmap.DifficultyBeatmapSets.Any(diffSet => diffSet.DifficultyBeatmaps.Any(diff => diff.NotesCount == 0))) { detailsList.RemoveAt(i); } else if (_oneSaberAppliedValue && !beatmap.DifficultyBeatmapSets.Any(diffSet => diffSet.CharacteristicName == "OneSaber")) { detailsList.RemoveAt(i); } else if (_mappingExtensionsAppliedValue != SongRequirement.Off && !beatmap.IsOST) { // remove songs that somehow aren't OST, but also aren't custom levels handled by SongCore CustomPreviewBeatmapLevel customLevel = customLevels.FirstOrDefault(x => x.levelID == beatmap.LevelID); if (customLevel == null) { detailsList.RemoveAt(i); continue; } ExtraSongData songData = Collections.RetrieveExtraSongData(Hashing.GetCustomLevelHash(customLevel), customLevel.customLevelPath); if (songData == null) { detailsList.RemoveAt(i); continue; } bool required = songData._difficulties?.Any(x => x.additionalDifficultyData?._requirements?.Any(y => y == "Mapping Extensions") == true) == true; if ((_mappingExtensionsAppliedValue == SongRequirement.Required && !required) || (_mappingExtensionsAppliedValue == SongRequirement.NotRequired && required)) { detailsList.RemoveAt(i); continue; } // passes check, requires mapping extensions ++i; } else { ++i; } } }
public static ExtraSongData.DifficultyData RetrieveDifficultyData(IDifficultyBeatmap beatmap) { ExtraSongData songData = null; if (beatmap.level is CustomPreviewBeatmapLevel) { var customLevel = beatmap.level as CustomPreviewBeatmapLevel; songData = RetrieveExtraSongData(Hashing.GetCustomLevelHash(customLevel), customLevel.customLevelPath); } if (songData == null) { return(null); } ExtraSongData.DifficultyData diffData = songData._difficulties.FirstOrDefault(x => x._difficulty == beatmap.difficulty && (x._beatmapCharacteristicName == beatmap.parentDifficultyBeatmapSet.beatmapCharacteristic.characteristicNameLocalizationKey || x._beatmapCharacteristicName == beatmap.parentDifficultyBeatmapSet.beatmapCharacteristic.serializedName)); return(diffData); }
public static bool HasCinemaInAnyDifficulty(this ExtraSongData songData) { return(songData.HasCinemaSuggestionInAnyDifficulty() || songData.HasCinemaRequirementInAnyDifficulty()); }
public static bool HasCinemaRequirementInAnyDifficulty(this ExtraSongData songData) { return(songData._difficulties.Any(difficulty => difficulty.HasCinemaRequirement())); }
public static bool HasCinemaSuggestionInAnyDifficulty(this ExtraSongData songData) { return(songData._difficulties.Any(difficulty => difficulty.HasCinemaSuggestion())); }