/// <summary> /// Only gets called once during boot of BeatSaber. /// </summary> /// <param name="loader"></param> /// <param name="levels"></param> private void OnSongLoaderLoadedSongs(SongCore.Loader loader, ConcurrentDictionary <string, CustomPreviewBeatmapLevel> levels) { Logger.Trace("OnSongLoaderLoadedSongs-SongBrowserApplication()"); try { _songBrowserUI.UpdateLevelDataModel(); _songBrowserUI.RefreshSongList(); } catch (Exception e) { Logger.Exception("Exception during OnSongLoaderLoadedSongs: ", e); } }
/// <summary> /// Only gets called once during boot of BeatSaber. /// </summary> /// <param name="loader"></param> /// <param name="levels"></param> private void OnSongLoaderLoadedSongs(SongLoader loader, List <CustomLevel> levels) { Logger.Trace("OnSongLoaderLoadedSongs-SongBrowserApplication()"); try { _songBrowserUI.UpdateLevelPackModel(); _songBrowserUI.UpdateLevelDataModel(); _songBrowserUI.RefreshSongList(); } catch (Exception e) { Logger.Exception("Exception during OnSongLoaderLoadedSongs: ", e); } }
/// <summary> /// Wait for the song list to be visible to draw it. /// </summary> /// <returns></returns> private IEnumerator WaitForSongListUI() { Logger.Trace("WaitForSongListUI()"); yield return(new WaitUntil(delegate() { return Resources.FindObjectsOfTypeAll <SoloFreePlayFlowCoordinator>().Any() && Resources.FindObjectsOfTypeAll <SoloFreePlayFlowCoordinator>().Any(); })); Logger.Debug("Found Solo and Party FreePlayFlowCoordinators..."); if (SongLoaderPlugin.SongLoader.AreSongsLoaded) { OnSongLoaderLoadedSongs(null, SongLoader.CustomLevels); } else { SongLoader.SongsLoadedEvent += OnSongLoaderLoadedSongs; } _songBrowserUI.RefreshSongList(); }