private void ListViewSearchPressed() { if (_searchViewController == null) { _searchViewController = BeatSaberUI.CreateViewController <SearchKeyboardViewController>(); _searchViewController.backButtonPressed += SearchViewControllerBackButtonPressed; _searchViewController.searchButtonPressed += SearchViewControllerSearchButtonPressed; } _searchViewController.SetQuickButtons(selectedLevel); PresentViewController(_searchViewController); ScreenManager.Instance.HideScreen(); }
private void _playerInfoViewController_editNameButtonPressed(string text) { if (_keyboardViewController == null) { _keyboardViewController = BeatSaberUI.CreateViewController <KeyboardViewController>(); _keyboardViewController.backButtonPressed += _keyboardViewController_backButtonPressed; _keyboardViewController.searchButtonPressed += _keyboardViewController_searchButtonPressed; } PresentViewController(_keyboardViewController); }
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"; } }
private static void InitRequirementsMenu() { reqDialog = BeatSaberUI.CreateCustomMenu <CustomMenu>("Song Requirements"); reqViewController = BeatSaberUI.CreateViewController <CustomListViewController>(); RectTransform confirmContainer = new GameObject("CustomListContainer", typeof(RectTransform)).transform as RectTransform; confirmContainer.SetParent(reqViewController.rectTransform, false); confirmContainer.sizeDelta = new Vector2(60f, 0f); GetIcons(); reqDialog.SetMainViewController(reqViewController, true); }
public void Awake() { if (saberListView == null) { saberListView = BeatSaberUI.CreateViewController <SaberListView>(); } if (saberPreviewView == null) { saberPreviewView = BeatSaberUI.CreateViewController <SaberPreviewView>(); } }
private void _SetupConfirmQuitPanel() { _CustomMenu = BeatSaberUI.CreateCustomMenu <CustomMenu>("Quit"); _CustomViewController = BeatSaberUI.CreateViewController <CustomViewController>(); if (_CustomMenu != null && _CustomViewController != null) { _CustomViewController.didDeactivateEvent += (deactivationType) => { ConfirmExitDialogOpened = false; }; _CustomMenu.SetMainViewController(_CustomViewController, false, (firstActivation, type) => { if (firstActivation && type == VRUI.VRUIViewController.ActivationType.AddedToHierarchy) { _TopText = _CustomViewController.CreateText(PluginConfig.QuitTextContent, new Vector2(0, 10f), new Vector2(105f, 10)); if (_TopText != null) { _TopText.alignment = TMPro.TextAlignmentOptions.Center; _TopText.fontSize = 6; } else { Console.WriteLine("[BeatSaberCustomExit.MainMenuUIOverload]: 'topText' was null."); } _CancelButton = _CustomViewController.CreateUIButton("CreditsButton", new Vector2(-20f, -20f), new Vector2(30f, 10f), delegate() { _CustomMenu.Dismiss(); }, "Cancel"); _ConfirmButton = _CustomViewController.CreateUIButton("CreditsButton", new Vector2(20, -20f), new Vector2(30f, 10f), delegate() { Plugin.QuitGame(); }, "Quit"); if (_CancelButton != null) { _CancelButton.ToggleWordWrapping(false); } else { Console.WriteLine("[BeatSaberCustomExit.MainMenuUIOverload]: 'buttonCancel' was null."); } if (_ConfirmButton != null) { _ConfirmButton.ToggleWordWrapping(false); } else { Console.WriteLine("[BeatSaberCustomExit.MainMenuUIOverload]: 'buttonConfirm' was null."); } } }); } else { Console.WriteLine("[BeatSaberCustomExit.MainMenuUIOverload]: '_CustomMenu' or '_CustomViewController' was null."); } }
internal void Setup() { menuButtonsViewController = BeatSaberUI.CreateViewController <MenuButtonsViewController>(); menuButtonsViewController.buttons = buttons; StopAllCoroutines(); StartCoroutine(PresentView()); /* * if (MenuPins.instance.rootObject == null) * MenuPins.instance.Setup(); * else * MenuPins.instance.Refresh();*/ }
public void ShowMuteWindow() { if (MuteButtonScreen == null) { MuteButtonScreen = CreateFloatingScreen(); MuteButtonWindow = BeatSaberUI.CreateViewController <MuteButtonWindow>(); MuteButtonWindow.ParentCoordinator = this; MuteButtonScreen.SetRootViewController(MuteButtonWindow, HMUI.ViewController.AnimationType.None); AttachEvents(); } MuteButtonScreen.gameObject.SetActive(true); MuteButtonWindow.UpdateMutebtnText(); }
protected override void DidActivate(bool firstActivation, ActivationType activationType) { if (activationType == ActivationType.AddedToHierarchy) { title = "EventPlugin"; showBackButton = true; _mainModNavigationController = BeatSaberUI.CreateViewController <GeneralNavigationController>(); ProvideInitialViewControllers(_mainModNavigationController); OpenSongsList(); } }
protected override void DidActivate(bool firstActivation, ActivationType activationType) { if (activationType != ActivationType.AddedToHierarchy) { return; } CurrentPageStatus = PageStatus.Home; var homeController = BeatSaberUI.CreateViewController <HomePageController>(); bottomController = BeatSaberUI.CreateViewController <BottomPageController>(); bottomController.flowCoordinatorOwner = homeController.flowCoordinatorOwner = this; ProvideInitialViewControllers(homeController, null, null, bottomController); }
public void Awake() { if (!_GameplayViewController) { _GameplayViewController = BeatSaberUI.CreateViewController <GameplayViewController>(); } if (!_PauseViewController) { _PauseViewController = BeatSaberUI.CreateViewController <PauseViewController>(); } //if (!_LIVViewController) // _LIVViewController = BeatSaberUI.CreateViewController<LIVViewController>(); }
private void InitConfirmationDialog() { _confirmationDialog = BeatSaberUI.CreateCustomMenu <CustomMenu>("Are you sure?"); _confirmationViewController = BeatSaberUI.CreateViewController <CustomViewController>(); RectTransform confirmContainer = new GameObject("CustomListContainer", typeof(RectTransform)).transform as RectTransform; confirmContainer.SetParent(_confirmationViewController.rectTransform, false); confirmContainer.sizeDelta = new Vector2(60f, 0f); // Title text _warningTitle = BeatSaberUI.CreateText(confirmContainer, "", new Vector2(0, 30f)); _warningTitle.fontSize = 9f; _warningTitle.color = Color.red; _warningTitle.alignment = TextAlignmentOptions.Center; _warningTitle.enableWordWrapping = false; // Warning text _warningMessage = BeatSaberUI.CreateText(confirmContainer, "", new Vector2(0, 0)); _warningMessage.rectTransform.sizeDelta = new Vector2(120, 1); _warningMessage.fontSize = 5f; _warningMessage.color = Color.white; _warningMessage.alignment = TextAlignmentOptions.Center; _warningMessage.enableWordWrapping = true; // Yes button _okButton = Instantiate(Resources.FindObjectsOfTypeAll <Button>().First(x => (x.name == "OkButton")), confirmContainer, false); _okButton.ToggleWordWrapping(false); (_okButton.transform as RectTransform).anchoredPosition = new Vector2(43f, -30f); _okButton.SetButtonText("Yes"); _okButton.onClick.RemoveAllListeners(); _okButton.onClick.AddListener(delegate() { _onConfirm?.Invoke(); _confirmationDialog.Dismiss(); confirmDialogActive = false; }); // No button _cancelButton = Instantiate(Resources.FindObjectsOfTypeAll <Button>().First(x => (x.name == "OkButton")), confirmContainer, false); _cancelButton.ToggleWordWrapping(false); (_cancelButton.transform as RectTransform).anchoredPosition = new Vector2(18f, -30f); _cancelButton.SetButtonText("No"); _cancelButton.onClick.RemoveAllListeners(); _cancelButton.onClick.AddListener(delegate() { _confirmationDialog.Dismiss(); confirmDialogActive = false; }); _confirmationDialog.SetMainViewController(_confirmationViewController, false); }
protected override void DidActivate(bool firstActivation, bool addedToHierarchy, bool screenSystemEnabling) { if (firstActivation) { this.SetField <FlowCoordinator, string>("_title", "Mod Settings"); navigationController = BeatSaberUI.CreateViewController <NavigationController>(); BSMLParser.instance.Parse(Utilities.GetResourceContent(Assembly.GetExecutingAssembly(), "BeatSaberMarkupLanguage.Views.settings-buttons.bsml"), navigationController.gameObject, this); settingsMenuListViewController = BeatSaberUI.CreateViewController <SettingsMenuListViewController>(); settingsMenuListViewController.clickedMenu += OpenMenu; SetViewControllerToNavigationController(navigationController, settingsMenuListViewController); ProvideInitialViewControllers(navigationController); } }
private static IEnumerator SetDiaryButton_Process() { yield return(new WaitForEndOfFrame()); Log.Write("SetDiaryButton Start"); var screenSystem = Resources.FindObjectsOfTypeAll <ScreenSystem>()[0]; Vector3 pos = screenSystem.rightScreen.gameObject.transform.position; Quaternion rot = screenSystem.rightScreen.gameObject.transform.rotation; floatingScreenForDiaryButton = FloatingScreen.CreateFloatingScreen(new Vector2(40, 15), false, pos + new Vector3(1.65f, -0.82f, 0f), rot); floatingScreenForDiaryButton.SetRootViewController(BeatSaberUI.CreateViewController <DiaryButtonController>(), true); }
protected override void DidActivate(bool firstActivation, ActivationType activationType) { if (activationType == ActivationType.AddedToHierarchy) { title = "Choose Your Path"; showBackButton = true; _serverModeSelectionViewController = BeatSaberUI.CreateViewController <ServerModeSelection>(); _serverModeSelectionViewController.BattleSaberButtonPressed += serverModeSelectionViewController_BattleSaberButtonPressed; _serverModeSelectionViewController.TournamentButtonPressed += serverModeSelectionViewController_TournamentButtonPressed; ProvideInitialViewControllers(_serverModeSelectionViewController); } }
protected override void DidActivate(bool firstActivation, bool addedToHierarchy, bool screenSystemEnabling) { if (addedToHierarchy) { //Set up UI SetTitle("Server Selection", ViewController.AnimationType.None); showBackButton = false; _splashScreen = BeatSaberUI.CreateViewController <SplashScreen>(); _splashScreen.StatusText = "Gathering Server List..."; ProvideInitialViewControllers(_splashScreen); } }
private async void CheckForUpdate() { var newVersion = await Update.GetLatestRelease(); if (Version.Parse(SharedConstructs.Version) < newVersion) { UnityMainThreadDispatcher.Instance().Enqueue(() => { _splashScreen = BeatSaberUI.CreateViewController <SplashScreen>(); _splashScreen.StatusText = $"你需要更新插件!当前版本: \'{SharedConstructs.Version}\', 新版本: \'{newVersion}\'\n请从主办方处获取新版本"; PresentViewController(_splashScreen); }); } }
protected override void DidActivate(bool firstActivation, ActivationType activationType) { if (firstActivation) { ui = CustomSaberUI._instance; _contentViewController = BeatSaberUI.CreateViewController <TCONT>(); _rightViewController = BeatSaberUI.CreateViewController <TRIGHT>(); title = OnContentCreated(_contentViewController); } if (activationType == FlowCoordinator.ActivationType.AddedToHierarchy) { ProvideInitialViewControllers(_contentViewController, null, _rightViewController); } }
public void OnSelect(ModListController cntrl) { Logger.log.Debug($"Selected IPAModCell {Plugin.Name} {Plugin.Version}"); if (infoView == null) { infoView = BeatSaberUI.CreateViewController <ModInfoViewController>(); infoView.Init(icon, Plugin.Name, "v" + Plugin.Version.ToString(), "<color=#BFBFBF><i>Unknown Author</i>", "<color=#A0A0A0>This mod was written for IPA Reloaded. No metadata is avaliable for this mod. " + "Please contact the mod author and ask them to port it to BSIPA to provide more information.", null); } list.flow.SetSelected(infoView, immediate: list.flow.HasSelected); }
private void _SetupDrinkWaterPanel() { if (_CustomMenu != null && _CustomViewController != null) { return; } _CustomMenu = BeatSaberUI.CreateCustomMenu <CustomMenu>("Drink some cum!"); _CustomViewController = BeatSaberUI.CreateViewController <CustomViewController>(); _CustomViewController.name = "DrinkCumPanel"; if (_CustomMenu != null && _CustomViewController != null) { _CustomMenu.SetMainViewController(_CustomViewController, false, (firstActivation, type) => { if (firstActivation && type == VRUI.VRUIViewController.ActivationType.AddedToHierarchy) { _TextContent = _CustomViewController.CreateText("", new Vector2(0, 28f)); _TextContent.alignment = TextAlignmentOptions.Center; _TextContent.fontSize = 5; _TextContent.enableWordWrapping = false; _ContinueButton = _CustomViewController.CreateUIButton("CreditsButton", new Vector2(0, -28f), new Vector2(37f, 10f), null, "I understand!"); _ContinueButton.ToggleWordWrapping(false); _ContinueButton.SetButtonTextSize(4); _ContinueButton.onClick.AddListener(delegate() { _CustomMenu.Dismiss(); Destroy(_CustomViewController.gameObject, 1); _CustomMenu = null; _CustomViewController = null; }); _RefreshTextContent(_CurrentPanelMode); if (PluginConfig.ShowGIFs) { GameObject go = new GameObject("[BeatSaberDrinkCum] PreviewGif"); _RawImage = go.AddComponent <RawImage>(); _RawImage.material = Instantiate(Resources.FindObjectsOfTypeAll <Material>().Where(m => m.name == "UINoGlow").FirstOrDefault()); go.transform.SetParent(_CustomViewController.transform, false); go.GetComponent <RectTransform>().anchoredPosition = new Vector2(0, 0); go.GetComponent <RectTransform>().sizeDelta = new Vector2(30, 30); _UniGifImage = go.AddComponent <UniGifImage>(); UniGifImageAspectController ugiac = go.AddComponent <UniGifImageAspectController>(); _UniGifImage.SetPrivateField("m_imgAspectCtrl", ugiac); StartCoroutine(_DisplayGifFromRotation()); } } }); } else { Console.WriteLine("[BeatSaberCustomExit.MainMenuUIOverload]: '_CustomMenu' or '_CustomViewController' was null."); } }
public void ShowSongsList(string lastLevelId = "") { if (_songSelectionViewController == null) { _songSelectionViewController = BeatSaberUI.CreateViewController <SongSelectionViewController>(); _songSelectionViewController.SongSelected += SongSelected; _songSelectionViewController.SortPressed += (sortMode) => { SetSongs(_lastSelectedPack, sortMode, _lastSearchRequest); }; _songSelectionViewController.SearchPressed += () => { _searchKeyboard.inputString = ""; PresentViewController(_searchKeyboard, null); }; } if (_packsViewController == null) { _packsViewController = Instantiate(Resources.FindObjectsOfTypeAll <LevelPacksViewController>().First(x => x.name != "CustomLevelPacksViewController")); _packsViewController.name = "CustomLevelPacksViewController"; if (_lastSelectedPack == null) { _lastSelectedPack = SongLoader.CustomBeatmapLevelPackCollectionSO.beatmapLevelPacks[0]; } _packsViewController.didSelectPackEvent += (sender, selectedPack) => { SetSongs(selectedPack, _lastSortMode, _lastSearchRequest); }; } _packsViewController.SetData(SongLoader.CustomBeatmapLevelPackCollectionSO, SongLoader.CustomBeatmapLevelPackCollectionSO.beatmapLevelPacks.FindIndexInArray(_lastSelectedPack)); if (_roomNavigationController.viewControllers.IndexOf(_songSelectionViewController) < 0) { PushViewControllerToNavigationController(_roomNavigationController, _songSelectionViewController, null, true); SetSongs(_lastSelectedPack, _lastSortMode, _lastSearchRequest); if (!string.IsNullOrEmpty(lastLevelId)) { _songSelectionViewController.ScrollToLevel(lastLevelId); } } if (Client.Instance.isHost) { _packsViewController.gameObject.SetActive(true); SetBottomScreenViewController(_packsViewController); } else { _packsViewController.gameObject.SetActive(false); SetBottomScreenViewController(null); } _songSelectionViewController.UpdateViewController(Client.Instance.isHost); }
private void SetupConfirmQuitPanel() { ExitPanelController = BeatSaberUI.CreateViewController <ExitPanelController>(); if (ExitPanelController != null) { ExitPanelController.didDeactivateEvent += deactivationType => { ConfirmExitDialogOpened = false; } } ; else { Logger.log.Error("[CustomExit.MainMenuUIOverload]: 'ExitPanelController' was null."); } }
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; } }
protected override void DidActivate(bool firstActivation, bool addedToHierarchy, bool screenSystemEnabling) { if (firstActivation) { this.showBackButton = true; this.SetTitle("VMC SETTING"); if (vMCSettingViewController == null) { vMCSettingViewController = BeatSaberUI.CreateViewController <VMCSettingViewController>(); } if (dammyViewController == null) { dammyViewController = BeatSaberUI.CreateViewController <TopViewController>(); } var mainCamera = Camera.main; var gameObj = Instantiate(mainCamera.gameObject); gameObj.SetActive(false); gameObj.name = "VMC Setting"; gameObj.tag = "Untagged"; while (gameObj.transform.childCount > 0) { DestroyImmediate(gameObj.transform.GetChild(0).gameObject); } DestroyImmediate(gameObj.GetComponent("AudioListener")); DestroyImmediate(gameObj.GetComponent("MeshCollider")); this.mirrorCamera = gameObj.GetComponent <Camera>(); this.mirrorCamera.clearFlags = CameraClearFlags.SolidColor; this.mirrorCamera.stereoTargetEye = StereoTargetEyeMask.None; this.mirrorCamera.transform.parent = transform; this.mirrorCamera.transform.localPosition = Vector3.zero; this.mirrorCamera.transform.localRotation = Quaternion.identity; this.mirrorCamera.transform.localScale = Vector3.one; this.mirrorCamera.transform.position = new Vector3(0f, 1.2f, 2.99f); this.mirrorCamera.transform.rotation = Quaternion.Euler(0f, 180f, 0f); this.mirrorCamera.cullingMask |= 1 << ViewTherdParson; this.mirrorCamera.cullingMask &= ~(1 << ViewFirstPerson); this.mirrorCamera.cullingMask |= 1 << AlwaysVisible; this.mirrorCamera.fieldOfView = 50f; var liv = this.mirrorCamera.GetComponent <LIV.SDK.Unity.LIV>(); if (liv) { Destroy(liv); } this.CreateRenderTextuer(); } this.StartCoroutine(this.ActiveQuad()); this.ProvideInitialViewControllers(this.dammyViewController, this.vMCSettingViewController); }
private void HandleMenuSceneLoadedFresh() { if (_platformMenu == null) { _platformMenu = BeatSaberUI.CreateCustomMenu <CustomMenu>("Platform Select"); PlatformListViewController platformListViewController = BeatSaberUI.CreateViewController <PlatformListViewController>(); platformListViewController.backButtonPressed += delegate() { _platformMenu.Dismiss(); }; _platformMenu.SetMainViewController(platformListViewController, true); platformListViewController.DidSelectRowEvent += delegate(TableView view, int row) { PlatformManager.Instance.ChangeToPlatform(row); }; } MenuButtonUI.AddButton("Platforms", delegate() { _platformMenu.Present(); }); CreateSettingsUI(); }
private void Awake() { if (!bgMenuView) { bgMenuView = BeatSaberUI.CreateViewController <BackgroundMenuViewController>(); } if (!sideConfigView) { sideConfigView = BeatSaberUI.CreateViewController <SideConfigMenuViewController>(); } if (!environmentView) { environmentView = BeatSaberUI.CreateViewController <EnvironmentMenuViewController>(); } }
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; } }
private async void CheckForUpdate() { var newVersion = await Update.GetLatestRelease(); if (Version.Parse(SharedConstructs.Version) < newVersion) { UnityMainThreadDispatcher.Instance().Enqueue(() => { _splashScreen = BeatSaberUI.CreateViewController <SplashScreen>(); _splashScreen.StatusText = $"Update required! You are on \'{SharedConstructs.Version}\', new version is \'{newVersion}\'\n" + $"Visit https://github.com/MatrikMoon/TournamentAssistant/releases to download the new version"; PresentViewController(_splashScreen); }); } }
protected void Awake() { Logger.Debug("Coodinator Awake"); if (!Settings) { Settings = BeatSaberUI.CreateViewController <SettingsController>(); } if (!About) { About = BeatSaberUI.CreateViewController <AboutController>(); } title = "Japan Saber"; }
public void Awake() { if (!bindingsViewController) { bindingsViewController = BeatSaberUI.CreateViewController <BindingsViewController>(); } if (!thresholdViewController) { thresholdViewController = BeatSaberUI.CreateViewController <ThresholdViewController>(); } if (!miscViewController) { miscViewController = BeatSaberUI.CreateViewController <MiscViewController>(); } }