コード例 #1
0
        private void On_Guild_Guild_Select(CUIEvent uiEvent)
        {
            int       selectedIndex    = uiEvent.m_srcWidget.GetComponent <CUIListScript>().GetSelectedIndex();
            GuildInfo guildInfoByIndex = this.m_Model.GetGuildInfoByIndex(selectedIndex);

            if (guildInfoByIndex != null)
            {
                CUIHttpImageScript component = this.m_form.GetWidget(34).GetComponent <CUIHttpImageScript>();
                component.SetImageUrl(CGuildHelper.GetHeadUrl(guildInfoByIndex.chairman.stBriefInfo.szHeadUrl));
                MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(this.m_form.GetWidget(41).GetComponent <Image>(), CGuildHelper.GetNobeLevel(guildInfoByIndex.chairman.stBriefInfo.uulUid, guildInfoByIndex.chairman.stBriefInfo.stVip.level), false);

                MonoSingleton <NobeSys> .GetInstance().SetHeadIconBk(this.m_form.GetWidget(40).GetComponent <Image>(), CGuildHelper.GetNobeHeadIconId(guildInfoByIndex.chairman.stBriefInfo.uulUid, guildInfoByIndex.chairman.stBriefInfo.stVip.headIconId));

                this.m_form.GetWidget(10).GetComponent <Text>().text = guildInfoByIndex.briefInfo.sBulletin;
                this.m_form.GetWidget(11).GetComponent <Text>().text = guildInfoByIndex.chairman.stBriefInfo.sName;
                this.m_form.GetWidget(39).GetComponent <Text>().text = Singleton <CTextManager> .GetInstance().GetText("Common_Level_Format", new string[]
                {
                    guildInfoByIndex.chairman.stBriefInfo.dwLevel.ToString()
                });

                Image component2 = this.m_form.GetWidget(46).GetComponent <Image>();
                Text  component3 = this.m_form.GetWidget(47).GetComponent <Text>();
                Text  component4 = this.m_form.GetWidget(48).GetComponent <Text>();
                component2.SetSprite(CGuildHelper.GetGradeIconPathByRankpointScore(guildInfoByIndex.RankInfo.totalRankPoint), this.m_form, true, false, false, false);
                component3.text = CGuildHelper.GetGradeName(guildInfoByIndex.RankInfo.totalRankPoint);
                component4.text = Singleton <CTextManager> .GetInstance().GetText("Guild_Profit_Desc", new string[]
                {
                    CGuildHelper.GetCoinProfitPercentage((int)guildInfoByIndex.briefInfo.bLevel).ToString()
                });
            }
        }
コード例 #2
0
ファイル: BannerWidget.cs プロジェクト: isoundy000/wzry-1
 public override void Validate()
 {
     this._urlaList = UrlAction.ParseFromText(base.view.activity.Content, null);
     if (this._urlaList.Count > 0)
     {
         this._stepList.SetElementAmount(this._urlaList.Count);
         for (int i = 0; i < this._urlaList.Count; i++)
         {
             UrlAction            action   = this._urlaList[i];
             CUIListElementScript elemenet = this._stepList.GetElemenet(i);
             if (null != elemenet)
             {
                 CUIHttpImageScript component = elemenet.GetComponent <CUIHttpImageScript>();
                 if (null != component)
                 {
                     component.SetImageUrl(action.target);
                 }
             }
         }
         this._curStepIndex = 0;
         this._leftToRight  = true;
         this._stepList.MoveElementInScrollArea(this._curStepIndex, true);
         this._lastScrollTime = Time.time;
         this.updateOverTime();
     }
 }
コード例 #3
0
 public static void SetHttpImage(CUIHttpImageScript HttpImage, string url)
 {
     if (((HttpImage != null) && !CSysDynamicBlock.bFriendBlocked) && (!string.IsNullOrEmpty(url) && HttpImage.gameObject.activeSelf))
     {
         HttpImage.SetImageUrl(Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(url));
     }
 }
コード例 #4
0
ファイル: RankingView.cs プロジェクト: TonyDongGuaPi/joework
        public static void SetUrlHeadIcon(GameObject headIcon, string serverUrl)
        {
            if (CSysDynamicBlock.bSocialBlocked)
            {
                return;
            }
            CUIHttpImageScript component = headIcon.GetComponent <CUIHttpImageScript>();

            component.SetImageUrl(serverUrl);
        }
コード例 #5
0
 public static void SetObservers(GameObject root, int maxNum, ListView <MemberInfo> memberList, MemberInfo masterMember)
 {
     if (maxNum > 0)
     {
         root.CustomSetActive(true);
         CUIListScript componetInChild = Utility.GetComponetInChild <CUIListScript>(root, "SlotList");
         componetInChild.SetElementAmount(maxNum);
         MemberInfo[] array = new MemberInfo[maxNum];
         for (int i = 0; i < memberList.get_Count(); i++)
         {
             MemberInfo memberInfo = memberList.get_Item(i);
             if (memberInfo != null && memberInfo.dwPosOfCamp < (uint)maxNum)
             {
                 array[(int)((UIntPtr)memberInfo.dwPosOfCamp)] = memberInfo;
             }
         }
         int num = 0;
         for (int j = 0; j < maxNum; j++)
         {
             MemberInfo         memberInfo2      = array[j];
             GameObject         gameObject       = componetInChild.GetElemenet(j).gameObject;
             bool               flag             = null != memberInfo2;
             CUIHttpImageScript componetInChild2 = Utility.GetComponetInChild <CUIHttpImageScript>(gameObject, "Icon");
             Text               componetInChild3 = Utility.GetComponetInChild <Text>(gameObject, "Name");
             CUIEventScript     componetInChild4 = Utility.GetComponetInChild <CUIEventScript>(gameObject, "SitDown");
             CUIEventScript     componetInChild5 = Utility.GetComponetInChild <CUIEventScript>(gameObject, "KickOut");
             componetInChild2.gameObject.CustomSetActive(flag);
             componetInChild3.gameObject.CustomSetActive(flag);
             componetInChild4.gameObject.CustomSetActive(!flag);
             componetInChild5.gameObject.CustomSetActive(flag && memberInfo2 != masterMember && Singleton <CRoomSystem> .GetInstance().IsSelfRoomOwner);
             if (flag)
             {
                 componetInChild3.text = memberInfo2.MemberName;
                 componetInChild2.SetImageUrl(Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(memberInfo2.MemberHeadUrl));
                 num++;
             }
             if (componetInChild4.gameObject.activeSelf)
             {
                 componetInChild4.m_onClickEventID         = enUIEventID.Room_Observe_Seat;
                 componetInChild4.m_onClickEventParams.tag = j;
             }
             if (componetInChild5.gameObject.activeSelf)
             {
                 componetInChild5.m_onClickEventID         = enUIEventID.Room_Observe_Kick;
                 componetInChild5.m_onClickEventParams.tag = j;
             }
         }
         Utility.GetComponetInChild <Text>(root, "PersonCount").text = num + "/" + maxNum;
     }
     else
     {
         root.CustomSetActive(false);
     }
 }
コード例 #6
0
ファイル: CRoomObserve.cs プロジェクト: isoundy000/wzry-1
 public static void SetObservers(GameObject root, int maxNum, ListView <MemberInfo> memberList, MemberInfo masterMember)
 {
     if (maxNum > 0)
     {
         root.CustomSetActive(true);
         CUIListScript componetInChild = Utility.GetComponetInChild <CUIListScript>(root, "SlotList");
         componetInChild.SetElementAmount(maxNum);
         MemberInfo[] infoArray = new MemberInfo[maxNum];
         for (int i = 0; i < memberList.Count; i++)
         {
             MemberInfo info = memberList[i];
             if ((info != null) && (info.dwPosOfCamp < maxNum))
             {
                 infoArray[info.dwPosOfCamp] = info;
             }
         }
         int num2 = 0;
         for (int j = 0; j < maxNum; j++)
         {
             MemberInfo         info2      = infoArray[j];
             GameObject         gameObject = componetInChild.GetElemenet(j).gameObject;
             bool               bActive    = null != info2;
             CUIHttpImageScript script2    = Utility.GetComponetInChild <CUIHttpImageScript>(gameObject, "Icon");
             Text               text       = Utility.GetComponetInChild <Text>(gameObject, "Name");
             CUIEventScript     script3    = Utility.GetComponetInChild <CUIEventScript>(gameObject, "SitDown");
             CUIEventScript     script4    = Utility.GetComponetInChild <CUIEventScript>(gameObject, "KickOut");
             script2.gameObject.CustomSetActive(bActive);
             text.gameObject.CustomSetActive(bActive);
             script3.gameObject.CustomSetActive(!bActive);
             script4.gameObject.CustomSetActive((bActive && (info2 != masterMember)) && Singleton <CRoomSystem> .GetInstance().IsSelfRoomOwner);
             if (bActive)
             {
                 text.text = info2.MemberName;
                 script2.SetImageUrl(Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(info2.MemberHeadUrl));
                 num2++;
             }
             if (script3.gameObject.activeSelf)
             {
                 script3.m_onClickEventID         = enUIEventID.Room_Observe_Seat;
                 script3.m_onClickEventParams.tag = j;
             }
             if (script4.gameObject.activeSelf)
             {
                 script4.m_onClickEventID         = enUIEventID.Room_Observe_Kick;
                 script4.m_onClickEventParams.tag = j;
             }
         }
         Utility.GetComponetInChild <Text>(root, "PersonCount").text = num2 + "/" + maxNum;
     }
     else
     {
         root.CustomSetActive(false);
     }
 }
コード例 #7
0
ファイル: RankingView.cs プロジェクト: TonyDongGuaPi/joework
        public static void SetHostUrlHeadIcon(GameObject headIcon)
        {
            if (CSysDynamicBlock.bSocialBlocked)
            {
                return;
            }
            string headUrl = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().HeadUrl;

            CUIHttpImageScript component = headIcon.GetComponent <CUIHttpImageScript>();

            component.SetImageUrl(headUrl);
        }
コード例 #8
0
		public PVEPlayerItem(GameObject playerItem)
		{
			this.m_Root = playerItem;
			CRoleInfo masterRoleInfo = Singleton<CRoleInfoManager>.instance.GetMasterRoleInfo();
			this.m_Name = masterRoleInfo.Name;
			this.m_NameText = this.m_Root.transform.Find("Name").GetComponent<Text>();
			this.m_LevelTxt = this.m_Root.transform.Find("Lv").GetComponent<Text>();
			this.m_ExpTxt = this.m_Root.transform.Find("Exp_Bar/Bar_Value").GetComponent<Text>();
			this.m_ExpBar1 = this.m_Root.transform.Find("Exp_Bar/Bar_Img").GetComponent<Image>();
			GameObject gameObject = this.m_Root.transform.Find("Player_Pic").gameObject;
			if (gameObject != null && !string.IsNullOrEmpty(masterRoleInfo.HeadUrl))
			{
				CUIHttpImageScript component = gameObject.GetComponent<CUIHttpImageScript>();
				component.SetImageUrl(masterRoleInfo.HeadUrl);
			}
		}
コード例 #9
0
        private void SetPrepareGuildMemListItem(CUIListElementScript listElementScript, GuildMemInfo info)
        {
            Transform          transform = listElementScript.transform;
            CUIHttpImageScript component = transform.Find("imgHead").GetComponent <CUIHttpImageScript>();
            Image component2             = component.transform.Find("NobeIcon").GetComponent <Image>();
            Image component3             = component.transform.Find("NobeImag").GetComponent <Image>();
            Text  component4             = transform.Find("txtName").GetComponent <Text>();
            Text  component5             = transform.Find("txtLevel").GetComponent <Text>();
            Text  component6             = transform.Find("txtBattle").GetComponent <Text>();

            component.SetImageUrl(CGuildHelper.GetHeadUrl(info.stBriefInfo.szHeadUrl));
            MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(component2, CGuildHelper.GetNobeLevel(info.stBriefInfo.uulUid, info.stBriefInfo.stVip.level), false);

            MonoSingleton <NobeSys> .GetInstance().SetHeadIconBk(component3, CGuildHelper.GetNobeHeadIconId(info.stBriefInfo.uulUid, info.stBriefInfo.stVip.headIconId));

            component4.text = info.stBriefInfo.sName;
            component5.text = info.stBriefInfo.dwLevel.ToString();
            component6.text = info.stBriefInfo.dwAbility.ToString();
        }
