public void RefreshLevelPacks() { CustomLevelsCollection.UpdatePreviewLevels(CustomLevels.Values.OrderBy(l => l.songName).ToArray()); WIPLevelsCollection.UpdatePreviewLevels(CustomWIPLevels.Values.OrderBy(l => l.songName).ToArray()); BeatmapLevelsModelSO.SetField("_loadedBeatmapLevelPackCollection", CustomBeatmapLevelPackCollectionSO); BeatmapLevelsModelSO.SetField("_allLoadedBeatmapLevelPackCollection", CustomBeatmapLevelPackCollectionSO); BeatmapLevelsModelSO.UpdateLoadedPreviewLevels(); OnLevelPacksRefreshed?.Invoke(); }
public void RefreshLevelPacks() { CustomLevelsCollection.UpdatePreviewLevels(CustomLevels.Values.OrderBy(l => l.songName).ToArray()); WIPLevelsCollection.UpdatePreviewLevels(CustomWIPLevels.Values.OrderBy(l => l.songName).ToArray()); CachedWIPLevelCollection?.UpdatePreviewLevels(CachedWIPLevels?.Values?.OrderBy(l => l.songName).ToArray()); if (CachedWIPLevels.Count > 0) { if (CachedWIPLevelsPack != null && !CustomBeatmapLevelPackCollectionSO._customBeatmapLevelPacks.Contains(CachedWIPLevelsPack)) { CustomBeatmapLevelPackCollectionSO.AddLevelPack(CachedWIPLevelsPack); } } // else if (CachedWIPLevelsPack != null && CustomBeatmapLevelPackCollectionSO._customBeatmapLevelPacks.Contains(CachedWIPLevelsPack)) // CustomBeatmapLevelPackCollectionSO._customBeatmapLevelPacks.Remove(CachedWIPLevelsPack); foreach (var folderEntry in SeperateSongFolders) { if (folderEntry.SongFolderEntry.Pack == FolderLevelPack.NewPack) { folderEntry.LevelCollection.UpdatePreviewLevels(folderEntry.Levels.Values.OrderBy(l => l.songName).ToArray()); if (folderEntry.Levels.Count > 0 || folderEntry is ModSeperateSongFolder) { if (!CustomBeatmapLevelPackCollectionSO._customBeatmapLevelPacks.Contains(folderEntry.LevelPack)) { CustomBeatmapLevelPackCollectionSO.AddLevelPack(folderEntry.LevelPack); } } // else if (CustomBeatmapLevelPackCollectionSO._customBeatmapLevelPacks.Contains(folderEntry.LevelPack)) // CustomBeatmapLevelPackCollectionSO._customBeatmapLevelPacks.Remove(folderEntry.LevelPack); } } BeatmapLevelsModelSO.SetField("_customLevelPackCollection", CustomBeatmapLevelPackCollectionSO); BeatmapLevelsModelSO.UpdateAllLoadedBeatmapLevelPacks(); BeatmapLevelsModelSO.UpdateLoadedPreviewLevels(); var filterNav = Resources.FindObjectsOfTypeAll <LevelFilteringNavigationController>().FirstOrDefault(); filterNav.InitPlaylists(); filterNav.UpdatePlaylistsData(); AttemptReselectCurrentLevelPack(filterNav); OnLevelPacksRefreshed?.Invoke(); }