protected override void DidActivate(bool firstActivation, ActivationType activationType) { if (firstActivation && activationType == ActivationType.AddedToHierarchy) { title = "More Playlists"; _playlistsNavigationController = BeatSaberUI.CreateViewController <BackButtonNavigationController>(); _playlistsNavigationController.didFinishEvent += _morePlaylistsNavigationController_didFinishEvent; _playlistsListViewController = BeatSaberUI.CreateViewController <PlaylistListViewController>(); _playlistsListViewController.didSelectRow += _morePlaylistsListViewController_didSelectRow; _playlistsListViewController.highlightDownloadedPlaylists = true; GameObject _songDetailGameObject = Instantiate(Resources.FindObjectsOfTypeAll <StandardLevelDetailViewController>().First(), _playlistsNavigationController.rectTransform, false).gameObject; Destroy(_songDetailGameObject.GetComponent <StandardLevelDetailViewController>()); _playlistDetailViewController = _songDetailGameObject.AddComponent <PlaylistDetailViewController>(); _playlistDetailViewController.selectButtonPressed += _playlistDetailViewController_selectButtonPressed; _playlistDetailViewController.SetSelectButtonText("Add"); _playlistDetailViewController.addDownloadButton = false; _loadingIndicator = BeatSaberUI.CreateLoadingSpinner(_playlistsNavigationController.transform); } SetViewControllersToNavigationConctroller(_playlistsNavigationController, new VRUIViewController[] { _playlistsListViewController }); ProvideInitialViewControllers(_playlistsNavigationController, null, null); StartCoroutine(GetPlaylists()); }
protected override void DidActivate(bool firstActivation, ActivationType activationType) { if (firstActivation && activationType == ActivationType.AddedToHierarchy) { title = "Playlists"; _playlistsNavigationController.didFinishEvent += _playlistsNavigationController_didFinishEvent; _playlistListViewController = BeatSaberUI.CreateViewController <PlaylistListViewController>(); _playlistListViewController.didSelectRow += _playlistListViewController_didSelectRow; _playlistDetailViewController.downloadButtonPressed += _playlistDetailViewController_downloadButtonPressed; _playlistDetailViewController.selectButtonPressed += _playlistDetailViewController_selectButtonPressed; _playlistDetailViewController.SetSelectButtonText("Select"); _downloadQueueViewController = BeatSaberUI.CreateViewController <DownloadQueueViewController>(); SetViewControllersToNavigationConctroller(_playlistsNavigationController, new VRUIViewController[] { _playlistListViewController }); ProvideInitialViewControllers(_playlistsNavigationController, _downloadQueueViewController, null); } _downloadingPlaylist = false; _playlistListViewController.SetContent(PlaylistsCollection.loadedPlaylists); _downloadQueueViewController.allSongsDownloaded += _downloadQueueViewController_allSongsDownloaded; }
public void Awake() { if (_playlistDetailViewController == null) { _playlistsNavigationController = BeatSaberUI.CreateViewController <BackButtonNavigationController>(); _playlistsNavigationController.didFinishEvent += _morePlaylistsNavigationController_didFinishEvent; GameObject _songDetailGameObject = Instantiate(Resources.FindObjectsOfTypeAll <StandardLevelDetailViewController>().First(), _playlistsNavigationController.rectTransform, false).gameObject; Destroy(_songDetailGameObject.GetComponent <StandardLevelDetailViewController>()); _playlistDetailViewController = _songDetailGameObject.AddComponent <PlaylistDetailViewController>(); _playlistDetailViewController.selectButtonPressed += _playlistDetailViewController_selectButtonPressed; _playlistDetailViewController.SetSelectButtonText("Add"); _playlistDetailViewController.addDownloadButton = false; } }