コード例 #10
0
 public static void SetHttpImage(CUIHttpImageScript HttpImage, string url)
 {
     if (HttpImage == null)
     {
         return;
     }
     if (CSysDynamicBlock.bFriendBlocked)
     {
         return;
     }
     if (url == null)
     {
         url = string.Empty;
     }
     if (HttpImage.gameObject.activeSelf)
     {
         HttpImage.SetImageUrl(Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(url));
     }
 }
コード例 #11
0
        public override void Validate()
        {
            this._urlaList = UrlAction.ParseFromText(base.view.activity.Content, null);
            int count = this._urlaList.Count;

            if (count > 0)
            {
                this._stepList.SetElementAmount(count);
                for (int i = 0; i < count; i++)
                {
                    UrlAction            urlAction = this._urlaList[i];
                    CUIListElementScript elemenet  = this._stepList.GetElemenet(i);
                    if (null != elemenet)
                    {
                        CUIHttpImageScript component = elemenet.GetComponent <CUIHttpImageScript>();
                        if (null != component)
                        {
                            component.SetImageUrl(urlAction.target);
                        }
                    }
                }
                this._pickIdxList = new int[count];
                if (this._pickObject != null)
                {
                    CUIContainerScript component2 = this._pickObject.GetComponent <CUIContainerScript>();
                    if (component2 != null)
                    {
                        component2.RecycleAllElement();
                        for (int j = 0; j < this._urlaList.Count; j++)
                        {
                            this._pickIdxList[j] = component2.GetElement();
                        }
                    }
                }
                this._curStepIndex = 0;
                this._leftToRight  = true;
                this._stepList.MoveElementInScrollArea(this._curStepIndex, true);
                this.EnablePickObj(this._curStepIndex);
                this._lastScrollTime = Time.time;
                this.updateOverTime();
            }
        }
コード例 #12
0
        private void On_Guild_Prepare_Guild_Select(CUIEvent uiEvent)
        {
            int selectedIndex = uiEvent.m_srcWidget.GetComponent <CUIListScript>().GetSelectedIndex();
            PrepareGuildInfo prepareGuildInfoByIndex = this.m_Model.GetPrepareGuildInfoByIndex(selectedIndex);

            DebugHelper.Assert(prepareGuildInfoByIndex != null);
            if (prepareGuildInfoByIndex == null)
            {
                return;
            }
            CUIHttpImageScript component = this.m_form.GetWidget(35).GetComponent <CUIHttpImageScript>();

            component.SetImageUrl(CGuildHelper.GetHeadUrl(prepareGuildInfoByIndex.stBriefInfo.stCreatePlayer.szHeadUrl));
            Image component2 = this.m_form.GetWidget(45).GetComponent <Image>();

            MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(component2, CGuildHelper.GetNobeLevel(prepareGuildInfoByIndex.stBriefInfo.stCreatePlayer.uulUid, prepareGuildInfoByIndex.stBriefInfo.stCreatePlayer.stVip.level), false);

            Image component3 = this.m_form.GetWidget(44).GetComponent <Image>();

            MonoSingleton <NobeSys> .GetInstance().SetHeadIconBk(component3, CGuildHelper.GetNobeHeadIconId(prepareGuildInfoByIndex.stBriefInfo.stCreatePlayer.uulUid, prepareGuildInfoByIndex.stBriefInfo.stCreatePlayer.stVip.headIconId));

            Text component4 = this.m_form.GetWidget(14).GetComponent <Text>();

            component4.text = prepareGuildInfoByIndex.stBriefInfo.stCreatePlayer.sName;
            Text component5 = this.m_form.GetWidget(15).GetComponent <Text>();

            component5.text = Singleton <CTextManager> .GetInstance().GetText("Common_Level_Format", new string[]
            {
                prepareGuildInfoByIndex.stBriefInfo.stCreatePlayer.dwLevel.ToString()
            });

            Text component6 = this.m_form.GetWidget(16).GetComponent <Text>();

            component6.text = prepareGuildInfoByIndex.stBriefInfo.stCreatePlayer.dwGameEntity.ToString();
            Text component7 = this.m_form.GetWidget(21).GetComponent <Text>();

            component7.text = prepareGuildInfoByIndex.stBriefInfo.sBulletin;
        }
コード例 #13
0
        public void UpdatePlayerData()
        {
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo();

            if (masterRoleInfo != null)
            {
                CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(FORM_PATH);

                if (this.m_PlayerName != null)
                {
                    this.m_PlayerName.text = masterRoleInfo.Name;
                }
                if (this.m_PlayerExp != null)
                {
                    this.m_PlayerExp.text = masterRoleInfo.Level.ToString();
                }
                if ((masterRoleInfo != null) && (this.m_PvpExpImg != null))
                {
                    this.m_PvpExpImg.CustomFillAmount(CPlayerProfile.Divide(masterRoleInfo.PvpExp, masterRoleInfo.PvpNeedExp));
                    this.m_PvpExpTxt.text = masterRoleInfo.PvpExp + "/" + masterRoleInfo.PvpNeedExp;
                }
                if (this.m_PvpLevel != null)
                {
                    string text = Singleton <CTextManager> .GetInstance().GetText("ranking_PlayerLevel");

                    if ((!string.IsNullOrEmpty(text) && (this.m_PvpLevel.text != null)) && (masterRoleInfo != null))
                    {
                        this.m_PvpLevel.text = string.Format(text, masterRoleInfo.PvpLevel);
                    }
                }
                if (!CSysDynamicBlock.bSocialBlocked)
                {
                    if ((this.m_PlayerVipLevel != null) && (masterRoleInfo != null))
                    {
                        this.m_PlayerVipLevel.text = string.Format("VIP{0}", masterRoleInfo.m_payLevel);
                    }
                    if (((form != null) && form.gameObject.activeSelf) && (masterRoleInfo != null))
                    {
                        GameObject widget = form.GetWidget(2);
                        if ((widget != null) && !string.IsNullOrEmpty(masterRoleInfo.HeadUrl))
                        {
                            CUIHttpImageScript component = widget.GetComponent <CUIHttpImageScript>();
                            component.SetImageUrl(masterRoleInfo.HeadUrl);
                            MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(component.GetComponent <Image>(), (int)masterRoleInfo.GetNobeInfo().stGameVipClient.dwCurLevel, false);

                            Image image = form.GetWidget(3).GetComponent <Image>();
                            MonoSingleton <NobeSys> .GetInstance().SetHeadIconBk(image, (int)masterRoleInfo.GetNobeInfo().stGameVipClient.dwHeadIconId);

                            bool       flag   = Singleton <HeadIconSys> .instance.UnReadFlagNum > 0;
                            GameObject target = Utility.FindChild(widget, "RedDot");
                            if (target != null)
                            {
                                if (flag)
                                {
                                    CUICommonSystem.AddRedDot(target, enRedDotPos.enTopRight, 0);
                                }
                                else
                                {
                                    CUICommonSystem.DelRedDot(target);
                                }
                            }
                        }
                    }
                }
                else if ((form != null) && form.gameObject.activeSelf)
                {
                    GameObject obj4 = form.GetWidget(2);
                    if (obj4 != null)
                    {
                        CUIHttpImageScript script3 = obj4.GetComponent <CUIHttpImageScript>();
                        if (script3 != null)
                        {
                            MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(script3.GetComponent <Image>(), 0, false);
                        }
                    }
                }
            }
        }
コード例 #14
0
        private void RefreshPrepareGuildPanelMemberList()
        {
            GameObject widget  = this.m_form.GetWidget(12);
            GameObject widget2 = this.m_form.GetWidget(13);
            GameObject widget3 = this.m_form.GetWidget(23);
            GameObject widget4 = this.m_form.GetWidget(25);
            GameObject widget5 = this.m_form.GetWidget(26);
            GameObject widget6 = this.m_form.GetWidget(24);

            widget2.CustomSetActive(true);
            widget3.CustomSetActive(true);
            widget6.CustomSetActive(true);
            widget.CustomSetActive(false);
            widget4.CustomSetActive(false);
            widget5.CustomSetActive(false);
            CUIListScript           component = this.m_form.GetWidget(28).GetComponent <CUIListScript>();
            ListView <GuildMemInfo> memList   = this.m_Model.CurrentPrepareGuildInfo.m_MemList;
            int num = (int)(this.m_Model.CurrentPrepareGuildInfo.stBriefInfo.bMemCnt - 1);

            component.SetElementAmount(num);
            if (num > 0)
            {
                component.SelectElement(0, true);
            }
            int num2 = 0;

            for (int i = 0; i < (int)this.m_Model.CurrentPrepareGuildInfo.stBriefInfo.bMemCnt; i++)
            {
                if (memList.get_Item(i).stBriefInfo.uulUid != this.m_Model.CurrentPrepareGuildInfo.stBriefInfo.stCreatePlayer.uulUid)
                {
                    CUIListElementScript elemenet = component.GetElemenet(num2);
                    if (elemenet != null)
                    {
                        this.SetPrepareGuildMemListItem(elemenet, memList.get_Item(i));
                    }
                    num2++;
                }
            }
            CUIHttpImageScript component2 = this.m_form.GetWidget(35).GetComponent <CUIHttpImageScript>();
            Image component3 = this.m_form.GetWidget(45).GetComponent <Image>();
            Image component4 = this.m_form.GetWidget(44).GetComponent <Image>();
            Text  component5 = this.m_form.GetWidget(14).GetComponent <Text>();
            Text  component6 = this.m_form.GetWidget(15).GetComponent <Text>();
            Text  component7 = this.m_form.GetWidget(16).GetComponent <Text>();

            component2.SetImageUrl(CGuildHelper.GetHeadUrl(this.m_Model.CurrentPrepareGuildInfo.stBriefInfo.stCreatePlayer.szHeadUrl));
            component5.text = this.m_Model.CurrentPrepareGuildInfo.stBriefInfo.stCreatePlayer.sName;
            component6.text = Singleton <CTextManager> .GetInstance().GetText("Common_Level_Format", new string[]
            {
                this.m_Model.CurrentPrepareGuildInfo.stBriefInfo.stCreatePlayer.dwLevel.ToString()
            });

            component7.text = this.m_Model.CurrentPrepareGuildInfo.stBriefInfo.stCreatePlayer.dwAbility.ToString();
            MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(component3, CGuildHelper.GetNobeLevel(this.m_Model.CurrentPrepareGuildInfo.stBriefInfo.stCreatePlayer.uulUid, this.m_Model.CurrentPrepareGuildInfo.stBriefInfo.stCreatePlayer.stVip.level), false);

            MonoSingleton <NobeSys> .GetInstance().SetHeadIconBk(component4, CGuildHelper.GetNobeHeadIconId(this.m_Model.CurrentPrepareGuildInfo.stBriefInfo.stCreatePlayer.uulUid, this.m_Model.CurrentPrepareGuildInfo.stBriefInfo.stCreatePlayer.stVip.headIconId));

            Text  component8  = this.m_form.GetWidget(18).GetComponent <Text>();
            Text  component9  = this.m_form.GetWidget(19).GetComponent <Text>();
            Image component10 = this.m_form.GetWidget(17).GetComponent <Image>();
            uint  num3        = GameDataMgr.guildMiscDatabin.GetDataByKey(1u).dwConfValue;

            num3 = ((num3 >= 0u) ? num3 : 0u);
            CUITimerScript component11 = this.m_form.GetWidget(20).GetComponent <CUITimerScript>();
            uint           num4        = this.m_Model.CurrentPrepareGuildInfo.stBriefInfo.dwRequestTime + GameDataMgr.guildMiscDatabin.GetDataByKey(2u).dwConfValue;
            int            num5        = (int)((ulong)num4 - (ulong)((long)CRoleInfo.GetCurrentUTCTime()));

            if (num5 < 0)
            {
                num5 = 0;
            }
            TimeSpan timeSpan = new TimeSpan(0, 0, 0, num5);

            component11.SetTotalTime((float)timeSpan.get_TotalSeconds());
            component11.StartTimer();
            component8.text = this.m_Model.CurrentPrepareGuildInfo.stBriefInfo.sName;
            string prefabPath = CUIUtility.s_Sprite_Dynamic_GuildHead_Dir + this.m_Model.CurrentPrepareGuildInfo.stBriefInfo.dwHeadId;

            component10.SetSprite(prefabPath, this.m_form, true, false, false, false);
            component9.text = num.ToString() + "/" + num3.ToString();
        }
