/// <summary>
        /// On back button pressed
        /// </summary>
        /// <param name="p_TopViewController">Current top view controller</param>
        /// <returns>True if the event is catched, false if we should dismiss the flow coordinator</returns>
        protected override sealed bool OnBackButtonPressed(HMUI.ViewController p_TopViewController)
        {
            if (topViewController != m_MainView)
            {
                SwitchToMainView();
                return(true);
            }

            return(false);
        }
        public static Button CreateIconButton(this HMUI.ViewController parent, string name, string buttonTemplate, Vector2 anchoredPosition, Vector2 sizeDelta, UnityAction onClick, Sprite icon, string hint)
        {
            Button btn = BeatSaberUI.CreateIconButton(name, parent.rectTransform, buttonTemplate, anchoredPosition, sizeDelta, onClick, icon, hint);

            return(btn);
        }
        public static Button CreateUIButton(this HMUI.ViewController parent, string name, string buttonTemplate, Vector2 anchoredPosition, Vector2 sizeDelta, UnityAction onClick = null, string buttonText = "BUTTON")
        {
            Button btn = BeatSaberUI.CreateUIButton(name, parent.rectTransform, buttonTemplate, anchoredPosition, sizeDelta, onClick, buttonText);

            return(btn);
        }
Exemple #4
0
        public static Button CreateUIButton(this HMUI.ViewController parent, string buttonTemplate, UnityAction onClick = null, string buttonText = "BUTTON", Sprite icon = null)
        {
            Button btn = BeatSaberUI.CreateUIButton(parent.rectTransform, buttonTemplate, onClick, buttonText, icon);

            return(btn);
        }
Exemple #5
0
        public static Button CreateBackButton(this HMUI.ViewController parent)
        {
            Button btn = BeatSaberUI.CreateBackButton(parent.rectTransform);

            return(btn);
        }
Exemple #6
0
        public static Button CreateUIButton(this HMUI.ViewController parent, string buttonTemplate)
        {
            Button btn = BeatSaberUI.CreateUIButton(parent.rectTransform, buttonTemplate);

            return(btn);
        }
Exemple #7
0
        public static TextMeshProUGUI CreateText(this HMUI.ViewController parent, string text, Vector2 anchoredPosition)
        {
            TextMeshProUGUI textMesh = BeatSaberUI.CreateText(parent.rectTransform, text, anchoredPosition);

            return(textMesh);
        }
Exemple #8
0
        /*public static GameObject CreateLoadingSpinner(this HMUI.ViewController parent)
         * {
         *  GameObject loadingSpinner = BeatSaberUI.CreateLoadingSpinner(parent.rectTransform);
         *  return loadingSpinner;
         * }*/

        public static TextMeshProUGUI CreateText(this HMUI.ViewController parent, string text, Vector2 anchoredPosition, Vector2 sizeDelta)
        {
            var textMesh = PlaylistUI.CreateText(parent.rectTransform, text, anchoredPosition, sizeDelta);

            return(textMesh);
        }
Exemple #9
0
        public static Button CreateUIButton(this HMUI.ViewController parent, string buttonTemplate, Vector2 anchoredPosition, UnityAction onClick = null, string buttonText = "BUTTON", Sprite icon = null)
        {
            var btn = PlaylistUI.CreateUIButton(parent.rectTransform, buttonTemplate, anchoredPosition, onClick, buttonText, icon);

            return(btn);
        }
Exemple #10
0
        //#region Button Extensions
        //public static void SetButtonText(this Button _button, string _text)
        //{
        //    Polyglot.LocalizedTextMeshProUGUI localizer = _button.GetComponentInChildren<Polyglot.LocalizedTextMeshProUGUI>();
        //    if (localizer != null)
        //        GameObject.Destroy(localizer);
        //    TextMeshProUGUI tmpUgui = _button.GetComponentInChildren<TextMeshProUGUI>();
        //    if (tmpUgui != null)
        //        tmpUgui.text = _text;
        //}

        //public static void SetButtonTextSize(this Button _button, float _fontSize)
        //{
        //    if (_button.GetComponentInChildren<TextMeshProUGUI>() != null) {
        //        _button.GetComponentInChildren<TextMeshProUGUI>().fontSize = _fontSize;
        //    }
        //}

        //public static void ToggleWordWrapping(this Button _button, bool enableWordWrapping)
        //{
        //    if (_button.GetComponentInChildren<TextMeshProUGUI>() != null) {
        //        _button.GetComponentInChildren<TextMeshProUGUI>().enableWordWrapping = enableWordWrapping;
        //    }
        //}

        //public static void SetButtonIcon(this Button _button, Sprite _icon)
        //{
        //    if (_button.GetComponentsInChildren<Image>().Count() > 1)
        //        _button.GetComponentsInChildren<Image>().First(x => x.name == "Icon").sprite = _icon;
        //}

        //public static void SetButtonBackground(this Button _button, Sprite _background)
        //{
        //    if (_button.GetComponentsInChildren<Image>().Count() > 0)
        //        _button.GetComponentsInChildren<Image>()[0].sprite = _background;
        //}
        //#endregion

        #region ViewController Extensions

        public static Button CreateUIButton(this HMUI.ViewController parent, string buttonTemplate)
        {
            var btn = PlaylistUI.CreateUIButton(parent.rectTransform, buttonTemplate);

            return(btn);
        }