Пример #1
0
        private void SetScreen(FlowCoordinator _activeFlowCoordinator, CustomViewController newViewController, VRUIViewController origViewController, bool right, bool immediately)
        {
            string        method     = right ? "SetRightScreenViewController" : "SetLeftScreenViewController";
            Action <bool> backAction = (immediate) => { _activeFlowCoordinator.InvokePrivateMethod(method, new object[] { PopViewControllerStack(right), immediate }); };

            _dismissCustom += backAction;  // custom back button behavior
            if (!newViewController.isActivated)
            {
                if (right)
                {
                    _rightViewControllerStack.Add(origViewController);
                }
                else
                {
                    _leftViewControllerStack.Add(origViewController);
                }

                if (newViewController.includeBackButton)
                {
                    newViewController.ClearBackButtonCallbacks();
                    newViewController.backButtonPressed += () => { backAction.Invoke(false); }; // default back button behavior
                }
                _activeFlowCoordinator.InvokePrivateMethod(method, new object[] { newViewController, immediately });
            }
        }
        private void _playlistDetailViewController_selectButtonPressed(Playlist playlist)
        {
            if (!_downloadQueueViewController.queuedSongs.Any(x => x.songQueueState == SongQueueState.Downloading || x.songQueueState == SongQueueState.Queued))
            {
                if (_playlistsNavigationController.viewControllers.IndexOf(_playlistDetailViewController) >= 0)
                {
                    PopViewControllerFromNavigationController(_playlistsNavigationController, null, true);
                }

                parentFlowCoordinator.InvokePrivateMethod("DismissFlowCoordinator", new object[] { this, null, false });
                didFinishEvent?.Invoke(playlist);
            }
        }
        private void ListBackPressed()
        {
            FlowCoordinator flowCoordinator = Resources.FindObjectsOfTypeAll <MainFlowCoordinator>().First();

            flowCoordinator.InvokePrivateMethod("DismissViewController", new object[] { _menuButtonListViewController, null, false });
            flowCoordinator.SetProperty("title", string.Empty);
        }
Пример #4
0
 public void Dismiss(bool immediately)
 {
     if (this.isActivated)
     {
         parentFlowCoordinator.InvokePrivateMethod("DismissFlowCoordinator", new object[] { this, null, immediately });
     }
 }
        /// <summary>
        /// Presents this flow coordinator and sets search space.
        /// This must be used instead of invoking the private PresentFlowCoordinator to ensure the list of levels is provided.
        /// </summary>
        /// <param name="parentFlowCoordinator">The flow coordinator that will be immediately higher in the hierarchy that will present this flow coordinator.</param>
        /// <param name="levels">The list of levels that will be used as the search space.</param>
        public void Activate(FlowCoordinator parentFlowCoordinator, IBeatmapLevelPack levelPack)
        {
            _levelsSearchSpace = levelPack.beatmapLevelCollection.beatmapLevels;
            Action onFinish = PushInitialViewControllersToNavigationController;

            parentFlowCoordinator.InvokePrivateMethod("PresentFlowCoordinator", new object[] { this, onFinish, false, false });

            WordPredictionEngine.Instance.SetActiveWordStorageFromLevelPack(levelPack);
        }
        private void PresentList()
        {
            if (_menuButtonListViewController == null)
            {
                _menuButtonListViewController = BeatSaberUI.CreateViewController <MenuButtonListViewController>();
                _menuButtonListViewController.pinButtonPushed   += PinButtonWasPushed;
                _menuButtonListViewController.backButtonPressed += ListBackPressed;
            }
            _menuButtonListViewController.SetData(buttonData);

            // Using MainFlowCoordinator instead of CustomMenu for compatibility with mods
            FlowCoordinator flowCoordinator = Resources.FindObjectsOfTypeAll <MainFlowCoordinator>().First();

            flowCoordinator.InvokePrivateMethod("PresentViewController", new object[] { _menuButtonListViewController, null, false });
            flowCoordinator.SetProperty("title", "Mods");
        }
Пример #7
0
        private void SetViewController(FlowCoordinator flowCoordinator, VRUIViewController viewController, ViewControllerPosition pos, bool immediate)
        {
            string method = string.Empty;

            switch (pos)
            {
            case ViewControllerPosition.Left:
                method = "SetLeftScreenViewController";
                break;

            case ViewControllerPosition.Right:
                method = "SetRightScreenViewController";
                break;

            case ViewControllerPosition.Bottom:
                method = "SetBottomScreenViewController";
                break;

            default:
                return;
            }
            flowCoordinator.InvokePrivateMethod(method, new object[] { viewController, immediate });
        }
Пример #8
0
 private void PlaylistsButtonPressed()
 {
     _playlistsFlowCoordinator.parentFlowCoordinator = _freePlayFlowCoordinator;
     _freePlayFlowCoordinator.InvokePrivateMethod("PresentFlowCoordinator", new object[] { _playlistsFlowCoordinator, null, false, false });
 }
 public void Present()
 {
     _freePlayFlowCoordinator.InvokePrivateMethod("PresentFlowCoordinator", new object[] { this, null, false, false });
 }
 /// <summary>
 /// Presents this view controller and sets the song list to filter.
 /// This must be used instead of invoking the private PresentViewController to ensure the list of levels is provided.
 /// </summary>
 /// <param name="parentFlowCoordinator">The flow coordinator that will present this view controller.</param>
 /// <param name="levels">The list of levels that will be filtered.</param>
 public void Activate(FlowCoordinator parentFlowCoordinator, IPreviewBeatmapLevel[] levels)
 {
     _levels = levels;
     parentFlowCoordinator.InvokePrivateMethod("PresentViewController", new object[] { this, null, false });
 }