コード例 #15
0
        public static void InitConfirmBox(GameObject root, int PlayerNum, ref RoomInfo roomInfo, CUIFormScript form)
        {
            if (root.transform.Find("Panel/Timer") != null)
            {
                CUITimerScript script = root.transform.Find("Panel/Timer").GetComponent <CUITimerScript>();
                if (script != null)
                {
                    script.EndTimer();
                    script.StartTimer();
                }
            }
            if (root.transform.Find("Panel/Panel/Timer") != null)
            {
                CUITimerScript script2 = root.transform.Find("Panel/Panel/Timer").GetComponent <CUITimerScript>();
                if (script2 != null)
                {
                    script2.EndTimer();
                    script2.StartTimer();
                }
            }
            Transform       transform = root.transform.Find("Panel/Panel/stateGroup");
            GridLayoutGroup component = transform.GetComponent <GridLayoutGroup>();

            if (component != null)
            {
                component.constraintCount = (PlayerNum != 6) ? 5 : 3;
            }
            bool flag = roomInfo.roomAttrib.bPkAI == 2;
            int  num  = !(!roomInfo.roomAttrib.bWarmBattle ? flag : false) ? PlayerNum : (PlayerNum / 2);

            for (int i = 1; i <= 10; i++)
            {
                transform.Find(string.Format("icon{0}", i)).gameObject.CustomSetActive(num >= i);
            }
            int num3 = 1;

            for (COM_PLAYERCAMP com_playercamp = COM_PLAYERCAMP.COM_PLAYERCAMP_1; com_playercamp < COM_PLAYERCAMP.COM_PLAYERCAMP_COUNT; com_playercamp += 1)
            {
                ListView <MemberInfo> view = roomInfo[com_playercamp];
                for (int j = 0; j < view.Count; j++)
                {
                    MemberInfo info           = view[j];
                    Transform  transform2     = transform.Find(string.Format("icon{0}", num3));
                    CRoleInfo  masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

                    if (!CSysDynamicBlock.bSocialBlocked)
                    {
                        if ((((roomInfo.roomAttrib.bMapType == 3) && (masterRoleInfo != null)) && (masterRoleInfo.m_rankGrade >= 7)) || (roomInfo.roomAttrib.bMapType == 5))
                        {
                            Image image = transform2.Find("HttpImage").GetComponent <Image>();
                            if (image != null)
                            {
                                image.SetSprite(CUIUtility.s_Sprite_Dynamic_BustPlayer_Dir + "Common_PlayerImg", form, true, false, false);
                            }
                        }
                        else
                        {
                            CUIHttpImageScript script3 = transform2.Find("HttpImage").GetComponent <CUIHttpImageScript>();
                            if (script3 != null)
                            {
                                script3.SetImageUrl(Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(info.MemberHeadUrl));
                            }
                        }
                    }
                    Transform transform3 = transform.Find(string.Format("icon{0}/ready", num3));
                    if (transform3 != null)
                    {
                        transform3.gameObject.CustomSetActive(false);
                    }
                    Transform transform4 = transform.Find(string.Format("icon{0}/unready", num3));
                    if (transform4 != null)
                    {
                        transform4.gameObject.CustomSetActive(true);
                    }
                    num3++;
                }
            }
            Transform transform5 = root.transform.Find("Panel/Panel/TxtReadyNum");

            if (transform5 != null)
            {
                Text text = transform5.GetComponent <Text>();
                if (text != null)
                {
                    text.text = string.Format(Singleton <CTextManager> .GetInstance().GetText("Matching_Confirm_PlayerNum"), 0, num);
                }
            }
            Transform transform6 = root.transform.Find("Panel/Panel/btnGroup/Button_Confirm");

            if (transform6 != null)
            {
                transform6.GetComponent <Button>().interactable = true;
            }
        }
コード例 #16
0
ファイル: COBSystem.cs プロジェクト: isoundy000/wzry-1
        private void UpdateElement(GameObject element, string name, string headUrl, byte bGrade, uint subGrade, uint heroId, enOBTab curTab, int onlineNum, enStatus status = 0, long localTicks = 0, byte mapType = 0, uint mapId = 0)
        {
            CUIFormScript form = Singleton <CUIManager> .instance.GetForm(OB_FORM_PATH);

            if (form != null)
            {
                CUIHttpImageScript componetInChild = Utility.GetComponetInChild <CUIHttpImageScript>(element, "HeadImg");
                Image      image  = Utility.GetComponetInChild <Image>(element, "HeroImg");
                Image      image2 = Utility.GetComponetInChild <Image>(element, "RankImg");
                Image      image3 = Utility.GetComponetInChild <Image>(element, "RankImg/SubRankImg");
                Text       text   = Utility.GetComponetInChild <Text>(element, "PlayerName");
                Text       text2  = Utility.GetComponetInChild <Text>(element, "HeroName");
                GameObject obj2   = Utility.FindChild(element, "WatchImg");
                Text       text3  = Utility.GetComponetInChild <Text>(element, "LocalTime");
                Text       text4  = Utility.GetComponetInChild <Text>(element, "LocalMap");
                Text       text5  = Utility.GetComponetInChild <Text>(element, "WatchImg/OnlineCount");
                GameObject obj3   = Utility.FindChild(element, "DeleteBtn");
                componetInChild.SetImageUrl(headUrl);
                if (bGrade > 0)
                {
                    image2.gameObject.CustomSetActive(true);
                    image2.SetSprite(CLadderView.GetRankSmallIconPath(bGrade, subGrade), form, true, false, false);
                    image3.SetSprite(CLadderView.GetSubRankSmallIconPath(bGrade, subGrade), form, true, false, false);
                }
                else
                {
                    image2.gameObject.CustomSetActive(false);
                }
                text.text = name;
                ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(heroId);
                if (dataByKey != null)
                {
                    string prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_BustHero_Dir, CSkinInfo.GetHeroSkinPic(heroId, 0));
                    image.SetSprite(prefabPath, form, false, true, true);
                    text2.text = dataByKey.szName;
                }
                else
                {
                    text2.text = string.Empty;
                    DebugHelper.Assert(false, string.Format("COBSystem UpdateElement hero cfg[{0}] can not be found!", heroId));
                }
                if (curTab != enOBTab.Local)
                {
                    obj2.CustomSetActive(true);
                    string[] args = new string[] { onlineNum.ToString() };
                    text5.text = Singleton <CTextManager> .instance.GetText("OB_Desc_3", args);

                    text3.gameObject.SetActive(false);
                    obj3.CustomSetActive(false);
                    text4.gameObject.CustomSetActive(false);
                }
                else
                {
                    obj2.CustomSetActive(false);
                    text3.gameObject.SetActive(true);
                    DateTime time       = new DateTime(localTicks);
                    string[] textArray2 = new string[] { time.Month.ToString(), time.Day.ToString(), time.Hour.ToString("D2"), time.Minute.ToString("D2") };
                    text3.text = Singleton <CTextManager> .instance.GetText("OB_Desc_12", textArray2);

                    obj3.CustomSetActive(status == enStatus.Editor);
                    text4.gameObject.CustomSetActive(true);
                    ResDT_LevelCommonInfo pvpMapCommonInfo = CLevelCfgLogicManager.GetPvpMapCommonInfo(mapType, mapId);
                    if (pvpMapCommonInfo != null)
                    {
                        text4.text = pvpMapCommonInfo.szName;
                    }
                    else
                    {
                        text4.text = string.Empty;
                    }
                }
            }
        }
コード例 #17
0
ファイル: CMailView.cs プロジェクト: TonyDongGuaPi/joework
    public void UpdateListElenment(GameObject element, CMail mail)
    {
        int                currentUTCTime = CRoleInfo.GetCurrentUTCTime();
        Text               component      = element.transform.FindChild("Title").GetComponent <Text>();
        Text               component2     = element.transform.FindChild("MailTime").GetComponent <Text>();
        GameObject         gameObject     = element.transform.FindChild("New").gameObject;
        GameObject         gameObject2    = element.transform.FindChild("ReadMailIcon").gameObject;
        GameObject         gameObject3    = element.transform.FindChild("UnReadMailIcon").gameObject;
        GameObject         gameObject4    = element.transform.FindChild("CoinImg").gameObject;
        Text               component3     = element.transform.FindChild("From").GetComponent <Text>();
        CUIHttpImageScript component4     = element.transform.FindChild("HeadBg/imgHead").GetComponent <CUIHttpImageScript>();
        GameObject         obj            = null;
        Text               text           = null;
        Transform          transform      = element.transform.FindChild("OnlineBg");

        if (transform != null)
        {
            obj = transform.gameObject;
        }
        Transform transform2 = element.transform.FindChild("Online");

        if (transform2 != null)
        {
            text = transform2.GetComponent <Text>();
        }
        component.text  = mail.subject;
        component2.text = Utility.GetTimeBeforString((long)((ulong)mail.sendTime), (long)currentUTCTime);
        bool flag = mail.mailState == 1;

        gameObject.CustomSetActive(flag);
        if (mail.mailType == 1)
        {
            gameObject2.CustomSetActive(!flag);
            gameObject3.CustomSetActive(flag);
            component3.text = string.Empty;
            component4.gameObject.CustomSetActive(false);
            gameObject4.SetActive(false);
            obj.CustomSetActive(false);
            if (text != null)
            {
                text.gameObject.CustomSetActive(false);
            }
        }
        else if (mail.mailType == 2)
        {
            obj.CustomSetActive(false);
            if (text != null)
            {
                text.gameObject.CustomSetActive(false);
            }
            gameObject2.CustomSetActive(false);
            gameObject3.CustomSetActive(false);
            component3.text = mail.from;
            component4.gameObject.CustomSetActive(true);
            if (mail.subType == 3)
            {
                gameObject4.CustomSetActive(false);
                component4.SetImageSprite(CGuildHelper.GetGuildHeadPath(), this.m_CUIForm);
            }
            else
            {
                gameObject4.CustomSetActive(true);
                if (!CSysDynamicBlock.bFriendBlocked)
                {
                    COMDT_FRIEND_INFO friendByName = Singleton <CFriendContoller> .get_instance().model.getFriendByName(mail.from, CFriendModel.FriendType.GameFriend);

                    if (friendByName == null)
                    {
                        friendByName = Singleton <CFriendContoller> .get_instance().model.getFriendByName(mail.from, CFriendModel.FriendType.SNS);
                    }
                    if (friendByName != null)
                    {
                        string url = Utility.UTF8Convert(friendByName.szHeadUrl);
                        component4.SetImageUrl(Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(url));
                    }
                }
            }
        }
        else if (mail.mailType == 3)
        {
            obj.CustomSetActive(true);
            if (text != null)
            {
                text.gameObject.CustomSetActive(true);
            }
            gameObject2.CustomSetActive(false);
            gameObject3.CustomSetActive(false);
            component3.text = string.Empty;
            component4.gameObject.CustomSetActive(true);
            gameObject4.SetActive(false);
            Transform  transform3 = element.transform.FindChild("invite_btn");
            GameObject obj2       = null;
            if (transform3 != null)
            {
                obj2 = transform3.gameObject;
            }
            if (mail.relationType == 1)
            {
                GuildMemInfo guildMemberInfoByUid = CGuildHelper.GetGuildMemberInfoByUid(mail.uid);
                Singleton <CMailSys> .get_instance().AddGuildMemInfo(guildMemberInfoByUid);
            }
            this.SetEventParams(element, mail);
            string text2;
            string url2;
            bool   flag2             = !this.GetOtherPlayerState(mail.relationType, mail.uid, mail.dwLogicWorldID, out text2, out url2);
            string processTypeString = this.GetProcessTypeString((CMailSys.enProcessInviteType)mail.processType);
            component.text = string.Format("{0} {1}", mail.subject, processTypeString);
            if (text != null)
            {
                text.text = text2;
            }
            component4.SetImageUrl(Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(url2));
            if (flag2)
            {
                CUIUtility.GetComponentInChildren <Image>(component4.gameObject).color = CUIUtility.s_Color_GrayShader;
            }
            else
            {
                CUIUtility.GetComponentInChildren <Image>(component4.gameObject).color = CUIUtility.s_Color_Full;
            }
            obj2.CustomSetActive(!flag2);
        }
    }
