Beispiel #1
0
 /// <summary>
 /// Handle Mode
 /// </summary>
 /// <param name="arg1"></param>
 /// <param name="arg2"></param>
 private void HandleModeSelection(MainMenuViewController.MenuButton mode)
 {
     Logger.Trace("HandleModeSelection()");
     this._songBrowserUI.CreateUI(mode);
     this._songBrowserUI.UpdateSongList();
     this._songBrowserUI.RefreshSongList();
 }
 /// <summary>
 /// Handle Mode
 /// </summary>
 /// <param name="arg1"></param>
 /// <param name="arg2"></param>
 private void HandleModeSelection(MainMenuViewController.MenuButton mode)
 {
     Logger.Trace("HandleModeSelection()");
     _songBrowserUI.CreateUI(mode);
     SongBrowserApplication.MainProgressBar.ShowMessage("");
     StartCoroutine(UpdateBrowserUI());
 }
        private void OnDidFinishEvent(MainMenuViewController mmvc, MainMenuViewController.MenuButton menuButton)
        {
            if (menuButton != MainMenuViewController.MenuButton.SoloFreePlay &&
                menuButton != MainMenuViewController.MenuButton.Party)
            {
                return;
            }
            _clickDateTime = new DateTime(0);
            _latestClick   = ControllerType.None;
            var lcvc = Resources.FindObjectsOfTypeAll <LevelCollectionViewController>().FirstOrDefault();

            if (lcvc == null)
            {
                return;
            }
            var lctv = lcvc.GetPrivateField <LevelCollectionTableView>("_levelCollectionTableView");

            if (lctv == null)
            {
                return;
            }
            _currentTableViewContent = lctv.GetPrivateField <TableView>("_tableView");
            if (_currentTableViewContent == null)
            {
                return;
            }
            Logger.log.Debug("Content table view found!");
            _genericLeftController  = InputDevices.GetDeviceAtXRNode(XRNode.LeftHand);
            _genericRightController = InputDevices.GetDeviceAtXRNode(XRNode.RightHand);
            _isInitialized          = true;
        }
 /// <summary>
 /// Handle Mode
 /// </summary>
 /// <param name="arg1"></param>
 /// <param name="arg2"></param>
 private void HandleModeSelection(MainMenuViewController.MenuButton mode)
 {
     Logger.Trace("HandleModeSelection()");
     _songBrowserUI.UpdateLevelPackModel(true);
     this._songBrowserUI.CreateUI(mode);
     StartCoroutine(this.UpdateBrowserUI());
 }
        private void MainMenuNavigated(MainMenuViewController sender, MainMenuViewController.MenuButton subMenuType)
        {
            VRUIViewController parent = parentViewController;

            DismissModalViewController(null, true);
            parent.gameObject.SetActive(false);
        }
 private void SongListTweaks_didFinishEvent(MainMenuViewController sender, MainMenuViewController.MenuButton result)
 {
     if (result == MainMenuViewController.MenuButton.SoloFreePlay)
     {
         _freePlayFlowCoordinator = FindObjectOfType <SoloFreePlayFlowCoordinator>();
     }
     else if (result == MainMenuViewController.MenuButton.Party)
     {
         _freePlayFlowCoordinator = FindObjectOfType <PartyFreePlayFlowCoordinator>();
     }
     else
     {
         _freePlayFlowCoordinator = null;
     }
 }
 static bool Prefix(MainMenuViewController viewController, MainMenuViewController.MenuButton subMenuType)
 {
     if (subMenuType == MainMenuViewController.MenuButton.Quit)
     {
         if (Plugin.config.Value.EnablePlugin && Plugin.config.Value.AskWhenQuitting)
         {
             MainMenuUIOverload.Instance.ShowConfirmQuitPanel(MainMenuUIOverload.PanelState.Quit);
         }
         else
         {
             Application.Quit();
         }
         return(false);
     }
     return(true);
 }
 public static bool Prefix(MainMenuViewController viewController, MainMenuViewController.MenuButton subMenuType)
 {
     if (subMenuType == MainMenuViewController.MenuButton.Quit)
     {
         if (PluginConfig.EnablePlugin)
         {
             MainMenuUIOverload.Instance.ShowConfirmQuitPanel();
         }
         else
         {
             Application.Quit();
         }
         return(false);
     }
     return(true);
 }
        private static void OnDidFinishEvent(MainMenuViewController mmvc, MainMenuViewController.MenuButton _)
        {
            var sldvc = Resources.FindObjectsOfTypeAll <StandardLevelDetailViewController>().FirstOrDefault();
            var ldvc  = Resources.FindObjectsOfTypeAll <StandardLevelDetailView>().FirstOrDefault();

            if (!sldvc || !ldvc)
            {
                return;
            }
            var bcscc = ReflectionUtil.GetPrivateField <BeatmapCharacteristicSegmentedControlController>(ldvc, "_beatmapCharacteristicSegmentedControlController");
            var bdscc = ReflectionUtil.GetPrivateField <BeatmapDifficultySegmentedControlController>(ldvc, "_beatmapDifficultySegmentedControlController");

            if (!bcscc || !bdscc)
            {
                return;
            }
            sldvc.didPresentContentEvent += (sldvcController, type) => {
                bcscc.didSelectBeatmapCharacteristicEvent += (controlController, so) => { RefreshButtonsBackgrounds <TextSegmentedControlCellNew>(bdscc); };
                RefreshButtonsBackgrounds <IconSegmentedControlCell>(bcscc);
                RefreshButtonsBackgrounds <TextSegmentedControlCellNew>(bdscc);
            };
            var coverImage           = ReflectionUtil.GetPrivateField <RawImage>(ldvc, "_coverImage");
            var levelInfo            = coverImage.transform.parent;
            var playerStatsContainer = ReflectionUtil.GetPrivateField <GameObject>(ldvc, "_playerStatsContainer");
            var pscLayout            = playerStatsContainer.GetComponent <LayoutElement>();
            var playContainer        = bdscc.transform.parent;
            var levelInfoLayout      = levelInfo.GetComponent <LayoutElement>();

            if (!coverImage || !levelInfo || !playerStatsContainer || !pscLayout || !playContainer || !levelInfoLayout)
            {
                return;
            }
            coverImage.transform.localPosition = new Vector3(0, 0, coverImage.transform.localPosition.z);
            coverImage.transform.localScale    = Vector3.one;
            coverImage.GetComponent <RectTransform>().sizeDelta        = new Vector2(11, 11);
            coverImage.GetComponent <RectTransform>().anchorMin        = new Vector2(0, 0);
            coverImage.GetComponent <RectTransform>().anchorMax        = new Vector2(1, 1);
            coverImage.GetComponent <RectTransform>().anchoredPosition = new Vector2(1.5f, 0);
            coverImage.uvRect = new Rect(0, 0, 1, 1);
            playContainer.SetParent(levelInfo);
            playContainer.localPosition = new Vector3(-1, -52);
            playContainer.GetComponent <Image>().enabled = false;
            pscLayout.transform.SetParent(levelInfo);
            pscLayout.transform.localPosition = new Vector3(0, -10);
            levelInfoLayout.preferredHeight   = 60;
            mmvc.didFinishEvent -= OnDidFinishEvent;
        }
