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());
        }
 public void Awake()
 {
     if (_beatBoardsMenuNavigationController == null)
     {
         _beatBoardsMenuNavigationController = BeatSaberUI.CreateViewController <BackButtonNavigationController>();
         _beatBoardsMenuNavigationController.didFinishEvent += _beatBoardsNavigationController_didFinishEvent;
     }
 }
示例#3
0
        protected override void DidActivate(bool firstActivation, ActivationType activationType)
        {
            if (firstActivation)
            {
                title = "BeastSaber Review";

                _simpleDialog = Resources.FindObjectsOfTypeAll <MainFlowCoordinator>().FirstOrDefault().GetPrivateField <SimpleDialogPromptViewController>("_simpleDialogPromptViewController");
                _simpleDialog = Instantiate(_simpleDialog.gameObject, _simpleDialog.transform.parent).GetComponent <SimpleDialogPromptViewController>();

                _navigationController = BeatSaberUI.CreateViewController <BackButtonNavigationController>();
                _navigationController.didFinishEvent += () => { didFinishEvent?.Invoke(); };

                _reviewViewController = BeatSaberUI.CreateViewController <ReviewViewController>();
                _reviewViewController.didPressSubmit += delegate(float funFactor, float rhythm, float flow, float patternQuality, float readability, float levelQuality)
                {
                    if (songkey.Contains("-"))
                    {
                        songkey = songkey.Substring(0, songkey.IndexOf("-"));
                    }

                    _lastReview = new SongReview(songkey, funFactor, rhythm, flow, patternQuality, readability, levelQuality); SubmitPressed();
                };

                _reviewViewController.didActivateEvent += (arg0, arg1) =>
                {
                    if (arg1 == VRUIViewController.ActivationType.AddedToHierarchy)
                    {
                        if (PluginConfig.reviewedSongs.ContainsKey(levelId.Substring(0, 32)))
                        {
                            _reviewViewController.SetSubmitButtonState(false, true);
                            _reviewViewController.SetStatusText(true, "<color=red>You have already left a review about this song!");

                            _reviewViewController.SetReviewValues(
                                PluginConfig.reviewedSongs[levelId.Substring(0, 32)].fun_factor,
                                PluginConfig.reviewedSongs[levelId.Substring(0, 32)].rhythm,
                                PluginConfig.reviewedSongs[levelId.Substring(0, 32)].flow,
                                PluginConfig.reviewedSongs[levelId.Substring(0, 32)].pattern_quality,
                                PluginConfig.reviewedSongs[levelId.Substring(0, 32)].readability,
                                PluginConfig.reviewedSongs[levelId.Substring(0, 32)].level_quality
                                );
                        }
                        else
                        {
                            _reviewViewController.SetSubmitButtonState(true, true);
                            _reviewViewController.SetStatusText(false, "");

                            _reviewViewController.SetReviewValues(0f, 0f, 0f, 0f, 0f, 0f);
                        }
                    }
                };
            }

            SetViewControllersToNavigationConctroller(_navigationController, _reviewViewController);
            ProvideInitialViewControllers(_navigationController, null, null);
        }
        public void Awake()
        {
            if (_playlistsNavigationController == null)
            {
                _playlistsNavigationController = BeatSaberUI.CreateViewController <BackButtonNavigationController>();

                GameObject _playlistDetailGameObject = Instantiate(Resources.FindObjectsOfTypeAll <StandardLevelDetailViewController>().First(), _playlistsNavigationController.rectTransform, false).gameObject;
                _playlistDetailViewController = _playlistDetailGameObject.AddComponent <PlaylistDetailViewController>();
                Destroy(_playlistDetailGameObject.GetComponent <StandardLevelDetailViewController>());
                _playlistDetailViewController.name = "PlaylistDetailViewController";
            }
        }
        public void Awake()
        {
            if (_songDetailViewController == null && _moreSongsNavigationController == null)
            {
                _moreSongsNavigationController = BeatSaberUI.CreateViewController <BackButtonNavigationController>();
                _moreSongsNavigationController.didFinishEvent += _moreSongsNavigationController_didFinishEvent;

                GameObject _songDetailGameObject = Instantiate(Resources.FindObjectsOfTypeAll <StandardLevelDetailViewController>().First(), _moreSongsNavigationController.rectTransform, false).gameObject;
                Destroy(_songDetailGameObject.GetComponent <StandardLevelDetailViewController>());
                _songDetailViewController = _songDetailGameObject.AddComponent <SongDetailViewController>();
                _songDetailViewController.downloadButtonPressed += _songDetailViewController_downloadButtonPressed;
                _songDetailViewController.favoriteButtonPressed += _songDetailViewController_favoriteButtonPressed;
            }
        }