コード例 #18
0
    public void UpdateListElenment(GameObject element, CMail mail)
    {
        int                currentUTCTime   = CRoleInfo.GetCurrentUTCTime();
        Text               componetInChild  = Utility.GetComponetInChild <Text>(element, "Title");
        Text               componetInChild2 = Utility.GetComponetInChild <Text>(element, "MailTime");
        GameObject         obj              = Utility.FindChild(element, "New");
        GameObject         obj2             = Utility.FindChild(element, "ReadMailIcon");
        GameObject         obj3             = Utility.FindChild(element, "UnReadMailIcon");
        GameObject         obj4             = Utility.FindChild(element, "CoinImg");
        Text               componetInChild3 = Utility.GetComponetInChild <Text>(element, "From");
        CUIHttpImageScript componetInChild4 = Utility.GetComponetInChild <CUIHttpImageScript>(element, "HeadBg/imgHead");
        GameObject         obj5             = null;
        Text               text             = null;
        GameObject         gameObject       = Utility.FindChild(element, "OnlineBg");

        if (gameObject != null)
        {
            obj5 = gameObject.gameObject;
        }
        GameObject gameObject2 = Utility.FindChild(element, "Online");

        if (gameObject2 != null)
        {
            text = gameObject2.GetComponent <Text>();
        }
        componetInChild.set_text(mail.subject);
        componetInChild2.set_text(Utility.GetTimeBeforString((long)((ulong)mail.sendTime), (long)currentUTCTime));
        bool flag = mail.mailState == COM_MAIL_STATE.COM_MAIL_UNREAD;

        obj.CustomSetActive(flag);
        if (mail.mailType == CustomMailType.SYSTEM)
        {
            obj2.CustomSetActive(!flag);
            obj3.CustomSetActive(flag);
            componetInChild3.set_text(string.Empty);
            componetInChild4.gameObject.CustomSetActive(false);
            obj4.CustomSetActive(false);
            obj5.CustomSetActive(false);
            if (text != null)
            {
                text.gameObject.CustomSetActive(false);
            }
        }
        else if (mail.mailType == CustomMailType.FRIEND)
        {
            obj5.CustomSetActive(false);
            if (text != null)
            {
                text.gameObject.CustomSetActive(false);
            }
            obj2.CustomSetActive(false);
            obj3.CustomSetActive(false);
            componetInChild3.set_text(mail.from);
            componetInChild4.gameObject.CustomSetActive(true);
            if (mail.subType == 3)
            {
                obj4.CustomSetActive(false);
                componetInChild4.SetImageSprite(CGuildHelper.GetGuildHeadPath(), this.m_CUIForm);
            }
            else
            {
                obj4.CustomSetActive(true);
                if (!CSysDynamicBlock.bFriendBlocked)
                {
                    COMDT_FRIEND_INFO friendByName = Singleton <CFriendContoller> .instance.model.getFriendByName(mail.from, CFriendModel.FriendType.GameFriend);

                    if (friendByName == null)
                    {
                        friendByName = Singleton <CFriendContoller> .instance.model.getFriendByName(mail.from, CFriendModel.FriendType.SNS);
                    }
                    if (friendByName != null)
                    {
                        string url = Utility.UTF8Convert(friendByName.szHeadUrl);
                        componetInChild4.SetImageUrl(Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(url));
                    }
                }
            }
        }
        else if (mail.mailType == CustomMailType.FRIEND_INVITE)
        {
            obj5.CustomSetActive(true);
            if (text != null)
            {
                text.gameObject.CustomSetActive(true);
            }
            obj2.CustomSetActive(false);
            obj3.CustomSetActive(false);
            componetInChild3.set_text(string.Empty);
            componetInChild4.gameObject.CustomSetActive(true);
            obj4.CustomSetActive(false);
            Transform  transform = element.transform.FindChild("invite_btn");
            GameObject obj6      = null;
            if (transform != null)
            {
                obj6 = transform.gameObject;
            }
            if (mail.relationType == 1)
            {
                GuildMemInfo guildMemberInfoByUid = CGuildHelper.GetGuildMemberInfoByUid(mail.uid);
                Singleton <CMailSys> .instance.AddGuildMemInfo(guildMemberInfoByUid);
            }
            this.SetEventParams(element, mail);
            string text2;
            string url2;
            bool   flag2             = !this.GetOtherPlayerState((COM_INVITE_RELATION_TYPE)mail.relationType, mail.uid, mail.dwLogicWorldID, out text2, out url2);
            string processTypeString = this.GetProcessTypeString((CMailSys.enProcessInviteType)mail.processType);
            componetInChild.set_text(string.Format("{0} {1}", mail.subject, processTypeString));
            if (text != null)
            {
                text.set_text(text2);
            }
            componetInChild4.SetImageUrl(Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(url2));
            if (flag2)
            {
                CUIUtility.GetComponentInChildren <Image>(componetInChild4.gameObject).set_color(CUIUtility.s_Color_GrayShader);
            }
            else
            {
                CUIUtility.GetComponentInChildren <Image>(componetInChild4.gameObject).set_color(CUIUtility.s_Color_Full);
            }
            obj6.CustomSetActive(!flag2);
        }
        else if (mail.mailType == CustomMailType.ASK_FOR)
        {
            obj2.CustomSetActive(false);
            obj3.CustomSetActive(false);
            componetInChild3.set_text(mail.from);
            componetInChild4.gameObject.CustomSetActive(true);
            obj4.CustomSetActive(false);
            obj5.CustomSetActive(false);
            if (text != null)
            {
                text.gameObject.CustomSetActive(false);
            }
            if (!CSysDynamicBlock.bFriendBlocked)
            {
                CFriendModel.FriendType friendType    = CFriendModel.FriendType.GameFriend;
                COMDT_FRIEND_INFO       friendByName2 = Singleton <CFriendContoller> .instance.model.getFriendByName(mail.from, CFriendModel.FriendType.GameFriend);

                if (friendByName2 == null)
                {
                    friendType    = CFriendModel.FriendType.SNS;
                    friendByName2 = Singleton <CFriendContoller> .instance.model.getFriendByName(mail.from, CFriendModel.FriendType.SNS);
                }
                if (friendByName2 != null)
                {
                    string url3 = Utility.UTF8Convert(friendByName2.szHeadUrl);
                    componetInChild4.SetImageUrl(Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(url3));
                    UT.ShowFriendData(friendByName2, element.GetComponent <FriendShower>(), FriendShower.ItemType.Normal, false, friendType, Singleton <CUIManager> .GetInstance().GetForm(CMailSys.MAIL_FORM_PATH), true);
                }
            }
        }
    }
