Пример #1
0
        private void UpdateParam(int Idx)
        {
            HelpWindow componentInParent = (HelpWindow)((Component)((Component)this).get_transform()).GetComponentInParent <HelpWindow>();

            if (UnityEngine.Object.op_Equality((UnityEngine.Object)componentInParent, (UnityEngine.Object)null))
            {
                return;
            }
            int       num1  = Idx;
            Transform child = ((Component)this).get_transform().FindChild("Label");

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)child, (UnityEngine.Object)null))
            {
                LText component = (LText)((Component)child).GetComponent <LText>();
                if (componentInParent.MiddleHelp)
                {
                    string a = LocalizedText.Get("help.MENU_CATE_NAME_" + (object)(componentInParent.SelectMiddleID + 1));
                    string s = LocalizedText.Get("help.MENU_NUM");
                    if (string.IsNullOrEmpty(s))
                    {
                        return;
                    }
                    int num2 = int.Parse(s);
                    int num3 = 0;
                    for (int index = 0; index < num2; ++index)
                    {
                        string b = LocalizedText.Get("help.MENU_CATE_" + (object)(index + 1));
                        if (string.Equals(a, b))
                        {
                            num3 = index;
                            break;
                        }
                    }
                    component.set_text(LocalizedText.Get("help.MENU_" + (object)(num3 + Idx + 1)));
                    num1 = num3 + Idx;
                }
                else
                {
                    component.set_text(LocalizedText.Get("help.MENU_CATE_NAME_" + (object)(Idx + 1)));
                }
            }
            Button component1 = (Button)((Component)((Component)this).get_transform()).GetComponent <Button>();
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: method pointer
            Func <int, UnityAction> func = (Func <int, UnityAction>)(n => new UnityAction((object)new HelpButtonItem.\u003CUpdateParam\u003Ec__AnonStorey34D()
            {
                n = n,
                \u003C\u003Ef__this = this
            }, __methodptr(\u003C\u003Em__34B)));

            ((UnityEventBase)component1.get_onClick()).RemoveAllListeners();
            ((UnityEvent)component1.get_onClick()).AddListener(func(num1));
        }
Пример #2
0
        public void AddButton(string btn_text, bool is_close, EmbedSystemMessageEx.SystemMessageEvent callback)
        {
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            EmbedSystemMessageEx.\u003CAddButton\u003Ec__AnonStorey32B buttonCAnonStorey32B = new EmbedSystemMessageEx.\u003CAddButton\u003Ec__AnonStorey32B();
            // ISSUE: reference to a compiler-generated field
            buttonCAnonStorey32B.callback = callback;
            if (Object.op_Equality((Object)this.ButtonTemplate, (Object)null) || Object.op_Equality((Object)this.ButtonBase, (Object)null))
            {
                return;
            }
            GameObject gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.ButtonTemplate);

            gameObject.SetActive(true);
            LText componentInChildren1 = (LText)gameObject.GetComponentInChildren <LText>();

            if (Object.op_Inequality((Object)componentInChildren1, (Object)null))
            {
                componentInChildren1.set_text(btn_text);
            }
            Button componentInChildren2 = (Button)gameObject.GetComponentInChildren <Button>();

            if (Object.op_Inequality((Object)componentInChildren2, (Object)null))
            {
                // ISSUE: method pointer
                ((UnityEvent)componentInChildren2.get_onClick()).AddListener(new UnityAction((object)buttonCAnonStorey32B, __methodptr(\u003C\u003Em__2F2)));
            }
            ButtonEvent componentInChildren3 = (ButtonEvent)gameObject.GetComponentInChildren <ButtonEvent>();

            if (Object.op_Inequality((Object)componentInChildren3, (Object)null))
            {
                ((Behaviour)componentInChildren3).set_enabled(is_close);
            }
            gameObject.get_transform().SetParent(this.ButtonBase.get_transform(), false);
        }
Пример #3
0
 private bool UpdateButtonText(string update_text = "")
 {
     if (!string.IsNullOrEmpty(update_text))
     {
         Transform transform = this.GachaBtn.get_transform().Find("text");
         if (Object.op_Inequality((Object)transform, (Object)null))
         {
             LText component = (LText)((Component)transform).GetComponent <LText>();
             if (Object.op_Inequality((Object)component, (Object)null))
             {
                 component.set_text(update_text);
                 return(true);
             }
         }
     }
     return(false);
 }
