Exemple #1
0
 public void ValidateEquip()
 {
     stEquipInfo[] equips = this._heroInfo.actorHero.handle.EquipComponent.GetEquips();
     for (int i = 0; i < 6; i++)
     {
         Image  image   = this._equipIcons[i];
         ushort equipID = equips[i].m_equipID;
         bool   flag    = false;
         if (equipID > 0)
         {
             ResEquipInBattle dataByKey = GameDataMgr.m_equipInBattleDatabin.GetDataByKey((uint)equipID);
             if (dataByKey != null)
             {
                 image.gameObject.CustomSetActive(true);
                 string prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_System_BattleEquip_Dir, dataByKey.szIcon);
                 CUIUtility.SetImageSprite(image, prefabPath, Singleton <CBattleSystem> .GetInstance().WatchFormScript, true, false, false, false);
                 flag = true;
             }
         }
         if (!flag)
         {
             image.SetSprite(string.Format((this.listCamp == COM_PLAYERCAMP.COM_PLAYERCAMP_1) ? "{0}EquipmentSpace" : "{0}EquipmentSpaceRed", CUIUtility.s_Sprite_Dynamic_Talent_Dir), Singleton <CBattleSystem> .GetInstance().WatchFormScript, true, false, false, false);
         }
     }
 }
Exemple #2
0
        private void SwitchAchievement(RES_SHOW_ACHIEVEMENT_TYPE achievement)
        {
            this.m_curAchievemnt = achievement;
            CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(PvpAchievementForm.s_formSharePVPVictoryPath);

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

            Utility.FindChild(widget.gameObject, "Title/Text").GetComponent <Text>().set_text(Singleton <CTextManager> .instance.GetText("Share_PvpAchievement_Title" + (int)achievement));
            Utility.FindChild(widget.gameObject, "Grid").CustomSetActive(this.GetAchievementCount() > 1);
            if (this.IsVictoryStreak(achievement))
            {
                CUIUtility.SetImageSprite(form.GetWidget(1).GetComponent <Image>(), PvpAchievementForm.s_imageSharePVPBadge + 0 + ".prefab", form, true, false, false, false);
            }
            else
            {
                CUIUtility.SetImageSprite(form.GetWidget(1).GetComponent <Image>(), PvpAchievementForm.s_imageSharePVPBadge + (int)achievement + ".prefab", form, true, false, false, false);
            }
            GameObject gameObject = form.GetWidget(2).gameObject;

            if (gameObject != null)
            {
                int achievementCount = this.GetAchievementCount(achievement);
                if (achievementCount != 0)
                {
                    Utility.FindChild(gameObject, "Number").GetComponent <Text>().set_text(achievementCount.ToString());
                    Utility.FindChild(gameObject, "Text").GetComponent <Text>().set_text(Singleton <CTextManager> .instance.GetText("Share_PvpAchievement_Desc_" + (int)achievement));
                }
                gameObject.CustomSetActive(achievementCount != 0);
            }
        }
Exemple #3
0
 private void SetSignalValueUI(Transform root, int signalValue)
 {
     if (root == null)
     {
         return;
     }
     for (int i = 0; i < 5; i++)
     {
         Transform transform = root.FindChild("signal" + i);
         if (i <= signalValue)
         {
             if (this.m_lastQuery.signal_status == 0)
             {
                 CUIUtility.SetImageSprite(transform.GetComponent <Image>(), GSDKsys.Signal_Value_ImgGreen, null, true, false, false, false);
             }
             else if (this.m_lastQuery.signal_status == 1)
             {
                 CUIUtility.SetImageSprite(transform.GetComponent <Image>(), GSDKsys.Signal_Value_ImgYellow, null, true, false, false, false);
             }
             else if (this.m_lastQuery.signal_status == 2)
             {
                 CUIUtility.SetImageSprite(transform.GetComponent <Image>(), GSDKsys.Signal_Value_ImgRed, null, true, false, false, false);
             }
             else
             {
                 CUIUtility.SetImageSprite(transform.GetComponent <Image>(), GSDKsys.Signal_Value_ImgBg, null, true, false, false, false);
             }
         }
         else
         {
             CUIUtility.SetImageSprite(transform.GetComponent <Image>(), GSDKsys.Signal_Value_ImgBg, null, true, false, false, false);
         }
     }
 }
Exemple #4
0
        public int OnGetDjImageCallback(GameObject imgObj, int itemType, int itemID)
        {
            if (itemType < 0 || itemID < 0 || imgObj == null)
            {
                return(-1);
            }
            CUseable cUseable = CUseableManager.CreateUseable(itemType, (uint)itemID, 0);

            if (cUseable != null)
            {
                string iconPath  = cUseable.GetIconPath();
                Image  component = imgObj.GetComponent <Image>();
                int    result    = 0;
                if (component == null)
                {
                    imgObj.AddComponent <Image2>();
                }
                else
                {
                    result = 1;
                }
                Image component2 = imgObj.GetComponent <Image>();
                if (component2)
                {
                    CUIUtility.SetImageSprite(component2, iconPath, null, true, false, false, false);
                }
                return(result);
            }
            return(-2);
        }
Exemple #5
0
 public void ShowGenderType(COM_SNSGENDER genderType)
 {
     if (this.genderImage != null)
     {
         this.genderImage.gameObject.CustomSetActive(genderType != COM_SNSGENDER.COM_SNSGENDER_NONE);
         if (genderType == COM_SNSGENDER.COM_SNSGENDER_MALE)
         {
             CUIUtility.SetImageSprite(this.genderImage.GetComponent <Image>(), string.Format("{0}icon/Ico_boy", "UGUI/Sprite/Dynamic/"), null, true, false, false);
         }
         else if (genderType == COM_SNSGENDER.COM_SNSGENDER_FEMALE)
         {
             CUIUtility.SetImageSprite(this.genderImage.GetComponent <Image>(), string.Format("{0}icon/Ico_girl", "UGUI/Sprite/Dynamic/"), null, true, false, false);
         }
     }
 }