コード例 #19
0
        private static void SetExpInfo(GameObject root, CUIFormScript formScript)
        {
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo();

            DebugHelper.Assert(masterRoleInfo != null, "can't find roleinfo");
            if (masterRoleInfo != null)
            {
                ResAcntPvpExpInfo dataByKey    = GameDataMgr.acntPvpExpDatabin.GetDataByKey((uint)((byte)masterRoleInfo.PvpLevel));
                object[]          inParameters = new object[] { masterRoleInfo.PvpLevel };
                DebugHelper.Assert(dataByKey != null, "can't find resexp id={0}", inParameters);
                if (dataByKey != null)
                {
                    root.transform.Find("PanelA/Award/Panel_PlayerExp/PvpExpNode/PvpLevelTxt").GetComponent <Text>().text = string.Format("Lv.{0}", dataByKey.bLevel.ToString());
                    Text component            = root.transform.Find("PanelA/Award/Panel_PlayerExp/PvpExpNode/PvpExpTxt").GetComponent <Text>();
                    Text text3                = root.transform.Find("PanelA/Award/Panel_PlayerExp/PvpExpNode/ExpMax").GetComponent <Text>();
                    Text text4                = root.transform.Find("PanelA/Award/Panel_PlayerExp/PvpExpNode/PlayerName").GetComponent <Text>();
                    CUIHttpImageScript script = root.transform.Find("PanelA/Award/Panel_PlayerExp/PvpExpNode/HeadImage").GetComponent <CUIHttpImageScript>();
                    Image image               = root.transform.Find("PanelA/Award/Panel_PlayerExp/PvpExpNode/NobeIcon").GetComponent <Image>();
                    Image image2              = root.transform.Find("PanelA/Award/Panel_PlayerExp/PvpExpNode/HeadFrame").GetComponent <Image>();
                    if (!CSysDynamicBlock.bSocialBlocked)
                    {
                        string headUrl = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().HeadUrl;

                        script.SetImageUrl(headUrl);
                        MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(image, (int)Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo().GetNobeInfo().stGameVipClient.dwCurLevel, false);

                        MonoSingleton <NobeSys> .GetInstance().SetHeadIconBk(image2, (int)Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo().GetNobeInfo().stGameVipClient.dwHeadIconId);
                    }
                    else
                    {
                        MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(image, 0, false);
                    }
                    SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

                    DebugHelper.Assert(curLvelContext != null, "Battle Level Context is NULL!!");
                    GameObject gameObject = root.transform.Find("PanelA/Award/RankCon").gameObject;
                    gameObject.CustomSetActive(false);
                    if (curLvelContext.IsGameTypeLadder())
                    {
                        COMDT_RANK_SETTLE_INFO rankInfo = Singleton <BattleStatistic> .GetInstance().rankInfo;

                        if (rankInfo != null)
                        {
                            gameObject.CustomSetActive(true);
                            Text text5 = gameObject.transform.FindChild(string.Format("txtRankName", new object[0])).gameObject.GetComponent <Text>();
                            Text text6 = gameObject.transform.FindChild(string.Format("WangZheXingTxt", new object[0])).gameObject.GetComponent <Text>();
                            text5.text = StringHelper.UTF8BytesToString(ref GameDataMgr.rankGradeDatabin.GetDataByKey((uint)rankInfo.bNowGrade).szGradeDesc);
                            if (rankInfo.bNowGrade == GameDataMgr.rankGradeDatabin.count)
                            {
                                Transform transform = gameObject.transform.FindChild(string.Format("XingGrid/ImgScore{0}", 1));
                                if (transform != null)
                                {
                                    transform.gameObject.CustomSetActive(true);
                                }
                                text6.gameObject.CustomSetActive(true);
                                text6.text = string.Format("X{0}", rankInfo.dwNowScore);
                            }
                            else
                            {
                                text6.gameObject.CustomSetActive(false);
                                for (int i = 1; i <= rankInfo.dwNowScore; i++)
                                {
                                    Transform transform2 = gameObject.transform.FindChild(string.Format("XingGrid/ImgScore{0}", i));
                                    if (transform2 != null)
                                    {
                                        transform2.gameObject.CustomSetActive(true);
                                    }
                                }
                            }
                            root.transform.Find("PanelA/Award/Panel_PlayerExp/PvpLevelNode").gameObject.CustomSetActive(false);
                        }
                    }
                    Image image3 = root.transform.Find("PanelA/Award/Panel_PlayerExp/PvpExpNode/QQVIPIcon").GetComponent <Image>();
                    MonoSingleton <NobeSys> .GetInstance().SetMyQQVipHead(image3);

                    COMDT_REWARD_MULTIPLE_DETAIL multiDetail = Singleton <BattleStatistic> .GetInstance().multiDetail;

                    if (multiDetail != null)
                    {
                        string[]      strArray = new string[8];
                        StringBuilder builder  = new StringBuilder();
                        int           num2     = CUseable.GetMultiple(ref multiDetail, 15, -1);
                        if (num2 > 0)
                        {
                            COMDT_MULTIPLE_INFO comdt_multiple_info = CUseable.GetMultipleInfo(ref multiDetail, 15, -1);
                            string[]            args = new string[] { num2.ToString() };
                            strArray[0] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_1", args);

                            if (comdt_multiple_info.dwPvpDailyRatio > 0)
                            {
                                string[] textArray2 = new string[] { masterRoleInfo.dailyPvpCnt.ToString(), (comdt_multiple_info.dwPvpDailyRatio / 100).ToString() };
                                strArray[1] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_2", textArray2);
                            }
                            if (comdt_multiple_info.dwQQVIPRatio > 0)
                            {
                                if (masterRoleInfo.HasVip(0x10))
                                {
                                    string[] textArray3 = new string[] { (comdt_multiple_info.dwQQVIPRatio / 100).ToString() };
                                    strArray[2] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_9", textArray3);
                                }
                                else
                                {
                                    string[] textArray4 = new string[] { (comdt_multiple_info.dwQQVIPRatio / 100).ToString() };
                                    strArray[2] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_3", textArray4);
                                }
                            }
                            if (comdt_multiple_info.dwPropRatio > 0)
                            {
                                strArray[3] = string.Format(Singleton <CTextManager> .GetInstance().GetText("Pvp_settle_Common_Tips_4"), comdt_multiple_info.dwPropRatio / 100, masterRoleInfo.GetExpWinCount(), Math.Ceiling((double)(((float)masterRoleInfo.GetExpExpireHours()) / 24f)));
                            }
                            if (comdt_multiple_info.dwWealRatio > 0)
                            {
                                string[] textArray5 = new string[] { (comdt_multiple_info.dwWealRatio / 100).ToString() };
                                strArray[4] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_6", textArray5);
                            }
                            if (comdt_multiple_info.dwWXGameCenterLoginRatio > 0)
                            {
                                string[] textArray6 = new string[] { (comdt_multiple_info.dwWXGameCenterLoginRatio / 100).ToString() };
                                strArray[5] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_13", textArray6);
                            }
                            if (comdt_multiple_info.dwQQGameCenterLoginRatio > 0)
                            {
                                string[] textArray7 = new string[] { (comdt_multiple_info.dwQQGameCenterLoginRatio / 100).ToString() };
                                strArray[6] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_14", textArray7);
                            }
                            if (comdt_multiple_info.dwIOSVisitorLoginRatio > 0)
                            {
                                string[] textArray8 = new string[] { (comdt_multiple_info.dwIOSVisitorLoginRatio / 100).ToString() };
                                strArray[7] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_14", textArray8);
                            }
                            builder.Append(strArray[0]);
                            for (int j = 1; j < strArray.Length; j++)
                            {
                                if (!string.IsNullOrEmpty(strArray[j]))
                                {
                                    builder.Append("\n");
                                    builder.Append(strArray[j]);
                                }
                            }
                            GameObject obj3 = root.transform.Find("PanelA/Award/Panel_PlayerExp/PvpExpNode/DoubleExp").gameObject;
                            obj3.CustomSetActive(true);
                            obj3.GetComponentInChildren <Text>().text = string.Format("+{0}%", num2);
                            CUICommonSystem.SetCommonTipsEvent(formScript, obj3, builder.ToString(), enUseableTipsPos.enLeft);
                        }
                        else
                        {
                            root.transform.Find("PanelA/Award/Panel_PlayerExp/PvpExpNode/DoubleExp").gameObject.CustomSetActive(false);
                        }
                        GameObject obj5 = root.transform.Find("PanelA/Award/ItemAndCoin/Panel_Gold/GoldMax").gameObject;
                        if (Singleton <BattleStatistic> .GetInstance().acntInfo.bReachDailyLimit > 0)
                        {
                            obj5.CustomSetActive(true);
                        }
                        else
                        {
                            obj5.CustomSetActive(false);
                        }
                        int num4 = CUseable.GetMultiple(ref multiDetail, 11, -1);
                        if (num4 > 0)
                        {
                            COMDT_MULTIPLE_INFO comdt_multiple_info2 = CUseable.GetMultipleInfo(ref multiDetail, 11, -1);
                            strArray = new string[8];
                            string[] textArray9 = new string[] { num4.ToString() };
                            strArray[0] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_7", textArray9);

                            if (comdt_multiple_info2.dwPvpDailyRatio > 0)
                            {
                                string[] textArray10 = new string[] { masterRoleInfo.dailyPvpCnt.ToString(), (comdt_multiple_info2.dwPvpDailyRatio / 100).ToString() };
                                strArray[1] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_8", textArray10);
                            }
                            if (comdt_multiple_info2.dwQQVIPRatio > 0)
                            {
                                if (masterRoleInfo.HasVip(0x10))
                                {
                                    string[] textArray11 = new string[] { (comdt_multiple_info2.dwQQVIPRatio / 100).ToString() };
                                    strArray[2] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_9", textArray11);
                                }
                                else
                                {
                                    string[] textArray12 = new string[] { (comdt_multiple_info2.dwQQVIPRatio / 100).ToString() };
                                    strArray[2] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_3", textArray12);
                                }
                            }
                            if (comdt_multiple_info2.dwPropRatio > 0)
                            {
                                strArray[3] = string.Format(Singleton <CTextManager> .GetInstance().GetText("Pvp_settle_Common_Tips_10"), comdt_multiple_info2.dwPropRatio / 100, masterRoleInfo.GetCoinWinCount(), Math.Ceiling((double)(((float)masterRoleInfo.GetCoinExpireHours()) / 24f)));
                            }
                            if (comdt_multiple_info2.dwWealRatio > 0)
                            {
                                string[] textArray13 = new string[] { (comdt_multiple_info2.dwWealRatio / 100).ToString() };
                                strArray[4] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_12", textArray13);
                            }
                            if (comdt_multiple_info2.dwWXGameCenterLoginRatio > 0)
                            {
                                string[] textArray14 = new string[] { (comdt_multiple_info2.dwWXGameCenterLoginRatio / 100).ToString() };
                                strArray[5] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_13", textArray14);
                            }
                            if (comdt_multiple_info2.dwQQGameCenterLoginRatio > 0)
                            {
                                string[] textArray15 = new string[] { (comdt_multiple_info2.dwQQGameCenterLoginRatio / 100).ToString() };
                                strArray[6] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_14", textArray15);
                            }
                            if (comdt_multiple_info2.dwIOSVisitorLoginRatio > 0)
                            {
                                string[] textArray16 = new string[] { (comdt_multiple_info2.dwIOSVisitorLoginRatio / 100).ToString() };
                                strArray[7] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_14", textArray16);
                            }
                            builder.Remove(0, builder.Length);
                            builder.Append(strArray[0]);
                            for (int k = 1; k < strArray.Length; k++)
                            {
                                if (!string.IsNullOrEmpty(strArray[k]))
                                {
                                    builder.Append("\n");
                                    builder.Append(strArray[k]);
                                }
                            }
                            GameObject obj6 = root.transform.Find("PanelA/Award/ItemAndCoin/Panel_Gold/DoubleCoin").gameObject;
                            obj6.CustomSetActive(true);
                            obj6.GetComponentInChildren <Text>().text = string.Format("+{0}%", num4);
                            CUICommonSystem.SetCommonTipsEvent(formScript, obj6, builder.ToString(), enUseableTipsPos.enLeft);
                        }
                        else
                        {
                            root.transform.Find("PanelA/Award/ItemAndCoin/Panel_Gold/DoubleCoin").gameObject.CustomSetActive(false);
                        }
                    }
                    text4.text = masterRoleInfo.Name;
                    RectTransform   transform3 = root.transform.Find("PanelA/Award/Panel_PlayerExp/PvpExpNode/PvpExpSliderBg/BasePvpExpSlider").gameObject.GetComponent <RectTransform>();
                    RectTransform   transform4 = root.transform.Find("PanelA/Award/Panel_PlayerExp/PvpExpNode/PvpExpSliderBg/AddPvpExpSlider").gameObject.GetComponent <RectTransform>();
                    COMDT_ACNT_INFO acntInfo   = Singleton <BattleStatistic> .GetInstance().acntInfo;

                    if (acntInfo != null)
                    {
                        if (acntInfo.dwPvpSettleExp > 0)
                        {
                            Singleton <CSoundManager> .GetInstance().PostEvent("UI_count_jingyan", null);
                        }
                        int num6 = (int)(acntInfo.dwPvpExp - acntInfo.dwPvpSettleExp);
                        if (num6 < 0)
                        {
                            _lvUpGrade = acntInfo.dwPvpLv;
                        }
                        else
                        {
                            _lvUpGrade = 0;
                        }
                        float num7 = Mathf.Max((float)0f, (float)(((float)num6) / ((float)dataByKey.dwNeedExp)));
                        float num8 = Mathf.Max((float)0f, (float)(((num6 >= 0) ? ((float)acntInfo.dwPvpSettleExp) : ((float)acntInfo.dwPvpExp)) / ((float)dataByKey.dwNeedExp)));
                        root.transform.FindChild("PanelA/Award/Panel_PlayerExp/PvpExpNode/AddPvpExpTxt").GetComponent <Text>().text = (acntInfo.dwPvpSettleExp <= 0) ? string.Empty : string.Format("+{0}", acntInfo.dwPvpSettleExp).ToString();
                        if (acntInfo.dwPvpSettleExp == 0)
                        {
                            root.transform.FindChild("PanelA/Award/Panel_PlayerExp/PvpExpNode/Bar2").gameObject.CustomSetActive(false);
                        }
                        transform3.sizeDelta = new Vector2(num7 * 327.6f, transform3.sizeDelta.y);
                        transform4.sizeDelta = new Vector2(num7 * 327.6f, transform4.sizeDelta.y);
                        _expFrom             = num7;
                        _expTo        = num7 + num8;
                        _expTweenRect = transform4;
                        transform3.gameObject.CustomSetActive(num6 >= 0);
                        text3.text = (acntInfo.bExpDailyLimit <= 0) ? string.Empty : Singleton <CTextManager> .GetInstance().GetText("GetExp_Limit");

                        component.text = string.Format("{0}/{1}", acntInfo.dwPvpExp.ToString(), dataByKey.dwNeedExp.ToString());
                    }
                }
            }
        }
