コード例 #1
0
        public static string GetHeroJob(uint heroId)
        {
            string         text      = string.Empty;
            ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(heroId);
            CTextManager   instance  = Singleton <CTextManager> .GetInstance();

            if (dataByKey != null)
            {
                if (dataByKey.bMainJob > 0)
                {
                    text += CHeroInfo.GetHeroJobStr((RES_HERO_JOB)dataByKey.bMainJob);
                }
                if (dataByKey.bMinorJob > 0)
                {
                    text = string.Format("{0}/{1}", text, CHeroInfo.GetHeroJobStr((RES_HERO_JOB)dataByKey.bMinorJob));
                }
            }
            return(text);
        }
コード例 #2
0
        public void Load(CUIFormScript form)
        {
            if (form == null)
            {
                return;
            }
            GameObject widget  = form.GetWidget(32);
            GameObject widget2 = form.GetWidget(33);

            widget2.CustomSetActive(false);
            if (widget == null)
            {
                for (int i = 0; i < this.m_searchTypeNodes.Length; i++)
                {
                    this.m_searchTypeNodes[i] = null;
                }
                for (int j = 0; j < this.m_searchTypeNodes.Length; j++)
                {
                    this.m_displyTypeNodes[j] = null;
                }
                return;
            }
            this.m_searchTypeNodes[0] = widget.transform.Find("pnlContainer/Social_IWant/DropList");
            this.m_searchTypeNodes[5] = widget.transform.Find("pnlContainer/Social_Position/DropList1");
            this.m_searchTypeNodes[6] = widget.transform.Find("pnlContainer/Social_Position/DropList2");
            this.m_searchTypeNodes[1] = widget.transform.Find("pnlContainer/Social_Time/WeekDropList");
            this.m_searchTypeNodes[2] = widget.transform.Find("pnlContainer/Social_Time/DayDropList");
            this.m_searchTypeNodes[3] = widget.transform.Find("pnlContainer/Social_Speciality/DropList1");
            this.m_searchTypeNodes[4] = widget.transform.Find("pnlContainer/Social_Speciality/DropList2");
            this.m_displyTypeNodes[0] = widget.transform.Find("pnlContainer/Social_IWant/Content");
            this.m_displyTypeNodes[5] = widget.transform.Find("pnlContainer/Social_Position/Content1");
            this.m_displyTypeNodes[6] = widget.transform.Find("pnlContainer/Social_Position/Content2");
            this.m_displyTypeNodes[1] = widget.transform.Find("pnlContainer/Social_Time/WeekContent");
            this.m_displyTypeNodes[2] = widget.transform.Find("pnlContainer/Social_Time/DayContent");
            this.m_displyTypeNodes[3] = widget.transform.Find("pnlContainer/Social_Speciality/Content1");
            this.m_displyTypeNodes[4] = widget.transform.Find("pnlContainer/Social_Speciality/Content2");
            string[] array  = this.m_searchStrings[3];
            string[] array2 = new string[array.Length];
            try
            {
                for (int k = 0; k < array.Length; k++)
                {
                    array2[k] = CHeroInfo.GetHeroJobStr((RES_HERO_JOB)Convert.ToInt32(array[k]));
                }
            }
            catch (Exception var_7_20E)
            {
                Debug.LogError("social 配置表JOB错误,找jason");
            }
            CUIUtility.ClearTextComboboxContent();
            for (int l = 0; l < 6; l++)
            {
                if (!(this.m_searchTypeNodes[l] == null) && this.m_searchStrings[l] != null)
                {
                    CUIListScript component  = this.m_searchTypeNodes[l].Find("List").GetComponent <CUIListScript>();
                    GameObject    gameObject = this.m_searchTypeNodes[l].Find("Button_Down").gameObject;
                    switch (l)
                    {
                    case 3:
                    case 4:
                        CUIUtility.RegisterTextComboboxContent(gameObject, component, array2, null);
                        break;

                    case 5:
                        CUIUtility.RegisterTextComboboxContent(gameObject, component, this.m_searchStrings[l], new CUIUtility.TextComboClickCallback(this.OnLocation1Choose));
                        break;

                    default:
                        CUIUtility.RegisterTextComboboxContent(gameObject, component, this.m_searchStrings[l], null);
                        break;
                    }
                }
            }
            this.m_isInEditmode = false;
            this.UpdateUI();
        }