Exemple #6
0
 public static void ShowGender(GameObject genderImage, COM_SNSGENDER genderType)
 {
     if (genderImage == null)
     {
         return;
     }
     genderImage.gameObject.CustomSetActive(genderType != 0);
     if (genderType == 1)
     {
         CUIUtility.SetImageSprite(genderImage.GetComponent <Image>(), string.Format("{0}icon/Ico_boy", "UGUI/Sprite/Dynamic/"), null, true, false, false, false);
     }
     else if (genderType == 2)
     {
         CUIUtility.SetImageSprite(genderImage.GetComponent <Image>(), string.Format("{0}icon/Ico_girl", "UGUI/Sprite/Dynamic/"), null, true, false, false, false);
     }
 }
Exemple #7
0
        public void ShowNormal(SCPKG_INVITE_JOIN_GAME_REQ info)
        {
            string          text            = CUIUtility.RemoveEmoji(StringHelper.UTF8BytesToString(ref info.stInviterInfo.szName));
            stUIEventParams stUIEventParams = default(stUIEventParams);

            stUIEventParams.tag = (int)info.bIndex;
            int num = 15;

            int.TryParse(Singleton <CTextManager> .get_instance().GetText("MessageBox_Close_Time"), ref num);
            this.form = Singleton <CUIManager> .GetInstance().OpenForm(string.Format("{0}{1}", "UGUI/Form/Common/", "Form_BeInvited.prefab"), false, false);

            GameObject gameObject = this.form.transform.Find("Panel/Panel/normal").gameObject;

            if (gameObject != null)
            {
                gameObject.CustomSetActive(true);
            }
            GameObject gameObject2 = this.form.transform.Find("Panel/Panel/refuse").gameObject;

            if (gameObject2 != null)
            {
                gameObject2.CustomSetActive(false);
            }
            this.listNode     = this.form.transform.Find("Panel/Panel/refuse/reasonPanel/DropList").gameObject;
            this.listScript   = this.listNode.transform.Find("List").GetComponent <CUIListScript>();
            this.m_inputFiled = this.form.transform.Find("Panel/Panel/refuse/reasonPanel/InputField").GetComponent <InputField>();
            this.m_sendBtn    = this.form.transform.Find("Panel/Panel/refuse/btnGroup/Button_Send").gameObject;
            this.form.transform.Find("Panel/Panel/refuse/MatchInfo").GetComponent <Text>().text = Singleton <CTextManager> .get_instance().GetText("Invite_Refuse_Title");

            if (this.form != null)
            {
                string text2 = null;
                string text3 = null;
                if (info.bInviteType == 1)
                {
                    ResDT_LevelCommonInfo pvpMapCommonInfo = CLevelCfgLogicManager.GetPvpMapCommonInfo(info.stInviteDetail.get_stRoomDetail().bMapType, info.stInviteDetail.get_stRoomDetail().dwMapId);
                    stUIEventParams.heroId      = (uint)info.stInviteDetail.get_stRoomDetail().bMapType;
                    stUIEventParams.weakGuideId = info.stInviteDetail.get_stRoomDetail().dwMapId;
                    if (pvpMapCommonInfo != null)
                    {
                        text2 = Singleton <CTextManager> .get_instance().GetText("Invite_Map_Desc", new string[]
                        {
                            ((int)(pvpMapCommonInfo.bMaxAcntNum / 2)).ToString(),
                            ((int)(pvpMapCommonInfo.bMaxAcntNum / 2)).ToString(),
                            Utility.UTF8Convert(pvpMapCommonInfo.szName)
                        });
                    }
                    text3 = Singleton <CTextManager> .GetInstance().GetText("Invite_Match_Type_4");
                }
                else if (info.bInviteType == 2)
                {
                    ResDT_LevelCommonInfo pvpMapCommonInfo2 = CLevelCfgLogicManager.GetPvpMapCommonInfo(info.stInviteDetail.get_stTeamDetail().bMapType, info.stInviteDetail.get_stTeamDetail().dwMapId);
                    stUIEventParams.heroId      = (uint)info.stInviteDetail.get_stTeamDetail().bMapType;
                    stUIEventParams.weakGuideId = info.stInviteDetail.get_stTeamDetail().dwMapId;
                    if (pvpMapCommonInfo2 != null)
                    {
                        text2 = Singleton <CTextManager> .get_instance().GetText("Invite_Map_Desc", new string[]
                        {
                            ((int)(pvpMapCommonInfo2.bMaxAcntNum / 2)).ToString(),
                            ((int)(pvpMapCommonInfo2.bMaxAcntNum / 2)).ToString(),
                            Utility.UTF8Convert(pvpMapCommonInfo2.szName)
                        });
                    }
                    if (info.stInviteDetail.get_stTeamDetail().bMapType == 3)
                    {
                        text3 = Singleton <CTextManager> .GetInstance().GetText("Invite_Match_Type_1");
                    }
                    else
                    {
                        text3 = Singleton <CTextManager> .GetInstance().GetText((info.stInviteDetail.get_stTeamDetail().bPkAI != 1) ? "Invite_Match_Type_3" : "Invite_Match_Type_2");
                    }
                }
                string text4 = Singleton <CTextManager> .get_instance().GetText("Be_Invited_Tips", new string[]
                {
                    text3,
                    text2
                });

                this.form.m_formWidgets[8].GetComponent <Text>().text = text4;
                uint   dwRelationMask = info.stInviterInfo.dwRelationMask;
                string text5;
                if ((dwRelationMask & 1u) > 0u)
                {
                    text5 = Singleton <CTextManager> .get_instance().GetText("Invite_Src_Type_1");

                    stUIEventParams.tag2 = 0;
                }
                else if ((dwRelationMask & 2u) > 0u)
                {
                    text5 = Singleton <CTextManager> .get_instance().GetText("Invite_Src_Type_4");

                    stUIEventParams.tag2 = 1;
                }
                else if ((dwRelationMask & 4u) > 0u)
                {
                    text5 = Singleton <CTextManager> .get_instance().GetText("Invite_Src_Type_5");

                    stUIEventParams.tag2 = 2;
                    CSDT_LBS_USER_INFO lBSUserInfo = Singleton <CFriendContoller> .get_instance().model.GetLBSUserInfo(info.stInviterInfo.ullUid, info.stInviterInfo.dwLogicWorldID, CFriendModel.LBSGenderType.Both);

                    if (lBSUserInfo != null)
                    {
                        stUIEventParams.tagUInt = lBSUserInfo.dwGameSvrEntity;
                    }
                }
                else
                {
                    text5 = Singleton <CTextManager> .get_instance().GetText("Invite_Src_Type_1");

                    stUIEventParams.tag2 = 3;
                }
                string text6 = string.Format(Singleton <CTextManager> .get_instance().GetText("Be_Invited_FromType"), text5);
                this.form.m_formWidgets[6].GetComponent <Text>().text = text6;
                stUIEventParams.tagStr             = string.Format("<color=#FFFFFF>{0}</color> {1} {2}", text, text4, text6);
                stUIEventParams.commonUInt64Param1 = info.stInviterInfo.ullUid;
                stUIEventParams.taskId             = info.stInviterInfo.dwLogicWorldID;
                stUIEventParams.tag3 = (int)info.bInviteType;
                if (num != 0)
                {
                    Transform transform = this.form.transform.Find("closeTimer");
                    if (transform != null)
                    {
                        this.timerScript = transform.GetComponent <CUITimerScript>();
                        if (this.timerScript != null)
                        {
                            this.timerScript.enabled = true;
                            this.timerScript.SetTotalTime((float)num);
                            this.timerScript.StartTimer();
                            this.timerScript.m_eventIDs[1]    = enUIEventID.Invite_TimeOut;
                            this.timerScript.m_eventParams[1] = stUIEventParams;
                        }
                    }
                }
                this.form.m_formWidgets[0].GetComponent <CUIEventScript>().SetUIEvent(enUIEventType.Click, enUIEventID.Invite_RefuseReason_Send, stUIEventParams);
                this.form.m_formWidgets[1].GetComponent <CUIEventScript>().SetUIEvent(enUIEventType.Click, enUIEventID.Invite_AcceptInvite, stUIEventParams);
                this.form.m_formWidgets[5].GetComponent <Text>().text = text;
                COM_SNSGENDER bGender   = info.stInviterInfo.bGender;
                Image         component = this.form.m_formWidgets[4].GetComponent <Image>();
                component.gameObject.CustomSetActive(bGender != 0);
                if (bGender == 1)
                {
                    CUIUtility.SetImageSprite(component, string.Format("{0}icon/Ico_boy.prefab", "UGUI/Sprite/Dynamic/"), null, true, false, false, false);
                }
                else if (bGender == 2)
                {
                    CUIUtility.SetImageSprite(component, string.Format("{0}icon/Ico_girl.prefab", "UGUI/Sprite/Dynamic/"), null, true, false, false, false);
                }
                CUIHttpImageScript component2 = this.form.m_formWidgets[3].GetComponent <CUIHttpImageScript>();
                component2.SetImageUrl(Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(StringHelper.UTF8BytesToString(ref info.stInviterInfo.szHeadUrl)));
                MonoSingleton <NobeSys> .GetInstance().SetHeadIconBk(this.form.m_formWidgets[2].GetComponent <Image>(), (int)info.stInviterInfo.dwHeadImgId);

                MonoSingleton <NobeSys> .GetInstance().SetHeadIconBkEffect(this.form.m_formWidgets[2].GetComponent <Image>(), (int)info.stInviterInfo.dwHeadImgId, this.form, 1f);

                this.form.m_formWidgets[7].CustomSetActive(info.stInviterInfo.bGradeOfRank > 0);
                if (info.stInviterInfo.bGradeOfRank > 0)
                {
                    CLadderView.ShowRankDetail(this.form.m_formWidgets[7], info.stInviterInfo.bGradeOfRank, 0u, 1u, false, true, false, true, true);
                }
            }
        }