コード例 #20
0
        private void UpdateElement(GameObject element, string name, string headUrl, byte bGrade, uint subGrade, uint heroId, COBSystem.enOBTab curTab, int onlineNum, COBSystem.enStatus status = COBSystem.enStatus.Normal, long localTicks = 0L, byte mapType = 0, uint mapId = 0u, string localName = "")
        {
            CUIFormScript form = Singleton <CUIManager> .get_instance().GetForm(COBSystem.OB_FORM_PATH);

            if (form == null)
            {
                return;
            }
            CUIHttpImageScript componetInChild = Utility.GetComponetInChild <CUIHttpImageScript>(element, "HeadImg");
            Image      componetInChild2        = Utility.GetComponetInChild <Image>(element, "HeroImg");
            Image      componetInChild3        = Utility.GetComponetInChild <Image>(element, "RankImg");
            Image      componetInChild4        = Utility.GetComponetInChild <Image>(element, "RankImg/SubRankImg");
            Text       componetInChild5        = Utility.GetComponetInChild <Text>(element, "PlayerName");
            Text       componetInChild6        = Utility.GetComponetInChild <Text>(element, "HeroName");
            GameObject obj = Utility.FindChild(element, "WatchImg");
            Text       componetInChild7 = Utility.GetComponetInChild <Text>(element, "LocalTime");
            Text       componetInChild8 = Utility.GetComponetInChild <Text>(element, "LocalMap");
            Text       componetInChild9 = Utility.GetComponetInChild <Text>(element, "WatchImg/OnlineCount");
            GameObject obj2             = Utility.FindChild(element, "DeleteBtn");

            componetInChild.SetImageUrl(headUrl);
            if (bGrade > 0)
            {
                componetInChild3.gameObject.CustomSetActive(true);
                componetInChild3.SetSprite(CLadderView.GetRankSmallIconPath(bGrade, subGrade), form, true, false, false, false);
                componetInChild4.SetSprite(CLadderView.GetSubRankSmallIconPath(bGrade, subGrade), form, true, false, false, false);
            }
            else
            {
                componetInChild3.gameObject.CustomSetActive(false);
            }
            componetInChild5.text = name;
            ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(heroId);

            if (dataByKey != null)
            {
                string prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_BustHero_Dir, CSkinInfo.GetHeroSkinPic(heroId, 0u));
                componetInChild2.SetSprite(prefabPath, form, false, true, true, false);
                componetInChild6.text = dataByKey.szName;
            }
            else
            {
                componetInChild6.text = string.Empty;
                DebugHelper.Assert(false, string.Format("COBSystem UpdateElement hero cfg[{0}] can not be found!", heroId));
            }
            if (curTab != COBSystem.enOBTab.Local)
            {
                obj.CustomSetActive(true);
                componetInChild9.text = Singleton <CTextManager> .get_instance().GetText("OB_Desc_3", new string[]
                {
                    onlineNum.ToString()
                });

                componetInChild7.gameObject.SetActive(false);
                obj2.CustomSetActive(false);
                componetInChild8.gameObject.CustomSetActive(false);
            }
            else
            {
                obj.CustomSetActive(false);
                componetInChild7.gameObject.SetActive(true);
                DateTime dateTime = new DateTime(localTicks);
                componetInChild7.text = Singleton <CTextManager> .get_instance().GetText("OB_Desc_12", new string[]
                {
                    dateTime.get_Month().ToString(),
                    dateTime.get_Day().ToString(),
                    dateTime.get_Hour().ToString("D2"),
                    dateTime.get_Minute().ToString("D2")
                });

                obj2.CustomSetActive(status == COBSystem.enStatus.Editor);
                componetInChild8.gameObject.CustomSetActive(true);
                ResDT_LevelCommonInfo pvpMapCommonInfo = CLevelCfgLogicManager.GetPvpMapCommonInfo(mapType, mapId);
                if (pvpMapCommonInfo != null)
                {
                    componetInChild8.text = pvpMapCommonInfo.szName;
                }
                else
                {
                    componetInChild8.text = string.Empty;
                }
                componetInChild6.text = string.Empty;
            }
        }
コード例 #21
0
        public static void InitConfirmBox(GameObject root, int PlayerNum, ref RoomInfo roomInfo, CUIFormScript form)
        {
            if (root.transform.Find("Panel/Timer") != null)
            {
                CUITimerScript component = root.transform.Find("Panel/Timer").GetComponent <CUITimerScript>();
                if (component != null)
                {
                    component.EndTimer();
                    component.StartTimer();
                }
            }
            if (root.transform.Find("Panel/Panel/Timer") != null)
            {
                CUITimerScript component2 = root.transform.Find("Panel/Panel/Timer").GetComponent <CUITimerScript>();
                if (component2 != null)
                {
                    component2.EndTimer();
                    component2.StartTimer();
                }
            }
            Transform       transform  = root.transform.Find("Panel/Panel/stateGroup");
            GridLayoutGroup component3 = transform.GetComponent <GridLayoutGroup>();

            if (component3)
            {
                component3.set_constraintCount((PlayerNum == 6) ? 3 : 5);
            }
            bool flag = roomInfo.roomAttrib.bPkAI == 2;
            int  num  = (!roomInfo.roomAttrib.bWarmBattle && flag) ? (PlayerNum / 2) : PlayerNum;

            for (int i = 1; i <= 10; i++)
            {
                GameObject gameObject = transform.Find(string.Format("icon{0}", i)).gameObject;
                gameObject.CustomSetActive(num >= i);
            }
            int num2 = 1;

            for (COM_PLAYERCAMP cOM_PLAYERCAMP = COM_PLAYERCAMP.COM_PLAYERCAMP_1; cOM_PLAYERCAMP < COM_PLAYERCAMP.COM_PLAYERCAMP_COUNT; cOM_PLAYERCAMP++)
            {
                ListView <MemberInfo> listView = roomInfo[cOM_PLAYERCAMP];
                for (int j = 0; j < listView.Count; j++)
                {
                    MemberInfo memberInfo     = listView[j];
                    Transform  transform2     = transform.Find(string.Format("icon{0}", num2));
                    CRoleInfo  masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

                    if (!CSysDynamicBlock.bSocialBlocked)
                    {
                        if ((roomInfo.roomAttrib.bMapType == 3 && masterRoleInfo != null && (int)CLadderSystem.GetGradeDataByShowGrade((int)masterRoleInfo.m_rankGrade).bLogicGrade >= CMatchingView.ShowDefaultHeadImgStartLogicLadderLevel) || roomInfo.roomAttrib.bMapType == 5)
                        {
                            Image component4 = transform2.Find("HttpImage").GetComponent <Image>();
                            if (component4)
                            {
                                component4.SetSprite(CUIUtility.s_Sprite_Dynamic_BustPlayer_Dir + "Common_PlayerImg", form, true, false, false, false);
                            }
                        }
                        else
                        {
                            CUIHttpImageScript component5 = transform2.Find("HttpImage").GetComponent <CUIHttpImageScript>();
                            if (component5)
                            {
                                component5.SetImageUrl(Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(memberInfo.MemberHeadUrl));
                            }
                        }
                    }
                    Transform transform3 = transform.Find(string.Format("icon{0}/ready", num2));
                    if (transform3)
                    {
                        transform3.gameObject.CustomSetActive(false);
                    }
                    Transform transform4 = transform.Find(string.Format("icon{0}/unready", num2));
                    if (transform4)
                    {
                        transform4.gameObject.CustomSetActive(true);
                    }
                    num2++;
                }
            }
            Transform transform5 = root.transform.Find("Panel/Panel/TxtReadyNum");

            if (transform5)
            {
                Text component6 = transform5.GetComponent <Text>();
                if (component6)
                {
                    component6.set_text(string.Format(Singleton <CTextManager> .GetInstance().GetText("Matching_Confirm_PlayerNum"), 0, num));
                }
            }
            Transform transform6 = root.transform.Find("Panel/Panel/btnGroup/Button_Confirm");

            if (transform6)
            {
                Button component7 = transform6.GetComponent <Button>();
                component7.set_interactable(true);
            }
        }