示例#6
0
        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;
            }
        }
        protected override void DidActivate(bool firstActivation, ActivationType activationType)
        {
            if (firstActivation && activationType == ActivationType.AddedToHierarchy)
            {
                title = "More Songs";

                SongDownloader.Instance.songDownloaded += SongDownloader_songDownloaded;

                _moreSongsNavigationController = BeatSaberUI.CreateViewController <BackButtonNavigationController>();
                _moreSongsNavigationController.didFinishEvent += _moreSongsNavigationController_didFinishEvent;

                _moreSongsListViewController = BeatSaberUI.CreateViewController <MoreSongsListViewController>();
                _moreSongsListViewController.pageDownPressed     += _moreSongsListViewController_pageDownPressed;
                _moreSongsListViewController.pageUpPressed       += _moreSongsListViewController_pageUpPressed;
                _moreSongsListViewController.sortByTop           += () => { currentSortMode = "top"; currentPage = 0; StartCoroutine(GetPage(currentPage, currentSortMode)); currentSearchRequest = ""; };
                _moreSongsListViewController.sortByNew           += () => { currentSortMode = "new"; currentPage = 0; StartCoroutine(GetPage(currentPage, currentSortMode)); currentSearchRequest = ""; };
                _moreSongsListViewController.sortByPlays         += () => { currentSortMode = "plays"; currentPage = 0; StartCoroutine(GetPage(currentPage, currentSortMode)); currentSearchRequest = ""; };
                _moreSongsListViewController.searchButtonPressed += _moreSongsListViewController_searchButtonPressed;
                _moreSongsListViewController.didSelectRow        += _moreSongsListViewController_didSelectRow;

                GameObject _songDetailGameObject = Instantiate(Resources.FindObjectsOfTypeAll <StandardLevelDetailViewController>().First(), _moreSongsNavigationController.rectTransform, false).gameObject;
                Destroy(_songDetailGameObject.GetComponent <StandardLevelDetailViewController>());
                _songDetailViewController = _songDetailGameObject.AddComponent <SongDetailViewController>();
                _songDetailViewController.downloadButtonPressed += _songDetailViewController_downloadButtonPressed;
                _songDetailViewController.favoriteButtonPressed += _songDetailViewController_favoriteButtonPressed;;

                _downloadQueueViewController = BeatSaberUI.CreateViewController <DownloadQueueViewController>();

                _simpleDialog = CustomUI.Utilities.ReflectionUtil.GetPrivateField <SimpleDialogPromptViewController>(Resources.FindObjectsOfTypeAll <MainFlowCoordinator>().First(), "_simpleDialogPromptViewController");
                _simpleDialog = Instantiate(_simpleDialog.gameObject, _simpleDialog.transform.parent).GetComponent <SimpleDialogPromptViewController>();
            }

            SetViewControllersToNavigationConctroller(_moreSongsNavigationController, new VRUIViewController[]
            {
                _moreSongsListViewController
            });
            ProvideInitialViewControllers(_moreSongsNavigationController, _downloadQueueViewController, null);

            StartCoroutine(GetPage(0, "top"));
        }
        protected override void DidActivate(bool firstActivation, ActivationType activationType)
        {
            if (firstActivation && activationType == ActivationType.AddedToHierarchy)
            {
                Instance = this;
                title    = "Beat Saber Local Profiles";

                _backButtonNavigationController = BeatSaberUI.CreateViewController <BackButtonNavigationController>();
                _backButtonNavigationController.didFinishEvent += _BackButtonNavigationController_didFinishEvent;


                _localProfilesViewController = BeatSaberUI.CreateViewController <LocalProfilesViewController>();

                GameObject _songDetailGameObject = Instantiate(Resources.FindObjectsOfTypeAll <StandardLevelDetailViewController>().First(), _backButtonNavigationController.rectTransform, false).gameObject;
                Destroy(_songDetailGameObject.GetComponent <StandardLevelDetailViewController>());
            }


            SetViewControllersToNavigationConctroller(_backButtonNavigationController, new VRUIViewController[]
            {
                _localProfilesViewController
            });
            ProvideInitialViewControllers(_backButtonNavigationController, null, null);
        }