Exemple #8
0
        private void SetItem(CUseable usable, GameObject uiNode, bool received, bool ready, uint vipLv)
        {
            SevenDayCheckHelper component = uiNode.GetComponent <SevenDayCheckHelper>();
            Image component2 = component.Icon.GetComponent <Image>();

            CUIUtility.SetImageSprite(component2, usable.GetIconPath(), this._form, true, false, false, false);
            component.ItemName.GetComponent <Text>().text = usable.m_name;
            if (vipLv > 0u)
            {
                component.NobeRoot.CustomSetActive(true);
                MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(component.Nobe.GetComponent <Image>(), (int)vipLv, false);
            }
            else
            {
                component.NobeRoot.CustomSetActive(false);
            }
            if (usable.m_type == 4 || usable.m_type == 7 || (usable.m_type == 2 && CItem.IsHeroExperienceCard(usable.m_baseID)) || (usable.m_type == 2 && CItem.IsSkinExChangeCoupons(usable.m_baseID)))
            {
                component.IconBg.CustomSetActive(true);
            }
            else
            {
                component.IconBg.CustomSetActive(false);
            }
            Transform transform = component.Tiyan.transform;

            if (transform != null)
            {
                if (usable.m_type == 2 && CItem.IsHeroExperienceCard(usable.m_baseID))
                {
                    transform.gameObject.CustomSetActive(true);
                    transform.GetComponent <Image>().SetSprite(CUIUtility.GetSpritePrefeb(CExperienceCardSystem.HeroExperienceCardMarkPath, false, false), false);
                }
                else if (usable.m_type == 2 && CItem.IsSkinExperienceCard(usable.m_baseID))
                {
                    transform.gameObject.CustomSetActive(true);
                    transform.GetComponent <Image>().SetSprite(CUIUtility.GetSpritePrefeb(CExperienceCardSystem.SkinExperienceCardMarkPath, false, false), false);
                }
                else
                {
                    transform.gameObject.CustomSetActive(false);
                }
            }
            Transform transform2 = component.ItemNumText.transform;

            if (transform2 != null)
            {
                Text component3 = transform2.GetComponent <Text>();
                if (usable.m_stackCount < 10000)
                {
                    component3.text = usable.m_stackCount.ToString();
                }
                else
                {
                    component3.text = usable.m_stackCount / 10000 + "万";
                }
                CUICommonSystem.AppendMultipleText(component3, usable.m_stackMulti);
                if (usable.m_stackCount <= 1)
                {
                    component3.gameObject.CustomSetActive(false);
                    component.ItemNum.CustomSetActive(false);
                }
                else
                {
                    component.ItemNum.CustomSetActive(true);
                    component.ItemNumText.CustomSetActive(true);
                }
                if (usable.m_type == 5)
                {
                    if (((CSymbolItem)usable).IsGuildSymbol())
                    {
                        component3.text = string.Empty;
                    }
                    else
                    {
                        component3.text = usable.GetSalableCount().ToString();
                    }
                }
            }
            if (received)
            {
                component.GrayMask.CustomSetActive(true);
            }
            else
            {
                component.GrayMask.CustomSetActive(false);
            }
            if (ready)
            {
                component.Effect.CustomSetActive(true);
            }
            else
            {
                component.Effect.CustomSetActive(false);
            }
            CUIEventScript  component4  = uiNode.GetComponent <CUIEventScript>();
            stUIEventParams eventParams = new stUIEventParams
            {
                iconUseable = usable
            };

            component4.SetUIEvent(enUIEventType.Down, enUIEventID.Tips_ItemInfoOpen, eventParams);
            component4.SetUIEvent(enUIEventType.HoldEnd, enUIEventID.Tips_ItemInfoClose, eventParams);
            component4.SetUIEvent(enUIEventType.Click, enUIEventID.Tips_ItemInfoClose, eventParams);
            component4.SetUIEvent(enUIEventType.DragEnd, enUIEventID.Tips_ItemInfoClose, eventParams);
        }
