示例#1
0
        public uint PvpNeedExp()
        {
            ResAcntPvpExpInfo dataByKey = GameDataMgr.acntPvpExpDatabin.GetDataByKey((uint)((byte)this.PvpLevel()));

            if (dataByKey != null)
            {
                return(dataByKey.dwNeedExp);
            }
            return(0u);
        }
        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()));
                    }
                }
            }
        }
示例#3
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());
                    }
                }
            }
        }
示例#4
0
        public static void InitMatchingEntry(CUIFormScript form)
        {
            if (form == null)
            {
                return;
            }
            Transform transform = form.transform;

            uint[] array = new uint[23];
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_PVP_1V1"), ref array[0]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_PVP_3V3"), ref array[1]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_1V1_1"), ref array[2]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_1V1_1"), ref array[3]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_1V1_1"), ref array[4]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_3V3Team_1"), ref array[5]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_3V3Team_1"), ref array[6]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_3V3Team_1"), ref array[7]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_5V5Team_1"), ref array[8]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_5V5Team_1"), ref array[9]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_5V5Team_1"), ref array[10]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_Melee_Team_1"), ref array[11]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_Melee_Team_1"), ref array[12]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_Melee_Team_1"), ref array[13]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_PVP_5V5"), ref array[14]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_PVP_MELEE"), ref array[15]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_PVP_Fire"), ref array[16]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_PVP_5V5Clone"), ref array[17]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_PVP_5V5CD"), ref array[18]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_PVP_5V5Miwu"), ref array[19]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_5V5TeamMiwu_1"), ref array[20]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_5V5TeamMiwu_1"), ref array[21]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_5V5TeamMiwu_1"), ref array[22]);
            CUIMiniEventScript[] array2 = new CUIMiniEventScript[]
            {
                transform.Find("panelGroup2/btnGroup/Button1").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup2/btnGroup/Button2").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button1/btnGrp/Button1").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button1/btnGrp/Button2").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button1/btnGrp/Button3").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button2/btnGrp/Button1").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button2/btnGrp/Button2").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button2/btnGrp/Button3").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button4/btnGrp/Button1").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button4/btnGrp/Button2").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button4/btnGrp/Button3").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button3/btnGrp/Button1").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button3/btnGrp/Button2").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button3/btnGrp/Button3").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup2/btnGroup/Button4").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup2/btnGroup/Button3").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup5/btnGroup/Button1").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup5/btnGroup/Button3").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup5/btnGroup/Button4").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup2/btnGroup/Button5").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button5/btnGrp/Button1").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button5/btnGrp/Button2").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button5/btnGrp/Button3").GetComponent <CUIMiniEventScript>()
            };
            for (int i = 0; i < array.Length; i++)
            {
                array2[i].m_onClickEventParams.tagUInt = array[i];
                array2[i].m_onClickEventParams.tag     = (int)CMatchingView.mapDifficultyList[i];
            }
            transform.Find("panelGroup1/btnGroup/Button1").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag         = 1;
            transform.Find("panelGroup1/btnGroup/Button2").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag         = 2;
            transform.Find("panelGroup1/btnGroup/ButtonEntertain").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag = 3;
            transform.Find("panelGroup3/btnGroup/Button1").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag         = 0;
            transform.Find("panelGroup3/btnGroup/Button2").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag         = 1;
            transform.Find("panelGroup3/btnGroup/Button4").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag         = 2;
            transform.Find("panelGroup3/btnGroup/Button3").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag         = 3;
            transform.Find("panelGroup3/btnGroup/Button5").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag         = 4;
            transform.FindChild("panelGroup5/btnGroup/Button1").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag    = 0;
            transform.FindChild("panelGroup5/btnGroup/Button3").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag    = 1;
            transform.FindChild("panelGroup5/btnGroup/Button4").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag    = 2;
            CMatchingView.ShowDefaultHeadImgStartLogicLadderLevel = (int)CLadderSystem.GetGradeDataByShowGrade((int)GameDataMgr.GetGlobeValue(RES_GLOBAL_CONF_TYPE.RES_GLOBAL_CONF_TYPE_SHOW_DEFAULT_HEADIMG_START_LADDERLEVEL)).bLogicGrade;
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo == null)
            {
                return;
            }
            GameObject gameObject  = transform.FindChild("CoinAndExp/DoubleCoin").gameObject;
            GameObject gameObject2 = transform.FindChild("CoinAndExp/DoubleExp").gameObject;

            gameObject2.CustomSetActive(false);
            gameObject.CustomSetActive(false);
            masterRoleInfo.UpdateCoinAndExpValidTime();
            if (masterRoleInfo.HaveExtraCoin())
            {
                gameObject.CustomSetActive(true);
                string text  = string.Empty;
                string text2 = string.Empty;
                if (masterRoleInfo.GetCoinExpireHours() > 0)
                {
                    string text3 = Singleton <CTextManager> .GetInstance().GetText("DoubleCoinExpireTimeTips");

                    text = string.Format(text3, masterRoleInfo.GetCoinExpireHours() / 24, masterRoleInfo.GetCoinExpireHours() % 24);
                }
                if (masterRoleInfo.GetCoinWinCount() > 0u)
                {
                    string text4 = Singleton <CTextManager> .GetInstance().GetText("DoubleCoinCountWinTips");

                    text2 = string.Format(text4, masterRoleInfo.GetCoinWinCount());
                }
                if (string.IsNullOrEmpty(text))
                {
                    CUICommonSystem.SetCommonTipsEvent(form, gameObject, string.Format("{0}", text2), enUseableTipsPos.enBottom);
                }
                else if (string.IsNullOrEmpty(text2))
                {
                    CUICommonSystem.SetCommonTipsEvent(form, gameObject, string.Format("{0}", text), enUseableTipsPos.enBottom);
                }
                else
                {
                    CUICommonSystem.SetCommonTipsEvent(form, gameObject, string.Format("{0}\n{1}", text, text2), enUseableTipsPos.enBottom);
                }
            }
            if (masterRoleInfo.HaveExtraExp())
            {
                gameObject2.CustomSetActive(true);
                string text5 = string.Empty;
                string text6 = string.Empty;
                if (masterRoleInfo.GetExpExpireHours() > 0)
                {
                    text5 = string.Format(Singleton <CTextManager> .GetInstance().GetText("DoubleExpExpireTimeTips"), masterRoleInfo.GetExpExpireHours() / 24, masterRoleInfo.GetExpExpireHours() % 24);
                }
                if (masterRoleInfo.GetExpWinCount() > 0u)
                {
                    text6 = string.Format(Singleton <CTextManager> .GetInstance().GetText("DoubleExpCountWinTips"), masterRoleInfo.GetExpWinCount());
                }
                if (string.IsNullOrEmpty(text5))
                {
                    CUICommonSystem.SetCommonTipsEvent(form, gameObject2, string.Format("{0}", text6), enUseableTipsPos.enBottom);
                }
                else if (string.IsNullOrEmpty(text6))
                {
                    CUICommonSystem.SetCommonTipsEvent(form, gameObject2, string.Format("{0}", text5), enUseableTipsPos.enBottom);
                }
                else
                {
                    CUICommonSystem.SetCommonTipsEvent(form, gameObject2, string.Format("{0}\n{1}", text5, text6), enUseableTipsPos.enBottom);
                }
            }
            if (CSysDynamicBlock.bLobbyEntryBlocked)
            {
                Transform transform2 = form.transform.Find("panelBottom/btnShop");
                if (transform2)
                {
                    transform2.gameObject.CustomSetActive(false);
                }
                Transform transform3 = form.transform.Find("CoinAndExp");
                if (transform3)
                {
                    transform3.gameObject.CustomSetActive(false);
                }
            }
            GameObject gameObject3 = form.gameObject.transform.Find("Panel").gameObject;

            gameObject3.transform.Find("Name").gameObject.GetComponent <Text>().set_text(masterRoleInfo.Name);
            ResAcntPvpExpInfo dataByKey = GameDataMgr.acntPvpExpDatabin.GetDataByKey((uint)((byte)masterRoleInfo.PvpLevel));

            DebugHelper.Assert(dataByKey != null);
            DebugHelper.Assert(dataByKey.dwNeedExp > 0u);
            GameObject gameObject4 = gameObject3.transform.Find("DegreeBarBg/bar").gameObject;

            gameObject4.GetComponent <RectTransform>().sizeDelta = new Vector2(204f * Math.Min(1f, masterRoleInfo.PvpExp * 1f / dataByKey.dwNeedExp), 19f);
            gameObject3.transform.Find("DegreeTitle").gameObject.CustomSetActive(false);
            if ((ulong)masterRoleInfo.PvpLevel >= (ulong)((long)GameDataMgr.acntPvpExpDatabin.Count()))
            {
                gameObject3.transform.Find("DegreeNum").gameObject.GetComponent <Text>().set_text(Singleton <CTextManager> .GetInstance().GetText("PVP_Level_Max"));
            }
            else
            {
                gameObject3.transform.Find("DegreeNum").gameObject.GetComponent <Text>().set_text(string.Format("{0}/{1}", masterRoleInfo.PvpExp, dataByKey.dwNeedExp));
            }
            gameObject3.transform.Find("DegreeIcon").gameObject.CustomSetActive(false);
            MonoSingleton <NewbieGuideManager> .GetInstance().CheckTriggerTime(NewbieGuideTriggerTimeType.enterPvpEntry, new uint[0]);
        }