Пример #4
0
        private void SetParam(GameObject item, int rank, MultiRanking param)
        {
            Transform child1 = item.get_transform().FindChild("body");

            if (!Object.op_Inequality((Object)child1, (Object)null))
            {
                return;
            }
            Transform child2 = child1.FindChild(nameof(rank));

            if (Object.op_Inequality((Object)child2, (Object)null))
            {
                Transform child3 = child2.FindChild("rank_txt");
                if (Object.op_Inequality((Object)child3, (Object)null))
                {
                    LText component = (LText)((Component)child3).GetComponent <LText>();
                    if (Object.op_Inequality((Object)component, (Object)null))
                    {
                        string str = string.Format(LocalizedText.Get("sys.MULTI_CLEAR_RANK"), (object)(rank + 1).ToString());
                        component.set_text(str);
                    }
                }
            }
            UnitParam unitParam = MonoSingleton <GameManager> .Instance.GetUnitParam(param.unit);

            JobParam jobParam = MonoSingleton <GameManager> .Instance.GetJobParam(param.job);

            Transform child4 = child1.FindChild("name");

            if (!Object.op_Inequality((Object)child4, (Object)null))
            {
                return;
            }
            LText component1 = (LText)((Component)child4).GetComponent <LText>();

            if (!Object.op_Inequality((Object)component1, (Object)null))
            {
                return;
            }
            string str1 = string.Format(LocalizedText.Get("sys.MULTI_CLEAR_UNIT_NAME"), (object)unitParam.name, (object)jobParam.name);

            component1.set_text(str1);
        }
Пример #5
0
        private void SetupButtons()
        {
            if (this.template_message_buttons == null)
            {
                return;
            }
            int num1   = this.current_page * this.ONE_PAGE_ITEM_MAX;
            int num2   = num1 + (this.ONE_PAGE_ITEM_MAX - 1);
            int index1 = 0;

            for (int index2 = 0; index2 < this.template_message_buttons.Length; ++index2)
            {
                ((UnityEventBase)this.template_message_buttons[index2].get_onClick()).RemoveAllListeners();
                ((Component)this.template_message_buttons[index2]).get_gameObject().SetActive(false);
            }
            for (int index2 = num1; index2 <= num2; ++index2)
            {
                // ISSUE: object of a compiler-generated type is created
                // ISSUE: variable of a compiler-generated type
                ChatTemplateMessage.\u003CSetupButtons\u003Ec__AnonStorey315 buttonsCAnonStorey315 = new ChatTemplateMessage.\u003CSetupButtons\u003Ec__AnonStorey315();
                // ISSUE: reference to a compiler-generated field
                buttonsCAnonStorey315.\u003C\u003Ef__this = this;
                if (this.prefs_data.messages.Length <= index2)
                {
                    break;
                }
                if (this.prefs_data.messages[index2] != null && !Object.op_Equality((Object)this.template_message_buttons[index1], (Object)null))
                {
                    ((Component)this.template_message_buttons[index1]).get_gameObject().SetActive(true);
                    LText componentInChildren = (LText)((Component)this.template_message_buttons[index1]).GetComponentInChildren <LText>();
                    if (Object.op_Inequality((Object)componentInChildren, (Object)null))
                    {
                        componentInChildren.set_text(this.prefs_data.messages[index2]);
                    }
                    // ISSUE: reference to a compiler-generated field
                    buttonsCAnonStorey315.msg_index = index2;
                    // ISSUE: method pointer
                    ((UnityEvent)this.template_message_buttons[index1].get_onClick()).AddListener(new UnityAction((object)buttonsCAnonStorey315, __methodptr(\u003C\u003Em__2B9)));
                    ++index1;
                }
            }
        }
Пример #6
0
        public void UpdateHelpList(bool flag, int Idx)
        {
            GameObject gameObject = GameObject.Find("View");

            if (Object.op_Equality((Object)gameObject, (Object)null))
            {
                return;
            }
            ScrollListController component1 = (ScrollListController)gameObject.GetComponent <ScrollListController>();

            this.bMiddleHelp  = flag;
            this.SelMiddleIdx = Idx;
            component1.UpdateList();
            if (this.MiddleHelp)
            {
                ((Component)this.MiddleBackButton).get_gameObject().SetActive(true);
            }
            Transform child = ((Component)this).get_transform().FindChild("window/header");

            if (!Object.op_Inequality((Object)child, (Object)null))
            {
                return;
            }
            LText component2 = (LText)((Component)child.FindChild("Text")).GetComponent <LText>();

            if (!Object.op_Inequality((Object)component2, (Object)null))
            {
                return;
            }
            string str = LocalizedText.Get("help.TITLE");

            if (this.MiddleHelp)
            {
                str = str + "-" + LocalizedText.Get("help.MENU_CATE_NAME_" + (object)(Idx + 1));
            }
            if (string.IsNullOrEmpty(str))
            {
                return;
            }
            component2.set_text(str);
        }
