예제 #1
0
 private void Initialize()
 {
     if (hasInitialized)
     {
         return;
     }
     hasInitialized     = true;
     scrollRect         = GetComponent <ScrollRect>();
     eventSystemLocator = GetComponent <MPEventSystemLocator>();
 }
예제 #2
0
        // Token: 0x060017EC RID: 6124 RVA: 0x00072344 File Offset: 0x00070544
        public static string GetGlyphString(MPEventSystemLocator eventSystemLocator, string actionName)
        {
            MPEventSystem eventSystem = eventSystemLocator.eventSystem;

            if (eventSystem)
            {
                return(Glyphs.GetGlyphString(eventSystem, actionName, AxisRange.Full));
            }
            return("UNKNOWN");
        }
        private void Start()
        {
            buttonHistory      = GetComponent <HGButtonHistory>();
            characterSelectBar = GetComponent <CharacterSelectBarController>();
            eventSystemLocator = GetComponent <MPEventSystemLocator>();
            GatherCharacterSelectBarInfo();

            survivorIconControllers = new UIElementAllocator <SurvivorIconController>(iconContainer, choiceButtonPrefab);

            StartCoroutine(StartDelayCoroutine());
        }
예제 #4
0
        protected override void Awake()
        {
            base.Awake();
            _eventSystemLocator = GetComponent <MPEventSystemLocator>();

            _label = transform.Find("Label").GetComponent <HGTextMeshProUGUI>();

            _defaultColors = CheckBoxPrefab.GetComponentInChildren <HGButton>().colors;

            _selectedColors                  = _defaultColors;
            _selectedColors.normalColor      = new Color(0.3f, 0.3f, 0.3f, 1);
            _selectedColors.highlightedColor = new Color(0.3f, 0.3f, 0.3f, 1);

            SetupTemplate();

            if (CheckBoxPrefab && !_dropDownChoicePrefab)
            {
                CreatePrefab();
            }
        }
        protected override void Awake()
        {
            base.Awake();

            _eventSystemLocator = GetComponent <MPEventSystemLocator>();

            if (Option == null)
            {
                return;
            }

            _valueHolder ??= (ITypedValueHolder <T>)Option;

            _restartRequired = Option.GetConfig().restartRequired;

            var isDisabled = Option.GetConfig().checkIfDisabled;

            if (isDisabled == null)
            {
                return;
            }

            _isDisabled = isDisabled;
        }
 private void Awake()
 {
     eventSystemLocator = GetComponent <MPEventSystemLocator>();
 }
예제 #7
0
        public ModButton(string text)
        {
            gameObject = new GameObject("Button");
            GameObject hoverOutline = new GameObject("Hover Outline");
            GameObject baseOutline  = new GameObject("Base Outline");
            GameObject textObject   = new GameObject("Text");


            rectTransform            = gameObject.AddComponent <RectTransform>();
            rectTransform.localScale = Vector3.one;

            RectTransform        hoverRect     = hoverOutline.AddComponent <RectTransform>();
            RectTransform        baseRect      = baseOutline.AddComponent <RectTransform>();
            RectTransform        textRect      = textObject.AddComponent <RectTransform>();
            MPEventSystemLocator systemLocator = gameObject.AddComponent <MPEventSystemLocator>();
            LayoutElement        layoutElement = gameObject.AddComponent <LayoutElement>();

            customButtonTransition = gameObject.AddComponent <CustomButtonTransition>();
            buttonSkinController   = gameObject.AddComponent <ButtonSkinController>();
            image = gameObject.AddComponent <Image>();
            customButtonTransition.targetGraphic = image;

            ColorBlock c = customButtonTransition.colors;

            hoverImage = hoverOutline.AddComponent <Image>();
            baseImage  = baseOutline.AddComponent <Image>();

            hoverOutline.transform.SetParent(gameObject.transform);
            baseOutline.transform.SetParent(gameObject.transform);
            textObject.transform.SetParent(gameObject.transform);

            hoverRect.anchorMin = new Vector2(0, 0);
            hoverRect.anchorMax = new Vector2(1, 1);
            hoverRect.sizeDelta = new Vector2(0, 0);

            baseRect.anchorMin = new Vector2(0, 0);
            baseRect.anchorMax = new Vector2(1, 1);
            baseRect.sizeDelta = new Vector2(0, 0);

            tmpText      = textObject.AddComponent <HGTextMeshProUGUI>();
            tmpText.text = text;

            textRect.anchorMin = new Vector2(0, 0);
            textRect.anchorMax = new Vector2(1, 1);
            textRect.sizeDelta = new Vector2(0, 0);

            image.sprite      = Generic.FindResource <Sprite>("texUICleanButton");
            hoverImage.sprite = Generic.FindResource <Sprite>("texUIHighlightBoxOutline");
            baseImage.sprite  = Generic.FindResource <Sprite>("texUIOutlineOnly");

            image.type      = Image.Type.Sliced;
            hoverImage.type = Image.Type.Sliced;
            baseImage.type  = Image.Type.Sliced;

            customButtonTransition.imageOnHover         = hoverImage;
            customButtonTransition.imageOnInteractable  = baseImage;
            customButtonTransition.scaleButtonOnHover   = false;
            customButtonTransition.showImageOnHover     = true;
            customButtonTransition.allowAllEventSystems = true;
            customButtonTransition.pointerClickOnly     = true;

            buttonSkinController.skinData = Generic.FindResource <UISkinData>("skinMenu");

            c.normalColor                 = new Color32(83, 102, 120, 255);
            c.highlightedColor            = new Color32(251, 255, 176, 187);
            c.pressedColor                = new Color32(188, 192, 113, 251);
            c.disabledColor               = new Color32(64, 51, 51, 182);
            customButtonTransition.colors = c;
        }
예제 #8
0
 public void Awake()
 {
     eventSystemLocator = GetComponent <MPEventSystemLocator>();
     buttonsWereActive  = true;
 }