コード例 #22
0
        private static void SetExpInfo(GameObject root, CUIFormScript formScript)
        {
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo();

            DebugHelper.Assert(masterRoleInfo != null, "can't find roleinfo");
            if (masterRoleInfo != null)
            {
                ResAcntPvpExpInfo dataByKey = GameDataMgr.acntPvpExpDatabin.GetDataByKey((uint)((byte)masterRoleInfo.PvpLevel));
                DebugHelper.Assert(dataByKey != null, "can't find resexp id={0}", new object[]
                {
                    masterRoleInfo.PvpLevel
                });
                if (dataByKey != null)
                {
                    Text component = root.transform.Find("PanelA/Award/Panel_PlayerExp/PvpExpNode/PvpLevelTxt").GetComponent <Text>();
                    component.set_text(string.Format("Lv.{0}", dataByKey.bLevel.ToString()));
                    Text component2 = root.transform.Find("PanelA/Award/Panel_PlayerExp/PvpExpNode/PvpExpTxt").GetComponent <Text>();
                    Text component3 = root.transform.Find("PanelA/Award/Panel_PlayerExp/PvpExpNode/ExpMax").GetComponent <Text>();
                    Text component4 = root.transform.Find("PanelA/Award/Panel_PlayerExp/PvpExpNode/PlayerName").GetComponent <Text>();
                    CUIHttpImageScript component5 = root.transform.Find("PanelA/Award/Panel_PlayerExp/PvpExpNode/HeadImage").GetComponent <CUIHttpImageScript>();
                    Image component6 = root.transform.Find("PanelA/Award/Panel_PlayerExp/PvpExpNode/NobeIcon").GetComponent <Image>();
                    Image component7 = root.transform.Find("PanelA/Award/Panel_PlayerExp/PvpExpNode/HeadFrame").GetComponent <Image>();
                    if (!CSysDynamicBlock.bSocialBlocked)
                    {
                        string headUrl = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().HeadUrl;

                        component5.SetImageUrl(headUrl);
                        MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(component6, (int)Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo().GetNobeInfo().stGameVipClient.dwCurLevel, false, true, 0uL);

                        MonoSingleton <NobeSys> .GetInstance().SetHeadIconBk(component7, (int)Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo().GetNobeInfo().stGameVipClient.dwHeadIconId);
                    }
                    else
                    {
                        MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(component6, 0, false, true, 0uL);
                    }
                    SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

                    DebugHelper.Assert(curLvelContext != null, "Battle Level Context is NULL!!");
                    GameObject gameObject = root.transform.Find("PanelA/Award/RankCon").gameObject;
                    gameObject.CustomSetActive(false);
                    if (curLvelContext.IsGameTypeLadder())
                    {
                        COMDT_RANK_SETTLE_INFO rankInfo = Singleton <BattleStatistic> .GetInstance().rankInfo;

                        if (rankInfo != null)
                        {
                            gameObject.CustomSetActive(true);
                            Text component8 = gameObject.transform.FindChild(string.Format("txtRankName", new object[0])).gameObject.GetComponent <Text>();
                            Text component9 = gameObject.transform.FindChild(string.Format("WangZheXingTxt", new object[0])).gameObject.GetComponent <Text>();
                            component8.set_text(StringHelper.UTF8BytesToString(ref CLadderSystem.GetGradeDataByShowGrade((int)rankInfo.bNowShowGrade).szGradeDesc));
                            if ((int)CLadderSystem.GetGradeDataByShowGrade((int)rankInfo.bNowShowGrade).bLogicGrade == CLadderSystem.MAX_RANK_LEVEL)
                            {
                                Transform transform = gameObject.transform.FindChild(string.Format("XingGrid/ImgScore{0}", 1));
                                if (transform != null)
                                {
                                    transform.gameObject.CustomSetActive(true);
                                }
                                component9.gameObject.CustomSetActive(true);
                                component9.set_text(string.Format("X{0}", rankInfo.dwNowScore));
                            }
                            else
                            {
                                component9.gameObject.CustomSetActive(false);
                                int num = 1;
                                while ((long)num <= (long)((ulong)rankInfo.dwNowScore))
                                {
                                    Transform transform2 = gameObject.transform.FindChild(string.Format("XingGrid/ImgScore{0}", num));
                                    if (transform2 != null)
                                    {
                                        transform2.gameObject.CustomSetActive(true);
                                    }
                                    num++;
                                }
                            }
                            root.transform.Find("PanelA/Award/Panel_PlayerExp/PvpLevelNode").gameObject.CustomSetActive(false);
                        }
                    }
                    Image component10 = root.transform.Find("PanelA/Award/Panel_PlayerExp/PvpExpNode/QQVIPIcon").GetComponent <Image>();
                    MonoSingleton <NobeSys> .GetInstance().SetMyQQVipHead(component10);

                    COMDT_ACNT_INFO acntInfo = Singleton <BattleStatistic> .GetInstance().acntInfo;

                    COMDT_REWARD_MULTIPLE_DETAIL multiDetail = Singleton <BattleStatistic> .GetInstance().multiDetail;

                    if (multiDetail != null)
                    {
                        StringBuilder stringBuilder = new StringBuilder();
                        int           multiple      = CUseable.GetMultiple(acntInfo.dwPvpSettleBaseExp, ref multiDetail, 15, -1);
                        if (multiple > 0)
                        {
                            COMDT_MULTIPLE_DATA[] array = null;
                            uint     multipleInfo       = CUseable.GetMultipleInfo(out array, ref multiDetail, 15, -1);
                            string[] array2             = new string[multipleInfo + 2u];
                            string   text = multiple.ToString();
                            array2[0] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_1", new string[]
                            {
                                text
                            });

                            if (array != null)
                            {
                                int num2 = 0;
                                while ((long)num2 < (long)((ulong)multipleInfo))
                                {
                                    string text2 = string.Empty;
                                    if ((ulong)acntInfo.dwPvpSettleBaseExp * (ulong)((long)array[num2].iValue) > 0uL)
                                    {
                                        text2 = "+";
                                    }
                                    byte bOperator = array[num2].bOperator;
                                    if (bOperator != 0)
                                    {
                                        if (bOperator != 1)
                                        {
                                            text2 += "0";
                                        }
                                        else
                                        {
                                            text2 += (long)((ulong)acntInfo.dwPvpSettleBaseExp * (ulong)((long)array[num2].iValue) / 10000uL);
                                        }
                                    }
                                    else
                                    {
                                        text2 += array[num2].iValue;
                                    }
                                    switch (array[num2].iType)
                                    {
                                    case 1:
                                        array2[num2 + 1] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_6", new string[]
                                        {
                                            text2
                                        });

                                        break;

                                    case 2:
                                        if (masterRoleInfo.HasVip(16))
                                        {
                                            array2[num2 + 1] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_9", new string[]
                                            {
                                                text2
                                            });
                                        }
                                        else
                                        {
                                            array2[num2 + 1] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_3", new string[]
                                            {
                                                text2
                                            });
                                        }
                                        break;

                                    case 3:
                                        array2[num2 + 1] = string.Format(Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_4"), text2, masterRoleInfo.GetExpWinCount(), Math.Ceiling((double)((float)masterRoleInfo.GetExpExpireHours() / 24f)));
                                        break;

                                    case 4:
                                        array2[num2 + 1] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_2", new string[]
                                        {
                                            masterRoleInfo.dailyPvpCnt.ToString(),
                                            text2
                                        });

                                        break;

                                    case 5:
                                        array2[num2 + 1] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_13", new string[]
                                        {
                                            text2
                                        });

                                        break;

                                    case 6:
                                        array2[num2 + 1] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_15", new string[]
                                        {
                                            text2
                                        });

                                        break;

                                    case 7:
                                        array2[num2 + 1] = Singleton <CTextManager> .instance.GetText("Daily_Quest_FirstVictoryName", new string[]
                                        {
                                            text2
                                        });

                                        break;

                                    case 8:
                                        array2[num2 + 1] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_16", new string[]
                                        {
                                            text2
                                        });

                                        break;

                                    case 9:
                                        array2[num2 + 1] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_14", new string[]
                                        {
                                            text2
                                        });

                                        break;

                                    case 10:
                                        array2[num2 + 1] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_21", new string[]
                                        {
                                            text2
                                        });

                                        break;

                                    case 11:
                                        array2[num2 + 1] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_17", new string[]
                                        {
                                            text2
                                        });

                                        break;

                                    case 12:
                                        array2[num2 + 1] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_18", new string[]
                                        {
                                            text2
                                        });

                                        break;

                                    case 13:
                                        array2[num2 + 1] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_20", new string[]
                                        {
                                            text2
                                        });

                                        break;

                                    case 14:
                                        array2[num2 + 1] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_19", new string[]
                                        {
                                            text2
                                        });

                                        break;
                                    }
                                    num2++;
                                }
                            }
                            stringBuilder.Append(array2[0]);
                            for (int i = 1; i < array2.Length; i++)
                            {
                                if (!string.IsNullOrEmpty(array2[i]))
                                {
                                    stringBuilder.Append("\n");
                                    stringBuilder.Append(array2[i]);
                                }
                            }
                            GameObject gameObject2 = root.transform.Find("PanelA/Award/Panel_PlayerExp/PvpExpNode/DoubleExp").gameObject;
                            gameObject2.CustomSetActive(true);
                            gameObject2.GetComponentInChildren <Text>().set_text(string.Format("+{0}", text));
                            CUICommonSystem.SetCommonTipsEvent(formScript, gameObject2, stringBuilder.ToString(), enUseableTipsPos.enLeft);
                        }
                        else
                        {
                            GameObject gameObject3 = root.transform.Find("PanelA/Award/Panel_PlayerExp/PvpExpNode/DoubleExp").gameObject;
                            gameObject3.CustomSetActive(false);
                        }
                        GameObject gameObject4 = root.transform.Find("PanelA/Award/ItemAndCoin/Panel_Gold/GoldMax").gameObject;
                        if (Singleton <BattleStatistic> .GetInstance().acntInfo.bReachDailyLimit > 0)
                        {
                            gameObject4.CustomSetActive(true);
                        }
                        else
                        {
                            gameObject4.CustomSetActive(false);
                        }
                        int multiple2 = CUseable.GetMultiple(acntInfo.dwPvpSettleBaseCoin, ref multiDetail, 11, -1);
                        if (multiple2 > 0)
                        {
                            COMDT_MULTIPLE_DATA[] array3 = null;
                            uint     multipleInfo2       = CUseable.GetMultipleInfo(out array3, ref multiDetail, 11, -1);
                            string[] array4 = new string[multipleInfo2 + 2u];
                            string   text3  = multiple2.ToString();
                            array4[0] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_7", new string[]
                            {
                                text3
                            });

                            if (array3 != null)
                            {
                                int num3 = 0;
                                while ((long)num3 < (long)((ulong)multipleInfo2))
                                {
                                    string text4 = string.Empty;
                                    if ((ulong)acntInfo.dwPvpSettleBaseCoin * (ulong)((long)array3[num3].iValue) > 0uL)
                                    {
                                        text4 = "+";
                                    }
                                    byte bOperator2 = array3[num3].bOperator;
                                    if (bOperator2 != 0)
                                    {
                                        if (bOperator2 != 1)
                                        {
                                            text4 += "0";
                                        }
                                        else
                                        {
                                            text4 += (long)((ulong)acntInfo.dwPvpSettleBaseCoin * (ulong)((long)array3[num3].iValue) / 10000uL);
                                        }
                                    }
                                    else
                                    {
                                        text4 += array3[num3].iValue;
                                    }
                                    switch (array3[num3].iType)
                                    {
                                    case 1:
                                        array4[num3 + 1] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_6", new string[]
                                        {
                                            text4
                                        });

                                        break;

                                    case 2:
                                        if (masterRoleInfo.HasVip(16))
                                        {
                                            array4[num3 + 1] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_9", new string[]
                                            {
                                                text4
                                            });
                                        }
                                        else
                                        {
                                            array4[num3 + 1] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_3", new string[]
                                            {
                                                text4
                                            });
                                        }
                                        break;

                                    case 3:
                                        array4[num3 + 1] = string.Format(Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_10"), text4, masterRoleInfo.GetCoinWinCount(), Math.Ceiling((double)((float)masterRoleInfo.GetCoinExpireHours() / 24f)));
                                        break;

                                    case 4:
                                        array4[num3 + 1] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_2", new string[]
                                        {
                                            masterRoleInfo.dailyPvpCnt.ToString(),
                                            text4
                                        });

                                        break;

                                    case 5:
                                        array4[num3 + 1] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_13", new string[]
                                        {
                                            text4
                                        });

                                        break;

                                    case 6:
                                        array4[num3 + 1] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_15", new string[]
                                        {
                                            text4
                                        });

                                        break;

                                    case 7:
                                        array4[num3 + 1] = Singleton <CTextManager> .instance.GetText("Daily_Quest_FirstVictoryName", new string[]
                                        {
                                            text4
                                        });

                                        break;

                                    case 8:
                                        array4[num3 + 1] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_16", new string[]
                                        {
                                            text4
                                        });

                                        break;

                                    case 9:
                                        array4[num3 + 1] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_14", new string[]
                                        {
                                            text4
                                        });

                                        break;

                                    case 10:
                                        array4[num3 + 1] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_21", new string[]
                                        {
                                            text4
                                        });

                                        break;

                                    case 11:
                                        array4[num3 + 1] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_17", new string[]
                                        {
                                            text4
                                        });

                                        break;

                                    case 12:
                                        array4[num3 + 1] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_18", new string[]
                                        {
                                            text4
                                        });

                                        break;

                                    case 13:
                                        array4[num3 + 1] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_20", new string[]
                                        {
                                            text4
                                        });

                                        break;

                                    case 14:
                                        array4[num3 + 1] = Singleton <CTextManager> .instance.GetText("Pvp_settle_Common_Tips_19", new string[]
                                        {
                                            text4
                                        });

                                        break;
                                    }
                                    num3++;
                                }
                            }
                            stringBuilder.Append(array4[0]);
                            for (int j = 1; j < array4.Length; j++)
                            {
                                if (!string.IsNullOrEmpty(array4[j]))
                                {
                                    stringBuilder.Append("\n");
                                    stringBuilder.Append(array4[j]);
                                }
                            }
                            stringBuilder.Remove(0, stringBuilder.get_Length());
                            stringBuilder.Append(array4[0]);
                            for (int k = 1; k < array4.Length; k++)
                            {
                                if (!string.IsNullOrEmpty(array4[k]))
                                {
                                    stringBuilder.Append("\n");
                                    stringBuilder.Append(array4[k]);
                                }
                            }
                            GameObject gameObject5 = root.transform.Find("PanelA/Award/ItemAndCoin/Panel_Gold/DoubleCoin").gameObject;
                            gameObject5.CustomSetActive(true);
                            gameObject5.GetComponentInChildren <Text>().set_text(string.Format("+{0}", text3));
                            CUICommonSystem.SetCommonTipsEvent(formScript, gameObject5, stringBuilder.ToString(), enUseableTipsPos.enLeft);
                        }
                        else
                        {
                            GameObject gameObject6 = root.transform.Find("PanelA/Award/ItemAndCoin/Panel_Gold/DoubleCoin").gameObject;
                            gameObject6.CustomSetActive(false);
                        }
                    }
                    component4.set_text(masterRoleInfo.Name);
                    RectTransform component11 = root.transform.Find("PanelA/Award/Panel_PlayerExp/PvpExpNode/PvpExpSliderBg/BasePvpExpSlider").gameObject.GetComponent <RectTransform>();
                    RectTransform component12 = root.transform.Find("PanelA/Award/Panel_PlayerExp/PvpExpNode/PvpExpSliderBg/AddPvpExpSlider").gameObject.GetComponent <RectTransform>();
                    if (acntInfo != null)
                    {
                        if (acntInfo.dwPvpSettleExp > 0u)
                        {
                            Singleton <CSoundManager> .GetInstance().PostEvent("UI_count_jingyan", null);
                        }
                        int num4 = (int)(acntInfo.dwPvpExp - acntInfo.dwPvpSettleExp);
                        if (num4 < 0)
                        {
                            CSettlementView._lvUpGrade = acntInfo.dwPvpLv;
                        }
                        else
                        {
                            CSettlementView._lvUpGrade = 0u;
                        }
                        float num5 = Mathf.Max(0f, (float)num4 / dataByKey.dwNeedExp);
                        float num6 = Mathf.Max(0f, ((num4 < 0) ? acntInfo.dwPvpExp : acntInfo.dwPvpSettleExp) / dataByKey.dwNeedExp);
                        root.transform.FindChild("PanelA/Award/Panel_PlayerExp/PvpExpNode/AddPvpExpTxt").GetComponent <Text>().set_text((acntInfo.dwPvpSettleExp > 0u) ? string.Format("+{0}", acntInfo.dwPvpSettleExp).ToString() : string.Empty);
                        if (acntInfo.dwPvpSettleExp == 0u)
                        {
                            root.transform.FindChild("PanelA/Award/Panel_PlayerExp/PvpExpNode/Bar2").gameObject.CustomSetActive(false);
                        }
                        component11.sizeDelta         = new Vector2(num5 * 327.6f, component11.sizeDelta.y);
                        component12.sizeDelta         = new Vector2(num5 * 327.6f, component12.sizeDelta.y);
                        CSettlementView._expFrom      = num5;
                        CSettlementView._expTo        = num5 + num6;
                        CSettlementView._expTweenRect = component12;
                        component11.gameObject.CustomSetActive(num4 >= 0);
                        component3.set_text((acntInfo.bExpDailyLimit > 0) ? Singleton <CTextManager> .GetInstance().GetText("GetExp_Limit") : string.Empty);
                        component2.set_text(string.Format("{0}/{1}", acntInfo.dwPvpExp.ToString(), dataByKey.dwNeedExp.ToString()));
                    }
                }
            }
        }
