예제 #1
0
        private PopupInfoStyle GetStyle(PopupStyle style)
        {
            PopupInfoStyle[] styles = m_styles;
            int num = styles.Length;

            for (int i = 0; i < num; i++)
            {
                PopupInfoStyle popupInfoStyle = styles[i];
                if (popupInfoStyle.style == style)
                {
                    return(popupInfoStyle);
                }
            }
            Log.Error($"Cannot find style {style}", 96, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\UI\\PopupInfo\\PopupInfoUI.cs");
            return(m_styles[0]);
        }
예제 #2
0
        public unsafe void Initialize(PopupInfo data)
        {
            //IL_00a2: Unknown result type (might be due to invalid IL or missing references)
            //IL_00ac: Expected O, but got Unknown
            //IL_00c0: Unknown result type (might be due to invalid IL or missing references)
            //IL_00d1: Unknown result type (might be due to invalid IL or missing references)
            m_useBlur = data.useBlur;
            m_buttonNormal.get_gameObject().SetActive(false);
            m_buttonNegative.get_gameObject().SetActive(false);
            m_buttonCancel.get_gameObject().SetActive(false);
            ApplyRawText(m_titleText, data.title);
            ApplyRawText(m_descriptionText, data.message);
            ButtonData[] buttons = data.buttons;
            if (buttons != null)
            {
                int num = buttons.Length;
                for (int i = 0; i < num; i++)
                {
                    AddButton(buttons[i]);
                }
            }
            if (data.closeOnBackgroundClick)
            {
                m_buttonBackground.get_onClick().AddListener(new UnityAction((object)this, (IntPtr)(void *) /*OpCode not supported: LdFtn*/));
            }
            PopupInfoStyle style = GetStyle(data.style);

            m_titleText.color       = style.titleColor;
            m_descriptionText.color = style.textColor;
            m_selectedIndex         = data.selectedButton - 1;
            if (m_selectedIndex < 0 || m_selectedIndex >= m_buttons.Count)
            {
                m_selectedIndex = 0;
            }
            if (m_buttons.Count > 0)
            {
                m_buttons[m_selectedIndex].Select();
            }
        }