Пример #7
0
        public void CreateMainWindow(int MenuID)
        {
            string s = LocalizedText.Get("help.MENU_NUM");

            if (s == null)
            {
                return;
            }
            int num1 = int.Parse(s);

            if (MenuID < 0 || MenuID >= num1 || Object.op_Equality((Object)this.m_HelpMain, (Object)null))
            {
                return;
            }
            int       num2   = MenuID + 1;
            float     num3   = 0.0f;
            Transform child1 = this.m_HelpMain.get_transform().FindChild("header");

            if (Object.op_Inequality((Object)child1, (Object)null))
            {
                LText  component = (LText)((Component)child1.FindChild("Text")).GetComponent <LText>();
                string str       = LocalizedText.Get("help.MAIN_TITLE_" + (object)num2);
                if (string.IsNullOrEmpty(str) || str == "MAIN_TITLE_" + (object)num2)
                {
                    ((Component)child1).get_gameObject().SetActive(false);
                }
                else
                {
                    component.set_text(str);
                }
            }
            Transform image1 = this.m_HelpMain.get_transform().Find("page/template/contents/viewport/layout/contents_image");

            if (this.SetImageData(image1, "Image", "Helps/help_image_" + (object)num2))
            {
                LayoutElement component = (LayoutElement)((Component)image1).GetComponent <LayoutElement>();
                num3 += component.get_minHeight();
            }
            bool      flag   = false;
            Transform image2 = this.m_HelpMain.get_transform().Find("page/template/contents/viewport/layout/contents_image_small");

            if (flag | this.SetImageData(image2, "Image0", "Helps/help_image_" + (object)num2 + "_0") | this.SetImageData(image2, "Image1", "Helps/help_image_" + (object)num2 + "_1"))
            {
                ((Component)image2).get_gameObject().SetActive(true);
                LayoutElement component = (LayoutElement)((Component)image2).GetComponent <LayoutElement>();
                num3 += component.get_minHeight();
            }
            Transform child2 = this.m_HelpMain.get_transform().FindChild("page/template/contents/viewport/layout/contents_text");

            if (Object.op_Inequality((Object)child2, (Object)null))
            {
                Transform     child3     = child2.FindChild("Text");
                LText         component1 = (LText)((Component)child3).GetComponent <LText>();
                string        str1       = LocalizedText.Get("help.MAIN_TEXT_" + (object)num2);
                string        str2       = "help.MAIN_TEXT_" + (object)num2;
                LayoutElement component2 = (LayoutElement)((Component)child2).GetComponent <LayoutElement>();
                if (string.IsNullOrEmpty(str1) || str1 == "MAIN_TEXT_" + (object)num2)
                {
                    ((Component)child2).get_gameObject().SetActive(false);
                }
                else
                {
                    component1.set_text(str2);
                    ((Component)child2).get_gameObject().SetActive(true);
                    num3 += component2.get_preferredHeight();
                    HelpWindow.HELP_ID helpId           = (HelpWindow.HELP_ID)num2;
                    RectTransform      component3       = (RectTransform)((Component)child3).GetComponent <RectTransform>();
                    Vector2            anchoredPosition = component3.get_anchoredPosition();
                    switch (helpId)
                    {
                    case HelpWindow.HELP_ID.ACTION:
                        anchoredPosition.y = (__Null)150.0;
                        component3.set_anchoredPosition(anchoredPosition);
                        num3 -= component2.get_preferredHeight();
                        break;

                    case HelpWindow.HELP_ID.REACTION:
                    case HelpWindow.HELP_ID.SUPPORT:
                        anchoredPosition.y = (__Null)250.0;
                        component3.set_anchoredPosition(anchoredPosition);
                        num3 = component2.get_preferredHeight();
                        break;

                    case HelpWindow.HELP_ID.SHOP:
                        anchoredPosition.y = (__Null)200.0;
                        component3.set_anchoredPosition(anchoredPosition);
                        num3 -= component2.get_preferredHeight();
                        break;

                    default:
                        anchoredPosition.y = (__Null)0.0;
                        component3.set_anchoredPosition(anchoredPosition);
                        break;
                    }
                }
            }
            RectTransform child4            = this.m_HelpMain.get_transform().FindChild("page/template/contents/viewport/layout") as RectTransform;
            Vector2       anchoredPosition1 = child4.get_anchoredPosition();
            Vector2       sizeDelta         = child4.get_sizeDelta();

            sizeDelta.y = (__Null)(double)num3;
            child4.set_sizeDelta(sizeDelta);
            anchoredPosition1.y = (__Null)0.0;
            child4.set_anchoredPosition(anchoredPosition1);
            this.m_HelpMain.SetActive(true);
            if (Object.op_Implicit((Object)this.MiddleBackButton))
            {
                ((Component)this.MiddleBackButton).get_gameObject().SetActive(false);
            }
            ((Component)this.BackButton).get_gameObject().SetActive(true);
        }