コード例 #23
0
    public void UpdateListElenment(GameObject element, CMail mail)
    {
        int                currentUTCTime = CRoleInfo.GetCurrentUTCTime();
        Text               component      = element.transform.FindChild("Title").GetComponent <Text>();
        Text               text2          = element.transform.FindChild("MailTime").GetComponent <Text>();
        GameObject         gameObject     = element.transform.FindChild("New").gameObject;
        GameObject         obj3           = element.transform.FindChild("ReadMailIcon").gameObject;
        GameObject         obj4           = element.transform.FindChild("UnReadMailIcon").gameObject;
        GameObject         obj5           = element.transform.FindChild("CoinImg").gameObject;
        Text               text3          = element.transform.FindChild("From").GetComponent <Text>();
        CUIHttpImageScript script         = element.transform.FindChild("HeadBg/imgHead").GetComponent <CUIHttpImageScript>();

        component.text = mail.subject;
        text2.text     = Utility.GetTimeBeforString((long)mail.sendTime, (long)currentUTCTime);
        bool bActive = mail.mailState == COM_MAIL_STATE.COM_MAIL_UNREAD;

        gameObject.CustomSetActive(bActive);
        if (mail.mailType == COM_MAIL_TYPE.COM_MAIL_SYSTEM)
        {
            obj3.CustomSetActive(!bActive);
            obj4.CustomSetActive(bActive);
            text3.text = string.Empty;
            script.gameObject.CustomSetActive(false);
            obj5.SetActive(false);
        }
        else if (mail.mailType == COM_MAIL_TYPE.COM_MAIL_FRIEND)
        {
            obj3.CustomSetActive(false);
            obj4.CustomSetActive(false);
            text3.text = mail.from;
            script.gameObject.CustomSetActive(true);
            if (mail.subType == 3)
            {
                obj5.CustomSetActive(false);
                script.SetImageSprite(CGuildHelper.GetGuildHeadPath(), this.m_CUIForm);
            }
            else
            {
                obj5.CustomSetActive(true);
                if (!CSysDynamicBlock.bFriendBlocked)
                {
                    COMDT_FRIEND_INFO comdt_friend_info = Singleton <CFriendContoller> .instance.model.getFriendByName(mail.from, CFriendModel.FriendType.GameFriend);

                    if (comdt_friend_info == null)
                    {
                        comdt_friend_info = Singleton <CFriendContoller> .instance.model.getFriendByName(mail.from, CFriendModel.FriendType.SNS);
                    }
                    if (comdt_friend_info != null)
                    {
                        string url = Utility.UTF8Convert(comdt_friend_info.szHeadUrl);
                        script.SetImageUrl(Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(url));
                    }
                }
            }
        }
        else if (mail.mailType == COM_MAIL_TYPE.COM_MAIL_FRIEND_INVITE)
        {
            obj3.CustomSetActive(false);
            obj4.CustomSetActive(false);
            text3.text = string.Empty;
            script.gameObject.CustomSetActive(true);
            obj5.SetActive(false);
            if (!CSysDynamicBlock.bFriendBlocked)
            {
                COMDT_FRIEND_INFO comdt_friend_info2 = Singleton <CFriendContoller> .instance.model.getFriendByName(mail.from, CFriendModel.FriendType.GameFriend);

                if (comdt_friend_info2 == null)
                {
                    comdt_friend_info2 = Singleton <CFriendContoller> .instance.model.getFriendByName(mail.from, CFriendModel.FriendType.SNS);
                }
                if (comdt_friend_info2 != null)
                {
                    string str2 = Utility.UTF8Convert(comdt_friend_info2.szHeadUrl);
                    script.SetImageUrl(Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(str2));
                }
            }
        }
    }
コード例 #24
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);
                }
            }
        }
コード例 #25
0
        private static void ShowReward(CUIFormScript belongForm, COMDT_SETTLE_RESULT_DETAIL settleData)
        {
            if (Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo() == null)
            {
                return;
            }
            GameObject gameObject  = belongForm.transform.Find("Root/Panel_Award/Award/ItemAndCoin/Panel_Gold").gameObject;
            Text       component   = gameObject.transform.Find("GoldNum").gameObject.GetComponent <Text>();
            GameObject gameObject2 = gameObject.transform.Find("GoldMax").gameObject;

            if (settleData.stAcntInfo.bReachDailyLimit > 0)
            {
                gameObject2.CustomSetActive(true);
            }
            else
            {
                gameObject2.CustomSetActive(false);
            }
            component.text = "0";
            COMDT_REWARD_DETAIL stReward   = settleData.stReward;
            COMDT_ACNT_INFO     stAcntInfo = settleData.stAcntInfo;

            if (stAcntInfo != null)
            {
                GameObject         gameObject3 = belongForm.transform.FindChild("Root/Panel_Award/Award/Panel_PlayerExp/PvpExpNode").gameObject;
                Text               component2  = gameObject3.transform.FindChild("PvpExpTxt").gameObject.GetComponent <Text>();
                Text               component3  = gameObject3.transform.FindChild("AddPvpExpTxt").gameObject.GetComponent <Text>();
                RectTransform      component4  = gameObject3.transform.FindChild("PvpExpSliderBg/BasePvpExpSlider").gameObject.GetComponent <RectTransform>();
                RectTransform      component5  = gameObject3.transform.FindChild("PvpExpSliderBg/AddPvpExpSlider").gameObject.GetComponent <RectTransform>();
                Text               component6  = gameObject3.transform.FindChild("PlayerName").gameObject.GetComponent <Text>();
                CUIHttpImageScript component7  = gameObject3.transform.FindChild("HeadImage").gameObject.GetComponent <CUIHttpImageScript>();
                Text               component8  = gameObject3.transform.FindChild("PvpLevelTxt").gameObject.GetComponent <Text>();
                Image              component9  = gameObject3.transform.FindChild("NobeIcon").gameObject.GetComponent <Image>();
                MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(component9, (int)Singleton <CRoleInfoManager> .get_instance().GetMasterRoleInfo().GetNobeInfo().stGameVipClient.dwCurLevel, false);

                Image component10 = gameObject3.transform.FindChild("HeadFrame").gameObject.GetComponent <Image>();
                MonoSingleton <NobeSys> .GetInstance().SetHeadIconBk(component10, (int)Singleton <CRoleInfoManager> .get_instance().GetMasterRoleInfo().GetNobeInfo().stGameVipClient.dwHeadIconId);

                component8.text = string.Format("Lv.{0}", stAcntInfo.dwPvpLv.ToString());
                ResAcntPvpExpInfo dataByKey   = GameDataMgr.acntPvpExpDatabin.GetDataByKey((uint)((byte)stAcntInfo.dwPvpLv));
                GameObject        gameObject4 = gameObject3.transform.FindChild("ExpMax").gameObject;
                if (stAcntInfo.bExpDailyLimit == 0)
                {
                    gameObject4.CustomSetActive(false);
                }
                component2.text = string.Format("{0}/{1}", stAcntInfo.dwPvpExp, dataByKey.dwNeedExp);
                component3.text = string.Format("+{0}", stAcntInfo.dwPvpSettleExp);
                CUICommonSystem.AppendMultipleText(component3, CUseable.GetMultiple(stAcntInfo.dwPvpSettleBaseExp, ref settleData.stMultipleDetail, 15, -1));
                component6.text = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().Name;

                string headUrl = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().HeadUrl;

                if (!CSysDynamicBlock.bLobbyEntryBlocked)
                {
                    component7.SetImageUrl(headUrl);
                }
                if (stAcntInfo.dwPvpSettleExp > 0u)
                {
                    Singleton <CSoundManager> .GetInstance().PostEvent("UI_count_jingyan", null);
                }
                float num = 0f;
                if (stAcntInfo.dwPvpExp < stAcntInfo.dwPvpSettleExp)
                {
                    component4.sizeDelta     = new Vector2(num * 260f, component4.sizeDelta.y);
                    PVESettleView._lvUpGrade = stAcntInfo.dwPvpLv;
                }
                else
                {
                    num = (stAcntInfo.dwPvpExp - stAcntInfo.dwPvpSettleExp) / dataByKey.dwNeedExp;
                    component4.sizeDelta     = new Vector2(num * 260f, component4.sizeDelta.y);
                    PVESettleView._lvUpGrade = 0u;
                }
                float expTo = stAcntInfo.dwPvpExp / dataByKey.dwNeedExp;
                PVESettleView._expFrom      = num;
                PVESettleView._expTo        = expTo;
                component5.sizeDelta        = new Vector2(num * 260f, component5.sizeDelta.y);
                PVESettleView._expTweenRect = component5;
                PVESettleView._coinFrom     = 0f;
                PVESettleView._coinTo       = 0f;
                for (int i = 0; i < (int)stReward.bNum; i++)
                {
                    COMDT_REWARD_INFO cOMDT_REWARD_INFO = stReward.astRewardDetail[i];
                    byte bType = cOMDT_REWARD_INFO.bType;
                    if (bType == 11)
                    {
                        PVESettleView._coinTo    = cOMDT_REWARD_INFO.stRewardInfo.dwPvpCoin;
                        PVESettleView._coinMulti = settleData.stMultipleDetail;
                    }
                }
                PVESettleView._coinTweenText = component;
                PVESettleView.DoCoinAndExpTween();
            }
            ListView <COMDT_REWARD_INFO> listView = new ListView <COMDT_REWARD_INFO>();
            GameObject gameObject5 = belongForm.transform.Find("Root/Panel_Award/Award/Panel_QQVIPGold").gameObject;

            if (gameObject5 != null)
            {
                gameObject5.CustomSetActive(false);
            }
            GameObject gameObject6 = belongForm.transform.Find("Root/Panel_Award/Award/ItemAndCoin/FirstGain").gameObject;

            if (gameObject6 != null)
            {
                gameObject6.CustomSetActive(false);
            }
            for (int j = 0; j < (int)stReward.bNum; j++)
            {
                COMDT_REWARD_INFO cOMDT_REWARD_INFO = stReward.astRewardDetail[j];
                byte bType = cOMDT_REWARD_INFO.bType;
                if (bType != 6)
                {
                    if (bType == 11)
                    {
                        CUICommonSystem.AppendMultipleText(component, CUseable.GetMultiple(stAcntInfo.dwPvpSettleBaseCoin, ref settleData.stMultipleDetail, 0, -1));
                        if (gameObject5 != null)
                        {
                            gameObject5.CustomSetActive(false);
                            Text       component11 = gameObject5.transform.FindChild("Text_Value").gameObject.GetComponent <Text>();
                            GameObject gameObject7 = gameObject5.transform.FindChild("Icon_QQVIP").gameObject;
                            GameObject gameObject8 = gameObject5.transform.FindChild("Icon_QQSVIP").gameObject;
                            gameObject7.CustomSetActive(false);
                            gameObject8.CustomSetActive(false);
                            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

                            uint qqVipExtraCoin = CUseable.GetQqVipExtraCoin(cOMDT_REWARD_INFO.stRewardInfo.dwPvpCoin, ref settleData.stMultipleDetail, 0);
                            if (masterRoleInfo != null && qqVipExtraCoin > 0u)
                            {
                                component11.text = string.Format("+{0}", qqVipExtraCoin);
                                if (masterRoleInfo.HasVip(16))
                                {
                                    gameObject5.CustomSetActive(true);
                                    gameObject8.CustomSetActive(true);
                                }
                                else if (masterRoleInfo.HasVip(1))
                                {
                                    gameObject5.CustomSetActive(true);
                                    gameObject7.CustomSetActive(true);
                                }
                            }
                            gameObject5.CustomSetActive(false);
                        }
                    }
                }
                else
                {
                    listView.Add(stReward.astRewardDetail[j]);
                    if (gameObject6 != null)
                    {
                        gameObject6.CustomSetActive(false);
                    }
                }
            }
            GameObject gameObject9 = belongForm.transform.Find("Root/Panel_Award/Award/ItemAndCoin/itemCell").gameObject;

            gameObject9.CustomSetActive(false);
            if (listView.get_Count() > 0)
            {
                Text component12 = gameObject9.transform.FindChild("ItemName").gameObject.GetComponent <Text>();
                gameObject9.CustomSetActive(true);
                COMDT_REWARD_INFO cOMDT_REWARD_INFO = listView.get_Item(0);
                PVESettleView.SetItemEtcCell(belongForm, gameObject9, component12, cOMDT_REWARD_INFO, settleData);
            }
        }