Beispiel #10
0
 private void SongListTweaks_didFinishEvent(MainMenuViewController sender, MainMenuViewController.MenuButton result)
 {
     if (result == MainMenuViewController.MenuButton.SoloFreePlay)
     {
         _freePlayFlowCoordinator = FindObjectOfType <SoloFreePlayFlowCoordinator>();
         _lastCharacteristic      = _beatmapCharacteristics.First(x => x.characteristicName == "Standard");
         lastPlaylist             = null;
     }
     else if (result == MainMenuViewController.MenuButton.Party)
     {
         _freePlayFlowCoordinator = FindObjectOfType <PartyFreePlayFlowCoordinator>();
         _lastCharacteristic      = _beatmapCharacteristics.First(x => x.characteristicName == "Standard");
         lastPlaylist             = null;
     }
     else
     {
         _freePlayFlowCoordinator = null;
         lastPlaylist             = null;
     }
 }
        private void MainMenuViewController_didFinishEvent(MainMenuViewController vc, MainMenuViewController.MenuButton menuButton)
        {
            IsInSoloFreeplay = menuButton == MainMenuViewController.MenuButton.SoloFreePlay;
            //Plugin.Log.Info($"MainMenuViewController Menu Button Pressed ==> {menuButton.ToString()}");

            if (Plugin.cfg.Enabled)
            {
                if (IsInSoloFreeplay)
                {
                    foreach (var gameplayModifierToggle in _gameplayModifierToggles)
                    {
                        //Plugin.Log.Info($"{gameplayModifierToggle.gameplayModifier.modifierNameLocalizationKey} - {gameplayModifierToggle.gameplayModifier.name} - {Localization.Get(gameplayModifierToggle.gameplayModifier.modifierNameLocalizationKey)}");
                        if (gameplayModifierToggle.gameplayModifier.modifierNameLocalizationKey == "MODIFIER_NO_FAIL_ON_0_ENERGY")
                        {
                            // add listeners to modifier toggle
                            gameplayModifierToggle.toggle.onValueChanged.RemoveListener(new UnityAction <bool>(HandleNoFailToggle));
                            gameplayModifierToggle.toggle.onValueChanged.AddListener(new UnityAction <bool>(HandleNoFailToggle));

                            // set initial state
                            NoFailEnabled = gameplayModifierToggle.toggle.isOn;

                            // exit loop, only 1 no fail toggle
                            break;
                        }
                    }
                }

                // setup default button state
                SetButtonState(NoFailEnabled);
            }
        }
 static bool Prefix(MainMenuViewController.MenuButton menuButton) =>
 menuButton != MainMenuViewController.MenuButton.BeatmapEditor || !Configuration.PluginConfig.Instance.disableIngameMapEditor;
Beispiel #13
0
 private static void MainMenuViewController_didFinishEvent(MainMenuViewController arg1, MainMenuViewController.MenuButton arg2)
 {
     if (arg2 == MainMenuViewController.MenuButton.Party)
     {
         IsPartyActive = true;
     }
     else
     {
         IsPartyActive = false;
     }
 }
 private void MainMenuViewController_didFinishEvent(MainMenuViewController obj, MainMenuViewController.MenuButton buttonType)
 {
     if (buttonType == MainMenuViewController.MenuButton.Party)
     {
         GameObject leftScreen  = GameObject.Find("LeftScreen");
         GameObject rightScreen = GameObject.Find("RightScreen");
         LeftScreenPosition  = leftScreen.transform.position;
         RightScreenPosition = rightScreen.transform.position;
         ToggleLeftScreen(false);
         ToggleRightScreen(false);
         StartCoroutine(WaitForLevelSelectionNavigationController(false));
         setUp     = true;
         isEnabled = true;
     }
 }