Exemple #9
0
    public void OnChatHeroSelectOpenMic(bool bShowTips = true)
    {
        if (this.m_OpenMicTipObj)
        {
            if (!this.m_bOpenSpeak)
            {
                if (this.m_OpenMicTipText)
                {
                    this.m_OpenMicTipText.set_text(MonoSingleton <VoiceSys> .GetInstance().m_Voice_Battle_FIrstOPenSpeak);
                }
                if (bShowTips)
                {
                    this.m_OpenMicTipObj.gameObject.CustomSetActive(true);
                }
                Singleton <CTimerManager> .instance.ResumeTimer(this.m_VoiceMictime);

                return;
            }
            if (!CFakePvPHelper.bInFakeSelect && !MonoSingleton <VoiceSys> .GetInstance().GlobalVoiceSetting)
            {
                if (this.m_OpenMicTipText)
                {
                    this.m_OpenMicTipText.set_text(MonoSingleton <VoiceSys> .GetInstance().m_Voice_Server_Not_Open_Tips);
                }
                if (bShowTips)
                {
                    this.m_OpenMicTipObj.gameObject.CustomSetActive(true);
                }
                Singleton <CTimerManager> .instance.ResumeTimer(this.m_VoiceMictime);

                return;
            }
            if (this.m_bOpenMic)
            {
                if (this.m_OpenMicTipText)
                {
                    this.m_OpenMicTipText.set_text(MonoSingleton <VoiceSys> .GetInstance().m_Voice_Battle_CloseMic);
                }
                MonoSingleton <VoiceSys> .GetInstance().CloseMic();

                if (this.m_OpenMicObj)
                {
                    CUIUtility.SetImageSprite(this.m_OpenMicObj.GetComponent <Image>(), this.no_microphone_path, null, true, false, false, false);
                }
            }
            else
            {
                if (this.m_OpenMicTipText)
                {
                    this.m_OpenMicTipText.set_text(MonoSingleton <VoiceSys> .GetInstance().m_Voice_Battle_OpenMic);
                }
                MonoSingleton <VoiceSys> .GetInstance().OpenMic();

                if (this.m_OpenMicObj)
                {
                    CUIUtility.SetImageSprite(this.m_OpenMicObj.GetComponent <Image>(), this.microphone_path, null, true, false, false, false);
                }
            }
            this.m_bOpenMic = !this.m_bOpenMic;
            MonoSingleton <VoiceSys> .GetInstance().UseMicOnUser = this.m_bOpenMic;

            if (bShowTips)
            {
                this.m_OpenMicTipObj.gameObject.CustomSetActive(true);
            }
            Singleton <CTimerManager> .instance.ResumeTimer(this.m_VoiceMictime);
        }
    }