示例#5
0
        public static void InitMatchingEntry(CUIFormScript form)
        {
            if (form != null)
            {
                Transform transform = form.transform;
                uint[]    numArray  = new uint[0x13];
                uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_PVP_1V1"), out numArray[0]);
                uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_PVP_3V3"), out numArray[1]);
                uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_1V1_1"), out numArray[2]);
                uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_1V1_1"), out numArray[3]);
                uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_1V1_1"), out numArray[4]);
                uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_3V3Team_1"), out numArray[5]);
                uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_3V3Team_1"), out numArray[6]);
                uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_3V3Team_1"), out numArray[7]);
                uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_5V5Team_1"), out numArray[8]);
                uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_5V5Team_1"), out numArray[9]);
                uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_5V5Team_1"), out numArray[10]);
                uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_Melee_Team_1"), out numArray[11]);
                uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_Melee_Team_1"), out numArray[12]);
                uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_Melee_Team_1"), out numArray[13]);
                uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_PVP_5V5"), out numArray[14]);
                uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_PVP_MELEE"), out numArray[15]);
                uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_PVP_Fire"), out numArray[0x10]);
                uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_PVP_5V5Clone"), out numArray[0x11]);
                uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_PVP_5V5CD"), out numArray[0x12]);
                CUIMiniEventScript[] scriptArray = new CUIMiniEventScript[] {
                    transform.Find("panelGroup2/btnGroup/Button1").GetComponent <CUIMiniEventScript>(), transform.Find("panelGroup2/btnGroup/Button2").GetComponent <CUIMiniEventScript>(), transform.Find("panelGroup3/btnGroup/Button1/btnGrp/Button1").GetComponent <CUIMiniEventScript>(), transform.Find("panelGroup3/btnGroup/Button1/btnGrp/Button2").GetComponent <CUIMiniEventScript>(), transform.Find("panelGroup3/btnGroup/Button1/btnGrp/Button3").GetComponent <CUIMiniEventScript>(), transform.Find("panelGroup3/btnGroup/Button2/btnGrp/Button1").GetComponent <CUIMiniEventScript>(), transform.Find("panelGroup3/btnGroup/Button2/btnGrp/Button2").GetComponent <CUIMiniEventScript>(), transform.Find("panelGroup3/btnGroup/Button2/btnGrp/Button3").GetComponent <CUIMiniEventScript>(), transform.Find("panelGroup3/btnGroup/Button4/btnGrp/Button1").GetComponent <CUIMiniEventScript>(), transform.Find("panelGroup3/btnGroup/Button4/btnGrp/Button2").GetComponent <CUIMiniEventScript>(), transform.Find("panelGroup3/btnGroup/Button4/btnGrp/Button3").GetComponent <CUIMiniEventScript>(), transform.Find("panelGroup3/btnGroup/Button3/btnGrp/Button1").GetComponent <CUIMiniEventScript>(), transform.Find("panelGroup3/btnGroup/Button3/btnGrp/Button2").GetComponent <CUIMiniEventScript>(), transform.Find("panelGroup3/btnGroup/Button3/btnGrp/Button3").GetComponent <CUIMiniEventScript>(), transform.Find("panelGroup2/btnGroup/Button4").GetComponent <CUIMiniEventScript>(), transform.Find("panelGroup2/btnGroup/Button3").GetComponent <CUIMiniEventScript>(),
                    transform.Find("panelGroup5/btnGroup/Button1").GetComponent <CUIMiniEventScript>(), transform.Find("panelGroup5/btnGroup/Button3").GetComponent <CUIMiniEventScript>(), transform.Find("panelGroup5/btnGroup/Button4").GetComponent <CUIMiniEventScript>()
                };
                for (int i = 0; i < numArray.Length; i++)
                {
                    scriptArray[i].m_onClickEventParams.tagUInt = numArray[i];
                    scriptArray[i].m_onClickEventParams.tag     = (int)mapDifficultyList[i];
                }
                transform.Find("panelGroup1/btnGroup/Button1").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag         = 1;
                transform.Find("panelGroup1/btnGroup/Button2").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag         = 2;
                transform.Find("panelGroup1/btnGroup/ButtonEntertain").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag = 3;
                transform.Find("panelGroup3/btnGroup/Button1").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag         = 0;
                transform.Find("panelGroup3/btnGroup/Button2").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag         = 1;
                transform.Find("panelGroup3/btnGroup/Button4").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag         = 2;
                transform.Find("panelGroup3/btnGroup/Button3").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag         = 3;
                transform.FindChild("panelGroup5/btnGroup/Button1").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag    = 0;
                transform.FindChild("panelGroup5/btnGroup/Button3").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag    = 1;
                transform.FindChild("panelGroup5/btnGroup/Button4").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag    = 2;
                CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

                if (masterRoleInfo != null)
                {
                    GameObject gameObject = transform.FindChild("CoinAndExp/DoubleCoin").gameObject;
                    GameObject obj3       = transform.FindChild("CoinAndExp/DoubleExp").gameObject;
                    obj3.CustomSetActive(false);
                    gameObject.CustomSetActive(false);
                    masterRoleInfo.UpdateCoinAndExpValidTime();
                    if (masterRoleInfo.HaveExtraCoin())
                    {
                        gameObject.CustomSetActive(true);
                        string str  = string.Empty;
                        string str2 = string.Empty;
                        if (masterRoleInfo.GetCoinExpireHours() > 0)
                        {
                            str = string.Format(Singleton <CTextManager> .GetInstance().GetText("DoubleCoinExpireTimeTips"), masterRoleInfo.GetCoinExpireHours() / 0x18, masterRoleInfo.GetCoinExpireHours() % 0x18);
                        }
                        if (masterRoleInfo.GetCoinWinCount() > 0)
                        {
                            str2 = string.Format(Singleton <CTextManager> .GetInstance().GetText("DoubleCoinCountWinTips"), masterRoleInfo.GetCoinWinCount());
                        }
                        if (string.IsNullOrEmpty(str))
                        {
                            CUICommonSystem.SetCommonTipsEvent(form, gameObject, string.Format("{0}", str2), enUseableTipsPos.enBottom);
                        }
                        else if (string.IsNullOrEmpty(str2))
                        {
                            CUICommonSystem.SetCommonTipsEvent(form, gameObject, string.Format("{0}", str), enUseableTipsPos.enBottom);
                        }
                        else
                        {
                            CUICommonSystem.SetCommonTipsEvent(form, gameObject, string.Format("{0}\n{1}", str, str2), enUseableTipsPos.enBottom);
                        }
                    }
                    if (masterRoleInfo.HaveExtraExp())
                    {
                        obj3.CustomSetActive(true);
                        string str5 = string.Empty;
                        string str6 = string.Empty;
                        if (masterRoleInfo.GetExpExpireHours() > 0)
                        {
                            str5 = string.Format(Singleton <CTextManager> .GetInstance().GetText("DoubleExpExpireTimeTips"), masterRoleInfo.GetExpExpireHours() / 0x18, masterRoleInfo.GetExpExpireHours() % 0x18);
                        }
                        if (masterRoleInfo.GetExpWinCount() > 0)
                        {
                            str6 = string.Format(Singleton <CTextManager> .GetInstance().GetText("DoubleExpCountWinTips"), masterRoleInfo.GetExpWinCount());
                        }
                        if (string.IsNullOrEmpty(str5))
                        {
                            CUICommonSystem.SetCommonTipsEvent(form, obj3, string.Format("{0}", str6), enUseableTipsPos.enBottom);
                        }
                        else if (string.IsNullOrEmpty(str6))
                        {
                            CUICommonSystem.SetCommonTipsEvent(form, obj3, string.Format("{0}", str5), enUseableTipsPos.enBottom);
                        }
                        else
                        {
                            CUICommonSystem.SetCommonTipsEvent(form, obj3, string.Format("{0}\n{1}", str5, str6), enUseableTipsPos.enBottom);
                        }
                    }
                    if (CSysDynamicBlock.bLobbyEntryBlocked)
                    {
                        Transform transform2 = form.transform.Find("panelBottom/btnShop");
                        if (transform2 != null)
                        {
                            transform2.gameObject.CustomSetActive(false);
                        }
                        Transform transform3 = form.transform.Find("CoinAndExp");
                        if (transform3 != null)
                        {
                            transform3.gameObject.CustomSetActive(false);
                        }
                    }
                    GameObject obj4 = form.gameObject.transform.Find("Panel").gameObject;
                    obj4.transform.Find("Name").gameObject.GetComponent <Text>().text = masterRoleInfo.Name;
                    ResAcntPvpExpInfo dataByKey = GameDataMgr.acntPvpExpDatabin.GetDataByKey((uint)((byte)masterRoleInfo.PvpLevel));
                    DebugHelper.Assert(dataByKey != null);
                    DebugHelper.Assert(dataByKey.dwNeedExp > 0);
                    obj4.transform.Find("DegreeBarBg/bar").gameObject.GetComponent <RectTransform>().sizeDelta = new Vector2(204f * Math.Min((float)1f, (float)((masterRoleInfo.PvpExp * 1f) / ((float)dataByKey.dwNeedExp))), 19f);
                    obj4.transform.Find("DegreeTitle").gameObject.CustomSetActive(false);
                    if (masterRoleInfo.PvpLevel >= GameDataMgr.acntPvpExpDatabin.Count())
                    {
                        obj4.transform.Find("DegreeNum").gameObject.GetComponent <Text>().text = Singleton <CTextManager> .GetInstance().GetText("PVP_Level_Max");
                    }
                    else
                    {
                        obj4.transform.Find("DegreeNum").gameObject.GetComponent <Text>().text = string.Format("{0}/{1}", masterRoleInfo.PvpExp, dataByKey.dwNeedExp);
                    }
                    obj4.transform.Find("DegreeIcon").gameObject.CustomSetActive(false);
                    MonoSingleton <NewbieGuideManager> .GetInstance().CheckTriggerTime(NewbieGuideTriggerTimeType.enterPvpEntry, new uint[0]);
                }
            }
        }
示例#6
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);
            }
        }