private void CreateText() { hudText = BeatSaberUI.CreateText(_mainMenuRectTransform, "Matchmaking...", new Vector2(55.5f, 33f)); hudText.fontSize = 5f; hudText.lineSpacing = -52; hudText.gameObject.SetActive(false); }
private void CreateButton() { Button[] mainButtons = Resources.FindObjectsOfTypeAll <RectTransform>() .First(x => x.name == "MainButtons" && x.parent.name == "MainMenuViewController") .GetComponentsInChildren <Button>(); foreach (var item in mainButtons) { (item.transform as RectTransform).sizeDelta = new Vector2(35f, 30f); } _multiplayerButton = Instantiate( Resources.FindObjectsOfTypeAll <Button>() .Last(x => (x.name == "SoloFreePlayButton")), _mainMenuRectTransform, false); _multiplayerButton.name = "BS99Button"; Destroy(_multiplayerButton.GetComponentInChildren <LocalizedTextMeshProUGUI>()); Destroy(_multiplayerButton.GetComponentInChildren <HoverHint>()); _multiplayerButton.transform.SetParent(mainButtons.First(x => x.name == "SoloFreePlayButton").transform.parent); _multiplayerButton.transform.SetAsLastSibling(); BeatSaberUI.SetButtonText(_multiplayerButton, ButtonText); _multiplayerButton.SetButtonIcon(Sprites.logoIcon); _multiplayerButton.interactable = false; _multiplayerButton.onClick = new Button.ButtonClickedEvent(); _multiplayerButton.onClick.AddListener(delegate() { BattleRoyaleClicked(); }); }
public void Awake() { if (_scoreTrackerSettingsView == null) { _scoreTrackerSettingsView = BeatSaberUI.CreateViewController <ScoreTrackerSettingsViewController>(); _scoreTrackerNavigationcontroller = BeatSaberUI.CreateViewController <NavigationController>(); } }
private void ClientOnClientStatusChanged(object sender, ClientStatus e) { switch (e) { case ClientStatus.Waiting: hudText.text = Client.Status == ClientStatus.Playing ? $"Placed: {SessionState.PlayersLeft}" : $""; if (Client.Status == ClientStatus.Playing) { if (playersLeftText != null) { playersLeftText.Delete(); } if (itemText != null) { itemText.Delete(); } playersLeftText = itemText = null; } playersLeftText?.gameObject?.SetActive(false); SetCurrentItem(null); BeatSaberUI.SetButtonText(_multiplayerButton, ButtonText); _multiplayerButton.interactable = true; break; case ClientStatus.Connecting: _multiplayerButton.interactable = false; hudText.gameObject.SetActive(true); hudText.text = "Connecting..."; break; case ClientStatus.Matchmaking: BeatSaberUI.SetButtonText(_multiplayerButton, "CANCEL"); _multiplayerButton.interactable = true; hudText.text = "Matchmaking..."; hudText.gameObject.SetActive(true); SetWinnerText(false); break; case ClientStatus.Starting: hudText.text = "Starting..."; BeatSaberUI.SetButtonText(_multiplayerButton, ButtonText); _multiplayerButton.interactable = false; hudText.gameObject.SetActive(true); break; case ClientStatus.Playing: _log_history = new string[3]; hudText.text = ""; break; } }