Exemple #10
0
    public void OnChatHeroSelectOpenSpeaker(bool bAutoOpen = false)
    {
        if (this.m_OpenSpeakerTipObj)
        {
            if (!CFakePvPHelper.bInFakeSelect && !MonoSingleton <VoiceSys> .GetInstance().GlobalVoiceSetting)
            {
                if (!bAutoOpen)
                {
                    if (this.m_OpenSpeakerTipText)
                    {
                        this.m_OpenSpeakerTipText.set_text(MonoSingleton <VoiceSys> .GetInstance().m_Voice_Server_Not_Open_Tips);
                    }
                    this.m_OpenSpeakerTipObj.gameObject.CustomSetActive(true);
                    Singleton <CTimerManager> .instance.ResumeTimer(this.m_Vocetimer);
                }
                return;
            }
            if (this.m_bOpenSpeak)
            {
                if (this.m_OpenSpeakerTipText)
                {
                    this.m_OpenSpeakerTipText.set_text(MonoSingleton <VoiceSys> .GetInstance().m_Voice_Battle_CloseSpeaker);
                }
                MonoSingleton <VoiceSys> .GetInstance().ClosenSpeakers();

                MonoSingleton <VoiceSys> .GetInstance().CloseMic();

                this.m_bOpenMic = false;
                if (this.m_OpenSpeakeObj)
                {
                    CUIUtility.SetImageSprite(this.m_OpenSpeakeObj.GetComponent <Image>(), this.no_voiceIcon_path, null, true, false, false, false);
                }
                if (this.m_OpenMicObj)
                {
                    CUIUtility.SetImageSprite(this.m_OpenMicObj.GetComponent <Image>(), this.no_microphone_path, null, true, false, false, false);
                }
            }
            else
            {
                if (this.m_OpenSpeakerTipText)
                {
                    this.m_OpenSpeakerTipText.set_text(MonoSingleton <VoiceSys> .GetInstance().m_Voice_Battle_OpenSpeaker);
                }
                MonoSingleton <VoiceSys> .GetInstance().OpenSpeakers();

                if (this.m_OpenSpeakeObj)
                {
                    CUIUtility.SetImageSprite(this.m_OpenSpeakeObj.GetComponent <Image>(), this.voiceIcon_path, null, true, false, false, false);
                }
            }
            this.m_bOpenSpeak = !this.m_bOpenSpeak;
            if (this.m_bOpenSpeak)
            {
                if (!GameSettings.EnableVoice)
                {
                    GameSettings.EnableVoice = true;
                }
                this.OnChatHeroSelectOpenMic(false);
            }
            else if (GameSettings.EnableVoice)
            {
                GameSettings.EnableVoice = false;
            }
            this.m_OpenSpeakerTipObj.gameObject.CustomSetActive(true);
            Singleton <CTimerManager> .instance.ResumeTimer(this.m_Vocetimer);
        }
    }
        public void UpdateUI()
        {
            CUIFormScript form = Singleton <CUIManager> .instance.GetForm(CPlayerInfoSystem.sPlayerInfoFormPath);

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

            if (profile == null)
            {
                return;
            }
            this.m_famousMentorData = null;
            GameObject widget   = form.GetWidget(21);
            GameObject widget2  = form.GetWidget(18);
            GameObject widget3  = form.GetWidget(19);
            GameObject widget4  = form.GetWidget(20);
            GameObject widget5  = form.GetWidget(22);
            GameObject widget6  = form.GetWidget(23);
            GameObject widget7  = form.GetWidget(24);
            GameObject widget8  = form.GetWidget(25);
            GameObject widget9  = form.GetWidget(26);
            GameObject widget10 = form.GetWidget(27);
            GameObject widget11 = form.GetWidget(28);
            GameObject widget12 = form.GetWidget(29);
            GameObject widget13 = form.GetWidget(30);

            widget12.CustomSetActive(true);
            widget13.CustomSetActive(false);
            string text = Singleton <CTextManager> .GetInstance().GetText("Common_NoData");

            widget7.CustomSetActive(profile._mentorInfo.ullMasterUid == 0uL);
            widget5.CustomSetActive(profile._mentorInfo.ullMasterUid != 0uL);
            if (profile._mentorInfo.dwStudentNum != 0u)
            {
                widget3.GetComponent <Text>().set_text(profile._mentorInfo.dwStudentNum.ToString());
            }
            else
            {
                widget3.GetComponent <Text>().set_text(text);
            }
            if (profile._mentorInfo.dwFinishStudentNum != 0u)
            {
                widget4.GetComponent <Text>().set_text(profile._mentorInfo.dwFinishStudentNum.ToString());
            }
            else
            {
                widget4.GetComponent <Text>().set_text(text);
            }
            string text2 = Utility.UTF8Convert(profile._mentorInfo.szRoleName);

            if (string.IsNullOrEmpty(text2))
            {
                text2 = text;
            }
            enMentorState mentorState = CFriendContoller.GetMentorState((int)profile.GetHistoryHighestRankGrade(), null);

            if (mentorState == enMentorState.IWantMentor || mentorState == enMentorState.IHasMentor || profile._mentorInfo.dwMasterPoint == 0u)
            {
                this.SetTempNoData(form, text2);
            }
            else
            {
                widget10.CustomSetActive(true);
                widget8.CustomSetActive(true);
                widget9.CustomSetActive(true);
                GameDataMgr.famousMentorDatabin.Accept(new Action <ResFamousMentor>(this.FamousMentorInVisitor));
                if (this.m_famousMentorData == null)
                {
                    this.SetTempNoData(form, text2);
                    return;
                }
                widget11.CustomSetActive(true);
                widget8.GetComponent <Text>().set_text(this.m_famousMentorData.szTitle);
                string prefabPath = string.Format("{0}{1}.prefab", CUIUtility.s_Sprite_System_ShareUI_Dir, this.m_famousMentorData.iLevel.ToString());
                CUIUtility.SetImageSprite(widget11.GetComponent <Image>(), prefabPath, null, true, false, false, false);
                widget2.GetComponent <Text>().set_text(Singleton <CTextManager> .GetInstance().GetText("Mentor_PlayerInfo", new string[]
                {
                    this.m_famousMentorData.iLevel.ToString(),
                    this.m_famousMentorData.szTitle,
                    profile._mentorInfo.dwMasterPoint.ToString(),
                    text2
                }));
                ResFamousMentor dataByKey = GameDataMgr.famousMentorDatabin.GetDataByKey(this.m_famousMentorData.dwID + 1u);
                if (dataByKey == null)
                {
                    widget9.GetComponent <Text>().set_text(profile._mentorInfo.dwMasterPoint + string.Empty);
                }
                else
                {
                    widget9.GetComponent <Text>().set_text(profile._mentorInfo.dwMasterPoint + "/" + dataByKey.dwPoint);
                }
                uint num = 0u;
                if (this.m_famousMentorData.dwID != 1u)
                {
                    ResFamousMentor dataByKey2 = GameDataMgr.famousMentorDatabin.GetDataByKey(this.m_famousMentorData.dwID - 1u);
                    if (dataByKey2 != null)
                    {
                        num = dataByKey2.dwPoint;
                    }
                }
                if (this.m_famousMentorData.dwPoint == num)
                {
                    widget10.GetComponent <Image>().set_fillAmount(0f);
                }
                else
                {
                    widget10.GetComponent <Image>().set_fillAmount((profile._mentorInfo.dwMasterPoint - num) / (this.m_famousMentorData.dwPoint - num));
                }
            }
            this.MentorBtnUIUpdate();
            widget6.CustomSetActive(this.mentorBtnStr != null);
            if (this.mentorBtnStr != null)
            {
                widget6.transform.Find("Text").GetComponent <Text>().set_text(this.mentorBtnStr);
            }
        }
        public void UpdateUI()
        {
            CUIFormScript form = Singleton <CUIManager> .get_instance().GetForm(CPlayerInfoSystem.sPlayerInfoFormPath);

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

            if (profile == null)
            {
                return;
            }
            this.m_famousMentorData = null;
            GameObject widget   = form.GetWidget(21);
            GameObject widget2  = form.GetWidget(18);
            GameObject widget3  = form.GetWidget(19);
            GameObject widget4  = form.GetWidget(20);
            GameObject widget5  = form.GetWidget(22);
            GameObject widget6  = form.GetWidget(23);
            GameObject widget7  = form.GetWidget(24);
            GameObject widget8  = form.GetWidget(25);
            GameObject widget9  = form.GetWidget(26);
            GameObject widget10 = form.GetWidget(27);
            GameObject widget11 = form.GetWidget(28);
            GameObject widget12 = form.GetWidget(29);
            GameObject widget13 = form.GetWidget(30);

            widget12.CustomSetActive(true);
            widget13.CustomSetActive(false);
            string text = Singleton <CTextManager> .GetInstance().GetText("Common_NoData");

            widget6.CustomSetActive(!profile.isMasterData);
            widget7.CustomSetActive(profile._mentorInfo.ullMasterUid == 0uL);
            widget5.CustomSetActive(profile._mentorInfo.ullMasterUid != 0uL);
            enMentorState mentorState = CFriendContoller.GetMentorState(profile.PvpLevel(), null);

            if (!profile.isMasterData)
            {
                switch (mentorState)
                {
                case enMentorState.IWantMentor:
                case enMentorState.IHasMentor:
                    widget6.transform.Find("Text").GetComponent <Text>().text = Singleton <CTextManager> .GetInstance().GetText("Mentor_ProposeApprentice");

                    break;

                case enMentorState.IWantApprentice:
                case enMentorState.IHasApprentice:
                    widget6.transform.Find("Text").GetComponent <Text>().text = Singleton <CTextManager> .GetInstance().GetText("Mentor_ProposeMentor");

                    break;

                default:
                    widget6.CustomSetActive(false);
                    break;
                }
            }
            if (profile._mentorInfo.dwStudentNum != 0u)
            {
                widget3.GetComponent <Text>().text = profile._mentorInfo.dwStudentNum.ToString();
            }
            else
            {
                widget3.GetComponent <Text>().text = text;
            }
            if (profile._mentorInfo.dwFinishStudentNum != 0u)
            {
                widget4.GetComponent <Text>().text = profile._mentorInfo.dwFinishStudentNum.ToString();
            }
            else
            {
                widget4.GetComponent <Text>().text = text;
            }
            string text2 = Utility.UTF8Convert(profile._mentorInfo.szRoleName);

            if (string.IsNullOrEmpty(text2))
            {
                text2 = text;
            }
            if (mentorState == enMentorState.IWantMentor || mentorState == enMentorState.IHasMentor || profile._mentorInfo.dwMasterPoint == 0u)
            {
                this.SetTempNoData(form, text2);
            }
            else
            {
                widget10.CustomSetActive(true);
                widget8.CustomSetActive(true);
                widget9.CustomSetActive(true);
                GameDataMgr.famousMentorDatabin.Accept(new Action <ResFamousMentor>(this.FamousMentorInVisitor));
                if (this.m_famousMentorData == null)
                {
                    this.SetTempNoData(form, text2);
                    return;
                }
                widget11.CustomSetActive(true);
                widget8.GetComponent <Text>().text = this.m_famousMentorData.szTitle;
                string prefabPath = string.Format("{0}{1}.prefab", CUIUtility.s_Sprite_System_ShareUI_Dir, this.m_famousMentorData.iLevel.ToString());
                CUIUtility.SetImageSprite(widget11.GetComponent <Image>(), prefabPath, null, true, false, false, false);
                widget2.GetComponent <Text>().text = Singleton <CTextManager> .GetInstance().GetText("Mentor_PlayerInfo", new string[]
                {
                    this.m_famousMentorData.iLevel.ToString(),
                    this.m_famousMentorData.szTitle,
                    profile._mentorInfo.dwMasterPoint.ToString(),
                    text2
                });

                ResFamousMentor dataByKey = GameDataMgr.famousMentorDatabin.GetDataByKey(this.m_famousMentorData.dwID + 1u);
                if (dataByKey == null)
                {
                    widget9.GetComponent <Text>().text = profile._mentorInfo.dwMasterPoint + string.Empty;
                }
                else
                {
                    widget9.GetComponent <Text>().text = profile._mentorInfo.dwMasterPoint + "/" + dataByKey.dwPoint;
                }
                uint num = 0u;
                if (this.m_famousMentorData.dwID != 1u)
                {
                    ResFamousMentor dataByKey2 = GameDataMgr.famousMentorDatabin.GetDataByKey(this.m_famousMentorData.dwID - 1u);
                    if (dataByKey2 != null)
                    {
                        num = dataByKey2.dwPoint;
                    }
                }
                if (this.m_famousMentorData.dwPoint == num)
                {
                    widget10.GetComponent <Image>().fillAmount = 0f;
                }
                else
                {
                    widget10.GetComponent <Image>().fillAmount = (profile._mentorInfo.dwMasterPoint - num) / (this.m_famousMentorData.dwPoint - num);
                }
            }
            this.mentorStateStr = null;
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            enMentorState mentorState2 = CFriendContoller.GetMentorState(profile.PvpLevel(), null);
            enMentorState mentorState3 = CFriendContoller.GetMentorState(masterRoleInfo.PvpLevel, null);

            if ((mentorState2 == enMentorState.IHasApprentice || mentorState2 == enMentorState.IWantApprentice) && (mentorState3 == enMentorState.IHasMentor || mentorState3 == enMentorState.IWantMentor))
            {
                this.mentorStateStr = Singleton <CTextManager> .GetInstance().GetText("Mentor_GetMentor");

                this.m_addViewtype = 2;
                if (masterRoleInfo.m_mentorInfo != null && masterRoleInfo.m_mentorInfo.ullMasterUid != 0uL)
                {
                    this.mentorStateStr = null;
                }
            }
            else if ((mentorState3 == enMentorState.IHasApprentice || mentorState3 == enMentorState.IWantApprentice) && (mentorState2 == enMentorState.IHasMentor || mentorState2 == enMentorState.IWantMentor))
            {
                this.mentorStateStr = Singleton <CTextManager> .GetInstance().GetText("Mentor_GetApprentice");

                this.m_addViewtype = 3;
            }
            widget6.CustomSetActive(this.mentorStateStr != null);
        }
        private void SetLeftItem(CUseable usable, Transform uiNode, bool received, bool ready, uint vipLv, int elemIdx)
        {
            Transform transform = uiNode.transform.FindChild("ItemIcon");

            if (transform != null)
            {
                CUIUtility.SetImageSprite(transform.GetComponent <Image>(), usable.GetIconPath(), this._form, true, false, false, false);
            }
            Transform transform2 = uiNode.transform.FindChild("GotCeck");

            if (transform2)
            {
                if (received)
                {
                    transform2.gameObject.CustomSetActive(true);
                }
                else
                {
                    transform2.gameObject.CustomSetActive(false);
                }
            }
            Transform transform3 = uiNode.transform.FindChild("TiyanMask");

            if (transform3 != null)
            {
                if (usable.m_type == COM_ITEM_TYPE.COM_OBJTYPE_ITEMPROP && CItem.IsHeroExperienceCard(usable.m_baseID))
                {
                    transform3.gameObject.CustomSetActive(true);
                    transform3.GetComponent <Image>().SetSprite(CUIUtility.GetSpritePrefeb(CExperienceCardSystem.HeroExperienceCardMarkPath, false, false), false);
                }
                else if (usable.m_type == COM_ITEM_TYPE.COM_OBJTYPE_ITEMPROP && CItem.IsSkinExperienceCard(usable.m_baseID))
                {
                    transform3.gameObject.CustomSetActive(true);
                    transform3.GetComponent <Image>().SetSprite(CUIUtility.GetSpritePrefeb(CExperienceCardSystem.SkinExperienceCardMarkPath, false, false), false);
                }
                else
                {
                    transform3.gameObject.CustomSetActive(false);
                }
            }
            Transform transform4 = uiNode.transform.FindChild("Bg");

            if (usable.m_type == COM_ITEM_TYPE.COM_OBJTYPE_HERO || usable.m_type == COM_ITEM_TYPE.COM_OBJTYPE_HEROSKIN || (usable.m_type == COM_ITEM_TYPE.COM_OBJTYPE_ITEMPROP && CItem.IsHeroExperienceCard(usable.m_baseID)) || (usable.m_type == COM_ITEM_TYPE.COM_OBJTYPE_ITEMPROP && CItem.IsSkinExChangeCoupons(usable.m_baseID)))
            {
                if (transform4)
                {
                    transform4.gameObject.CustomSetActive(true);
                }
            }
            else if (transform4)
            {
                transform4.gameObject.CustomSetActive(false);
            }
            Transform transform5 = uiNode.transform.FindChild("Name");

            if (transform5 != null)
            {
                transform5.GetComponent <Text>().set_text(usable.m_name);
            }
            Transform transform6 = uiNode.transform.FindChild("Num");

            if (transform6)
            {
                transform6.GetComponent <Text>().set_text((elemIdx + 1).ToString());
            }
            CUIEventScript  component   = uiNode.GetComponent <CUIEventScript>();
            stUIEventParams eventParams = new stUIEventParams
            {
                iconUseable = usable
            };

            component.SetUIEvent(enUIEventType.Down, enUIEventID.Tips_ItemInfoOpen, eventParams);
            component.SetUIEvent(enUIEventType.HoldEnd, enUIEventID.Tips_ItemInfoClose, eventParams);
            component.SetUIEvent(enUIEventType.Click, enUIEventID.Tips_ItemInfoClose, eventParams);
            component.SetUIEvent(enUIEventType.DragEnd, enUIEventID.Tips_ItemInfoClose, eventParams);
        }
        private void SetItem(CUseable usable, Transform uiNode, bool received, bool ready, uint vipLv, int elemIdx)
        {
            Transform transform = uiNode.transform.FindChild("DayBg/DayText");

            if (transform != null)
            {
                transform.GetComponent <Text>().set_text(string.Format("第{0}天", Day14CheckSystem.GetDay(elemIdx)));
            }
            Transform transform2 = uiNode.transform.FindChild("ItemIcon");

            if (transform2 != null)
            {
                CUIUtility.SetImageSprite(transform2.GetComponent <Image>(), usable.GetIconPath(), this._form, true, false, false, false);
            }
            Transform transform3 = uiNode.transform.FindChild("ItemName");

            if (transform3 != null)
            {
                transform3.GetComponent <Text>().set_text(usable.m_name);
            }
            Transform transform4 = uiNode.transform.FindChild("Bg");

            if (usable.m_type == COM_ITEM_TYPE.COM_OBJTYPE_HERO || usable.m_type == COM_ITEM_TYPE.COM_OBJTYPE_HEROSKIN || (usable.m_type == COM_ITEM_TYPE.COM_OBJTYPE_ITEMPROP && CItem.IsHeroExperienceCard(usable.m_baseID)) || (usable.m_type == COM_ITEM_TYPE.COM_OBJTYPE_ITEMPROP && CItem.IsSkinExChangeCoupons(usable.m_baseID)))
            {
                if (transform4)
                {
                    transform4.gameObject.CustomSetActive(true);
                }
            }
            else if (transform4)
            {
                transform4.gameObject.CustomSetActive(false);
            }
            Transform transform5 = uiNode.transform.FindChild("TiyanMask");

            if (transform5 != null)
            {
                if (usable.m_type == COM_ITEM_TYPE.COM_OBJTYPE_ITEMPROP && CItem.IsHeroExperienceCard(usable.m_baseID))
                {
                    transform5.gameObject.CustomSetActive(true);
                    transform5.GetComponent <Image>().SetSprite(CUIUtility.GetSpritePrefeb(CExperienceCardSystem.HeroExperienceCardMarkPath, false, false), false);
                }
                else if (usable.m_type == COM_ITEM_TYPE.COM_OBJTYPE_ITEMPROP && CItem.IsSkinExperienceCard(usable.m_baseID))
                {
                    transform5.gameObject.CustomSetActive(true);
                    transform5.GetComponent <Image>().SetSprite(CUIUtility.GetSpritePrefeb(CExperienceCardSystem.SkinExperienceCardMarkPath, false, false), false);
                }
                else
                {
                    transform5.gameObject.CustomSetActive(false);
                }
            }
            Transform transform6 = uiNode.transform.FindChild("ItemNum/ItemNumText");

            if (transform6 != null)
            {
                Text component = transform6.GetComponent <Text>();
                if (usable.m_stackCount < 10000)
                {
                    component.set_text(usable.m_stackCount.ToString());
                }
                else
                {
                    component.set_text(usable.m_stackCount / 10000 + "万");
                }
                CUICommonSystem.AppendMultipleText(component, usable.m_stackMulti);
                if (usable.m_stackCount <= 1)
                {
                    component.gameObject.CustomSetActive(false);
                    uiNode.transform.FindChild("ItemNum").gameObject.CustomSetActive(false);
                }
                else
                {
                    uiNode.transform.FindChild("ItemNum").gameObject.CustomSetActive(true);
                    transform6.gameObject.CustomSetActive(true);
                }
                if (usable.m_type == COM_ITEM_TYPE.COM_OBJTYPE_ITEMSYMBOL)
                {
                    if (((CSymbolItem)usable).IsGuildSymbol())
                    {
                        component.set_text(string.Empty);
                    }
                    else
                    {
                        component.set_text(usable.GetSalableCount().ToString());
                    }
                }
            }
            Transform transform7 = uiNode.transform.FindChild("LingQuGou");

            if (transform7)
            {
                if (received)
                {
                    transform7.gameObject.CustomSetActive(true);
                }
                else
                {
                    transform7.gameObject.CustomSetActive(false);
                }
            }
            Transform transform8 = uiNode.transform.FindChild("XiYou");

            if (transform8)
            {
                if (ready)
                {
                    transform8.gameObject.CustomSetActive(true);
                    Transform transform9 = transform8.transform.FindChild("Bg/Text");
                    if (transform9 != null)
                    {
                        transform9.GetComponent <Text>().set_text(string.Format("第{0}天", Day14CheckSystem.GetDay(elemIdx)));
                    }
                }
                else
                {
                    transform8.gameObject.CustomSetActive(false);
                }
            }
            CUIEventScript  component2  = uiNode.GetComponent <CUIEventScript>();
            stUIEventParams eventParams = new stUIEventParams
            {
                iconUseable = usable
            };

            component2.SetUIEvent(enUIEventType.Down, enUIEventID.Tips_ItemInfoOpen, eventParams);
            component2.SetUIEvent(enUIEventType.HoldEnd, enUIEventID.Tips_ItemInfoClose, eventParams);
            component2.SetUIEvent(enUIEventType.Click, enUIEventID.Tips_ItemInfoClose, eventParams);
            component2.SetUIEvent(enUIEventType.DragEnd, enUIEventID.Tips_ItemInfoClose, eventParams);
        }