コード例 #3
0
        public void UpdateUI()
        {
            CUIFormScript form = Singleton <CUIManager> .instance.GetForm(CPlayerInfoSystem.sPlayerInfoFormPath);

            if (form == null)
            {
                return;
            }
            GameObject widget = form.GetWidget(32);

            if (widget == null)
            {
                return;
            }
            CPlayerProfile profile = Singleton <CPlayerInfoSystem> .instance.GetProfile();

            if (profile == null)
            {
                return;
            }
            this.CheckLoadAddressBook();
            this.SetFriendCardByWidgets(ref profile._socialCardInfo, true);
            bool      flag       = CPlayerInfoSystem.isSelf(profile.m_uuid);
            Transform transform  = widget.transform.Find("pnlContainer/Social_BtnGroupTop");
            Transform transform2 = widget.transform.Find("pnlContainer/Social_BtnGroupTopWatch");
            Transform transform3 = widget.transform.Find("pnlContainer/Social_BtnGroupBottom");
            Transform transform4 = widget.transform.Find("pnlContainer/Social_Sign");

            if (!flag)
            {
                this.m_isInEditmode = false;
                Singleton <CPlayerMentorInfoController> .GetInstance().MentorBtnUIUpdate();
            }
            for (int i = 0; i < this.m_searchTypeNodes.Length; i++)
            {
                if (this.m_searchTypeNodes[i] != null)
                {
                    this.m_searchTypeNodes[i].gameObject.CustomSetActive(this.m_isInEditmode);
                }
            }
            string[]   array      = null;
            GameObject gameObject = this.m_displyTypeNodes[0].gameObject;

            if (!this.m_isInEditmode)
            {
                string srvAddr = StringHelper.UTF8BytesToString(ref profile._socialCardInfo.szPlace);
                array = this.GetLocations(srvAddr);
                gameObject.GetComponent <Text>().set_color(this.m_colorHighlight);
                gameObject.transform.parent.Find("Title").GetComponent <Text>().set_color(this.m_colorHighlight);
            }
            else
            {
                gameObject.GetComponent <Text>().set_color(this.m_colorNormal);
                gameObject.transform.parent.Find("Title").GetComponent <Text>().set_color(this.m_colorNormal);
            }
            try
            {
                GameObject gameObject2 = this.m_displyTypeNodes[3].transform.parent.Find("img1").gameObject;
                GameObject gameObject3 = this.m_displyTypeNodes[3].transform.parent.Find("img2").gameObject;
                gameObject2.CustomSetActive(!this.m_isInEditmode);
                gameObject3.CustomSetActive(!this.m_isInEditmode);
                for (int j = 0; j < this.m_searchTypeNodes.Length; j++)
                {
                    if (this.m_displyTypeNodes[j] != null)
                    {
                        this.m_displyTypeNodes[j].gameObject.CustomSetActive(!this.m_isInEditmode);
                        Text component = this.m_displyTypeNodes[j].GetComponent <Text>();
                        if (!this.m_isInEditmode)
                        {
                            switch (j)
                            {
                            case 0:
                                component.set_text(this.GetSearchStr(j, (int)profile._socialCardInfo.dwSearchType));
                                break;

                            case 1:
                                component.set_text(this.GetSearchStr(j, (int)profile._socialCardInfo.dwDay));
                                break;

                            case 2:
                                component.set_text(this.GetSearchStr(j, (int)profile._socialCardInfo.dwHour));
                                break;

                            case 3:
                                try
                                {
                                    string searchStr = this.GetSearchStr(j, (int)profile._socialCardInfo.wHeroTypeOne);
                                    int    num       = Convert.ToInt32(searchStr);
                                    gameObject2.CustomSetActive(num != 0);
                                    if (num == 0)
                                    {
                                        component.set_text("-");
                                    }
                                    else
                                    {
                                        component.set_text(CHeroInfo.GetHeroJobStr((RES_HERO_JOB)num));
                                        CUICommonSystem.SetHeroJob(form, gameObject2, (enHeroJobType)num);
                                    }
                                    this.m_searchTypeNodes[j].transform.FindChild("List").GetComponent <CUIListScript>().SelectElement(this.GetIndexByString(j, searchStr), true);
                                }
                                catch (Exception var_18_38C)
                                {
                                    Debug.LogError("social 配置表JOB错误,找jason");
                                }
                                break;

                            case 4:
                                try
                                {
                                    string searchStr2 = this.GetSearchStr(j, (int)profile._socialCardInfo.wHeroTypeTwo);
                                    int    num2       = Convert.ToInt32(searchStr2);
                                    gameObject3.CustomSetActive(num2 != 0);
                                    if (num2 == 0)
                                    {
                                        component.set_text("-");
                                    }
                                    else
                                    {
                                        component.set_text(CHeroInfo.GetHeroJobStr((RES_HERO_JOB)num2));
                                        CUICommonSystem.SetHeroJob(form, gameObject3, (enHeroJobType)num2);
                                    }
                                    this.m_searchTypeNodes[j].transform.FindChild("List").GetComponent <CUIListScript>().SelectElement(this.GetIndexByString(j, searchStr2), true);
                                }
                                catch (Exception var_21_431)
                                {
                                    Debug.LogError("social 配置表JOB错误,找jason");
                                }
                                break;

                            case 5:
                                if (array != null && array.Length > 0)
                                {
                                    component.set_text(array[0]);
                                }
                                else
                                {
                                    component.set_text("-");
                                }
                                break;

                            case 6:
                                if (array != null && array.Length > 1)
                                {
                                    component.set_text(array[1]);
                                }
                                else
                                {
                                    component.set_text("-");
                                }
                                break;
                            }
                            if (flag && j != 3 && j != 4 && this.m_searchStrings[j] != null)
                            {
                                this.m_searchTypeNodes[j].transform.FindChild("List").GetComponent <CUIListScript>().SelectElement(this.GetIndexByString(j, component.get_text()), true);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Debug.LogError("social card setting error:" + ex);
            }
            if (transform != null)
            {
                transform.gameObject.CustomSetActive(flag && !this.m_isInEditmode);
                if (flag)
                {
                    this.SetHideCardButton();
                }
            }
            if (transform3 != null)
            {
                transform3.gameObject.CustomSetActive(flag && this.m_isInEditmode);
            }
            if (transform2 != null)
            {
                transform2.gameObject.CustomSetActive(!flag);
                if (!flag)
                {
                    GameObject gameObject4 = transform2.transform.FindChild("AddFriendBtn").gameObject;
                    bool       flag2       = Singleton <CFriendContoller> .GetInstance().model.IsContain(CFriendModel.FriendType.GameFriend, profile.m_uuid, (uint)profile.m_iLogicWorldId);

                    gameObject4.CustomSetActive(!flag2);
                    GameObject gameObject5 = transform2.transform.FindChild("AddGuildBtn").gameObject;
                    bool       bActive     = Singleton <CGuildSystem> .GetInstance().IsInNormalGuild() && !CGuildHelper.IsInSameGuild((ulong)((long)profile.m_iLogicWorldId));

                    gameObject5.CustomSetActive(bActive);
                    GameObject gameObject6 = transform2.transform.FindChild("AddMentorBtn").gameObject;
                    Singleton <CPlayerMentorInfoController> .GetInstance().MentorBtnUIUpdate();

                    gameObject6.CustomSetActive(Singleton <CPlayerMentorInfoController> .GetInstance().mentorBtnStr != null);
                    if (Singleton <CPlayerMentorInfoController> .GetInstance().mentorBtnStr != null)
                    {
                        gameObject6.transform.Find("Text").GetComponent <Text>().set_text(Singleton <CPlayerMentorInfoController> .GetInstance().mentorBtnStr);
                    }
                }
            }
            if (transform4 != null)
            {
                GameObject gameObject7   = transform4.FindChild("InputCtrl").gameObject;
                InputField signInputText = this.GetSignInputText();
                gameObject7.CustomSetActive(true);
                gameObject7.GetComponent <InputField>().set_interactable(this.m_isInEditmode);
            }
            if (!this.m_isInEditmode)
            {
                string     text           = StringHelper.UTF8BytesToString(ref profile._socialCardInfo.szDatingDeclaration);
                InputField signInputText2 = this.GetSignInputText();
                if (signInputText2)
                {
                    signInputText2.set_text(text);
                }
            }
            this.UpdateTags();
        }