private static void ShowRewardPanel(CUIFormScript form, COMDT_RANKDETAIL data) { if (data == null) { return; } Text component = form.GetWidget(5).GetComponent <Text>(); uint num; if (data.bMaxSeasonGrade > 0) { num = (uint)data.bMaxSeasonGrade; } else { num = (uint)CLadderSystem.GetGradeDataByLogicGrade(1).bGrade; } component.set_text(Singleton <CLadderSystem> .GetInstance().GetRewardDesc((byte)num)); GameObject widget = form.GetWidget(12); CUseable skinRewardUseable = Singleton <CLadderSystem> .GetInstance().GetSkinRewardUseable(); CUICommonSystem.SetItemCell(form, widget, skinRewardUseable, true, false, false, false); GameObject widget2 = form.GetWidget(14); widget2.CustomSetActive(Singleton <CLadderSystem> .GetInstance().IsGotSkinReward()); CLadderView.ShowSeasonEndRewardPanel(form); }
public static int GetFixedPlayerRankGrade(int playerRankGrade) { if (playerRankGrade == 0) { return((int)CLadderSystem.GetGradeDataByLogicGrade(1).bGrade); } return(playerRankGrade); }
private static void GetGuildMemberGradeAndStar(GuildMemInfo guildMemInfo, out int rankGrade, out int rankStar) { if (guildMemInfo != null) { rankGrade = CLadderSystem.ConvertEloToRank(guildMemInfo.stBriefInfo.dwScoreOfRank); rankStar = CLadderSystem.GetCurXingByEloAndRankLv(guildMemInfo.stBriefInfo.dwScoreOfRank, (uint)rankGrade); } else { rankGrade = 0; rankStar = 0; } }
public static string GetRankName(byte rankGrade, uint rankClass) { ResRankGradeConf gradeDataByShowGrade = CLadderSystem.GetGradeDataByShowGrade((int)rankGrade); if (gradeDataByShowGrade == null) { return(string.Empty); } if (CLadderView.IsSuperMaster(rankGrade, rankClass)) { return(Singleton <CTextManager> .GetInstance().GetText("Ladder_Super_Master")); } return(StringHelper.UTF8BytesToString(ref gradeDataByShowGrade.szGradeDesc)); }
public static string GetSubRankSmallIconPath(byte rankGrade, uint rankClass) { ResRankGradeConf gradeDataByShowGrade = CLadderSystem.GetGradeDataByShowGrade((int)rankGrade); if (gradeDataByShowGrade == null) { return(string.Empty); } if (CLadderView.IsSuperMaster(rankGrade, rankClass)) { return(CLadderView.RANK_SMALL_ICON_PATH + StringHelper.UTF8BytesToString(ref gradeDataByShowGrade.szGradeSmallPicPathSuperMaster)); } return(CLadderView.RANK_SMALL_ICON_PATH + StringHelper.UTF8BytesToString(ref gradeDataByShowGrade.szGradeSmallPicPath)); }
public static string GetRankFrameIconPath(byte rankGrade, uint rankClass) { ResRankGradeConf gradeDataByShowGrade = CLadderSystem.GetGradeDataByShowGrade((int)rankGrade); if (gradeDataByShowGrade == null || string.IsNullOrEmpty(gradeDataByShowGrade.szGradeFramePicPath)) { return(string.Empty); } if (CLadderView.IsSuperMaster(rankGrade, rankClass)) { return(CLadderView.RANK_ICON_PATH + gradeDataByShowGrade.szGradeFramePicPathSuperMaster); } return(CLadderView.RANK_ICON_PATH + gradeDataByShowGrade.szGradeFramePicPath); }
private static void GetFriendRankGradeAndStar(COMDT_FRIEND_INFO friendInfo, out int rankGrade, out int rankStar) { if (friendInfo != null && friendInfo.RankVal != null) { uint elo = friendInfo.RankVal[7]; rankGrade = CLadderSystem.ConvertEloToRank(elo); rankStar = CLadderSystem.GetCurXingByEloAndRankLv(elo, (uint)rankGrade); } else { rankGrade = 0; rankStar = 0; } }
public static string GetLadderGradeLimitText(int gradeLimit) { string result = string.Empty; int bLogicGrade = (int)CLadderSystem.GetGradeDataByShowGrade(gradeLimit).bLogicGrade; if (bLogicGrade > 1) { result = CLadderView.GetRankName((byte)gradeLimit, 0u); } else if (bLogicGrade == 1) { result = Singleton <CTextManager> .GetInstance().GetText("Guild_No_Grade_Limit_Tip"); } return(result); }
public void RefreshRankInfo() { CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CQualifyingSystem.s_qualifyingFormPath); if (form == null) { return; } CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); GameObject gameObject = form.gameObject.transform.Find("Panel/Panel_RankInfo").gameObject; Text component = gameObject.transform.Find("Panel_Top/lblName").GetComponent <Text>(); Text component2 = gameObject.transform.Find("Panel_Top/lblContent1").GetComponent <Text>(); Text component3 = gameObject.transform.Find("Panel_Top/lblContent2").GetComponent <Text>(); Text component4 = gameObject.transform.Find("Panel_Top/lblContent3").GetComponent <Text>(); Text component5 = gameObject.transform.Find("Panel_Top/lblContent4").GetComponent <Text>(); Text component6 = gameObject.transform.Find("Panel_Center/lblName").GetComponent <Text>(); CUIListScript component7 = gameObject.transform.Find("Panel_Center/List").GetComponent <CUIListScript>(); component.set_text(Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer().Name); ResRankGradeConf gradeDataByShowGrade = CLadderSystem.GetGradeDataByShowGrade((int)masterRoleInfo.m_rankGrade); component2.set_text(StringHelper.UTF8BytesToString(ref gradeDataByShowGrade.szGradeDesc)); component3.set_text(this.m_rankBaseInfo.dwSelfTotalFightCnt.ToString()); component4.set_text(this.m_rankBaseInfo.dwSelfFightWinCnt.ToString()); component5.set_text(this.m_rankBaseInfo.dwSelfScore.ToString()); component6.set_text(this.m_rankBaseInfo.dwClass.ToString() + " Area"); this.m_rankList.Sort(new Comparison <CSDT_CLASSOFRANKDETAIL>(this.SortCompare)); component7.SetElementAmount(this.m_rankList.Count); int index = 0; for (int i = 0; i < this.m_rankList.Count; i++) { if (this.m_rankList[i].stAcntUin.ullUid == masterRoleInfo.playerUllUID) { index = i; break; } } if (this.m_rankList.Count > 0) { component7.SelectElement(index, true); component7.MoveElementInScrollArea(index, true); } }
public static string GetGradeParticleBgResName() { CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); if (masterRoleInfo != null) { ResRankGradeConf gradeDataByShowGrade = CLadderSystem.GetGradeDataByShowGrade((int)masterRoleInfo.m_rankGrade); if (gradeDataByShowGrade != null) { if (CLadderView.IsSuperKing(masterRoleInfo.m_rankGrade, masterRoleInfo.m_rankClass)) { return(gradeDataByShowGrade.szGradeParticleBgSuperMaster); } return(gradeDataByShowGrade.szGradeParticleBg); } } return(string.Empty); }
private static void ShowSeasonEndRewardPanel(CUIFormScript form) { CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); if (masterRoleInfo == null) { return; } uint key; if (masterRoleInfo.m_rankSeasonHighestGrade > 0) { key = (uint)masterRoleInfo.m_rankSeasonHighestGrade; } else { key = (uint)CLadderSystem.GetGradeDataByLogicGrade(1).bGrade; } ResRankRewardConf dataByKey = GameDataMgr.rankRewardDatabin.GetDataByKey(key); if (dataByKey != null) { ListView <CUseable> listView = new ListView <CUseable>(); for (int i = 0; i < dataByKey.astRewardDetail.Length; i++) { ResDT_ChapterRewardInfo resDT_ChapterRewardInfo = dataByKey.astRewardDetail[i]; if (resDT_ChapterRewardInfo.bType != 0) { CUseable cUseable = CUseableManager.CreateUsableByServerType((RES_REWARDS_TYPE)resDT_ChapterRewardInfo.bType, (int)resDT_ChapterRewardInfo.dwNum, resDT_ChapterRewardInfo.dwID); if (cUseable != null) { listView.Add(cUseable); } } } if (listView.Count > 0) { GameObject widget = form.GetWidget(13); CUICommonSystem.SetItemCell(form, widget, listView[0], true, false, false, false); } } }
public static bool IsBuyForbiddenForRankBigGrade(uint heroId, uint skinId, out RES_RANK_LIMIT_TYPE rankLimitType, out byte rankLimitBigGrade, out ulong rankLimitParam, out bool isHaveRankBigGradeLimit) { uint skinCfgId = CSkinInfo.GetSkinCfgId(heroId, skinId); ResHeroSkinShop resHeroSkinShop; if (GameDataMgr.skinShopInfoDict.TryGetValue(skinCfgId, ref resHeroSkinShop)) { rankLimitType = (int)resHeroSkinShop.bRankLimitType; rankLimitBigGrade = resHeroSkinShop.bRankLimitGrade; rankLimitParam = resHeroSkinShop.ullRankLimitParam; switch (rankLimitType) { case 1: isHaveRankBigGradeLimit = true; return(CLadderSystem.GetRankBigGrade(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_rankGrade) < rankLimitBigGrade); case 2: isHaveRankBigGradeLimit = true; return(CLadderSystem.GetRankBigGrade(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_rankSeasonHighestGrade) < rankLimitBigGrade); case 3: isHaveRankBigGradeLimit = true; return(CLadderSystem.GetRankBigGrade(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_rankHistoryHighestGrade) < rankLimitBigGrade); case 4: isHaveRankBigGradeLimit = true; if (Singleton <CLadderSystem> .GetInstance().IsCurSeason(rankLimitParam)) { return(CLadderSystem.GetRankBigGrade(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_rankGrade) < rankLimitBigGrade); } return(CLadderSystem.GetRankBigGrade(Singleton <CLadderSystem> .GetInstance().GetHistorySeasonGrade(rankLimitParam)) < rankLimitBigGrade); } } rankLimitType = 0; rankLimitBigGrade = 0; rankLimitParam = 0uL; isHaveRankBigGradeLimit = false; return(false); }
public static bool IsBuyForbiddenForRankBigGrade(uint heroId, uint skinId, out RES_RANK_LIMIT_TYPE rankLimitType, out byte rankLimitBigGrade, out ulong rankLimitParam, out bool isHaveRankBigGradeLimit) { ResHeroSkinShop shop; uint skinCfgId = GetSkinCfgId(heroId, skinId); if (GameDataMgr.skinShopInfoDict.TryGetValue(skinCfgId, out shop)) { rankLimitType = (RES_RANK_LIMIT_TYPE)shop.bRankLimitType; rankLimitBigGrade = shop.bRankLimitGrade; rankLimitParam = shop.ullRankLimitParam; switch (rankLimitType) { case RES_RANK_LIMIT_TYPE.RES_RANK_LIMIT_CURGRADE: isHaveRankBigGradeLimit = true; return(CLadderSystem.GetRankBigGrade(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_rankGrade) < rankLimitBigGrade); case RES_RANK_LIMIT_TYPE.RES_RANK_LIMIT_SEASONGRADE: isHaveRankBigGradeLimit = true; return(CLadderSystem.GetRankBigGrade(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_rankSeasonHighestGrade) < rankLimitBigGrade); case RES_RANK_LIMIT_TYPE.RES_RANK_LIMIT_MAXGRADE: isHaveRankBigGradeLimit = true; return(CLadderSystem.GetRankBigGrade(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_rankHistoryHighestGrade) < rankLimitBigGrade); case RES_RANK_LIMIT_TYPE.RES_RANK_LIMIT_HISTORYGRADE: isHaveRankBigGradeLimit = true; if (!Singleton <CLadderSystem> .GetInstance().IsCurSeason(rankLimitParam)) { return(CLadderSystem.GetRankBigGrade(Singleton <CLadderSystem> .GetInstance().GetHistorySeasonGrade(rankLimitParam)) < rankLimitBigGrade); } return(CLadderSystem.GetRankBigGrade(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_rankGrade) < rankLimitBigGrade); } } rankLimitType = RES_RANK_LIMIT_TYPE.RES_RANK_LIMIT_NULL; rankLimitBigGrade = 0; rankLimitParam = 0L; isHaveRankBigGradeLimit = false; return(false); }
public void ShowMentorSearchInfo(COMDT_FRIEND_INFO info, CFriendModel.FriendType friendType, FriendShower.ItemType type) { enMentorState mentorState = CFriendContoller.GetMentorState(0u, null); bool bActive = UT.NeedShowGenderGradeByMentor(type, friendType) && (mentorState == enMentorState.IWantMentor || mentorState == enMentorState.IHasMentor); if (this.m_mentorTitleObj != null) { this.m_mentorTitleObj.transform.parent.gameObject.CustomSetActive(true); this.m_mentorTitleObj.gameObject.CustomSetActive(bActive); string text = string.Empty; try { text = GameDataMgr.famousMentorDatabin.GetDataByKey(info.dwMasterLvl).szTitle; } catch (Exception var_3_84) { } this.m_mentorTitleObj.GetComponent <Text>().text = text; } if (this.m_mentorFamousObj != null) { this.m_mentorFamousObj.gameObject.CustomSetActive(bActive); this.m_mentorFamousObj.text = Singleton <CTextManager> .GetInstance().GetText("Mentor_LvNApprenticeCountInfo", new string[] { info.dwMasterLvl.ToString(), info.dwStudentNum.ToString() }); } if (this.m_RankIconObj != null) { int num = CLadderSystem.ConvertEloToRank(info.RankVal[7]); CLadderView.ShowRankDetail(this.m_RankIconObj.transform.parent.gameObject, (byte)num, Singleton <RankingSystem> .GetInstance().GetRankClass(info.stUin.ullUid), 1u, false, true, false, false, true); } if (UT.NeedShowGenderGradeByMentor(type, friendType)) { this.ShowGenderType(info.bGender); } }
public void MentorBtnUIUpdate() { this.mentorStateStr = null; this.mentorBtnStr = null; CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); CPlayerProfile profile = Singleton <CPlayerInfoSystem> .instance.GetProfile(); if (!profile.isMasterData) { int bLogicGrade = (int)CLadderSystem.GetGradeDataByShowGrade((int)masterRoleInfo.m_rankHistoryHighestGrade).bLogicGrade; int bLogicGrade2 = (int)CLadderSystem.GetGradeDataByShowGrade((int)profile.GetHistoryHighestRankGrade()).bLogicGrade; enMentorState mentorState = CFriendContoller.GetMentorState((int)profile.GetHistoryHighestRankGrade(), null); enMentorState mentorState2 = CFriendContoller.GetMentorState(bLogicGrade, null); if ((mentorState == enMentorState.IHasApprentice || mentorState == enMentorState.IWantApprentice) && bLogicGrade2 > bLogicGrade) { this.mentorStateStr = Singleton <CTextManager> .GetInstance().GetText("Mentor_GetMentor"); this.mentorBtnStr = Singleton <CTextManager> .GetInstance().GetText("Mentor_ProposeMentor"); this.m_addViewtype = 2; if (masterRoleInfo.m_mentorInfo != null && masterRoleInfo.m_mentorInfo.ullMasterUid != 0uL) { this.mentorStateStr = null; } } else if ((mentorState2 == enMentorState.IHasApprentice || mentorState2 == enMentorState.IWantApprentice) && bLogicGrade2 < bLogicGrade) { this.mentorBtnStr = Singleton <CTextManager> .GetInstance().GetText("Mentor_ProposeApprentice"); this.mentorStateStr = Singleton <CTextManager> .GetInstance().GetText("Mentor_GetApprentice"); this.m_addViewtype = 3; } } }
public static bool IsReachGuildJoinLimit(int playerPvpLevel, int playerRankGrade) { GuildInfo currentGuildInfo = Singleton <CGuildModel> .GetInstance().CurrentGuildInfo; return(playerPvpLevel >= (int)currentGuildInfo.briefInfo.LevelLimit && CLadderSystem.GetGradeDataByShowGrade(CGuildHelper.GetFixedPlayerRankGrade(playerRankGrade)).bLogicGrade >= CLadderSystem.GetGradeDataByShowGrade((int)currentGuildInfo.briefInfo.GradeLimit).bLogicGrade); }
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); } }
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())); } } } }
public static void UpdateConfirmBox(GameObject root, ulong confirmPlayerUid) { RoomInfo roomInfo = Singleton <CRoomSystem> .GetInstance().roomInfo; DebugHelper.Assert(roomInfo != null, "Room Info is NULL!!!"); CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); DebugHelper.Assert(masterRoleInfo != null, "RoleInfo is NULL!!!"); int currentMapPlayerNum = Singleton <CMatchingSystem> .GetInstance().currentMapPlayerNum; int confirmPlayerNum = Singleton <CMatchingSystem> .GetInstance().confirmPlayerNum; Transform transform = root.transform.Find("Panel/Panel/stateGroup"); if (transform) { if ((roomInfo.roomAttrib.bMapType == 3 && masterRoleInfo != null && (int)CLadderSystem.GetGradeDataByShowGrade((int)masterRoleInfo.m_rankGrade).bLogicGrade >= CMatchingView.ShowDefaultHeadImgStartLogicLadderLevel && !roomInfo.roomAttrib.bWarmBattle) || roomInfo.roomAttrib.bMapType == 5) { if (masterRoleInfo.playerUllUID == confirmPlayerUid) { CUICommonSystem.SetObjActive(transform.Find(string.Format("icon{0}/ready", confirmPlayerNum)), true); CUICommonSystem.SetObjActive(transform.Find(string.Format("icon{0}/unready", confirmPlayerNum)), false); } else { CUITimerScript uITimerScript = CUICommonSystem.GetUITimerScript(transform.Find(string.Format("icon{0}", confirmPlayerNum))); if (uITimerScript != null) { uITimerScript.SetTotalTime((float)Random.Range(1, 4)); uITimerScript.SetTimerEventId(enTimerEventType.TimeUp, enUIEventID.Matchingt_ShowConfirmHead); uITimerScript.enabled = true; uITimerScript.StartTimer(); } } } else { int num = 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 i = 0; i < listView.Count; i++) { MemberInfo memberInfo = listView[i]; if (memberInfo.ullUid == confirmPlayerUid) { Transform transform2 = transform.Find(string.Format("icon{0}/ready", num)); if (transform2) { transform2.gameObject.CustomSetActive(true); } Transform transform3 = transform.Find(string.Format("icon{0}/unready", num)); if (transform3) { transform3.gameObject.CustomSetActive(false); } break; } num++; } } } } bool flag = roomInfo.roomAttrib.bPkAI == 2; int num2 = (!roomInfo.roomAttrib.bWarmBattle && flag) ? (currentMapPlayerNum / 2) : currentMapPlayerNum; Transform transform4 = root.transform.Find("Panel/Panel/TxtReadyNum"); if (transform4) { Text component = transform4.GetComponent <Text>(); if (component) { component.set_text(string.Format(Singleton <CTextManager> .GetInstance().GetText("Matching_Confirm_PlayerNum"), confirmPlayerNum, num2)); } } if (confirmPlayerUid == roomInfo.selfInfo.ullUid) { Transform transform5 = root.transform.Find("Panel/Panel/btnGroup/Button_Confirm"); if (transform5 != null) { Button component2 = transform5.GetComponent <Button>(); if (component2) { component2.set_interactable(false); } } } }
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]); }
private static void ShowBraveScorePanel(CUIFormScript form, COMDT_RANKDETAIL data, bool isShow) { CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); if (masterRoleInfo == null) { return; } GameObject widget = form.GetWidget(0); if (!isShow) { widget.CustomSetActive(false); return; } widget.CustomSetActive(true); if (data == null) { return; } ResRankGradeConf gradeDataByShowGrade = CLadderSystem.GetGradeDataByShowGrade((int)masterRoleInfo.m_rankGrade); Image component = form.GetWidget(1).GetComponent <Image>(); Text component2 = form.GetWidget(2).GetComponent <Text>(); Text component3 = form.GetWidget(3).GetComponent <Text>(); Transform transform = form.transform.FindChild("BottomPanel/BravePanel/imgKeDu"); GameObject widget2 = form.GetWidget(15); uint dwAddScoreOfConWinCnt = data.dwAddScoreOfConWinCnt; uint selfBraveScoreMax = Singleton <CLadderSystem> .GetInstance().GetSelfBraveScoreMax(); component.set_fillAmount(CLadderView.GetProcessCircleFillAmount((int)dwAddScoreOfConWinCnt, (int)selfBraveScoreMax)); component2.set_text(dwAddScoreOfConWinCnt + "/" + selfBraveScoreMax); component3.set_text(Singleton <CTextManager> .GetInstance().GetText("Ladder_Brave_Exchange_Tip", new string[] { selfBraveScoreMax.ToString() })); transform.rotation = CLadderView.GetImgKeDuRotation(gradeDataByShowGrade.dwProtectGradeScore, selfBraveScoreMax); Text component4 = form.transform.FindChild("BottomPanel/BravePanel/txtBaoJi").GetComponent <Text>(); if (dwAddScoreOfConWinCnt >= gradeDataByShowGrade.dwProtectGradeScore) { component4.set_text(Singleton <CTextManager> .GetInstance().GetText("Ladder_Brave_KeepGrade_Txt2")); component.set_color(CUIUtility.s_Color_BraveScore_BaojiKedu_On); } else { component4.set_text(Singleton <CTextManager> .GetInstance().GetText("Ladder_Brave_KeepGrade_Txt1", new string[] { (gradeDataByShowGrade.dwProtectGradeScore - dwAddScoreOfConWinCnt).ToString() })); component.set_color(CUIUtility.s_Color_BraveScore_BaojiKedu_Off); } if (data.dwContinuousWin > 0u) { widget2.CustomSetActive(true); Text component5 = widget2.GetComponent <Text>(); component5.set_text(data.dwContinuousWin + Singleton <CTextManager> .GetInstance().GetText("Common_Continues_Win")); } else { widget2.CustomSetActive(false); } }
public static void InitLadderEntry(CUIFormScript form, ref COMDT_RANKDETAIL data, bool isQualified) { Transform transform = form.transform.Find("MainPanel/BtnGroup/SingleStart"); Transform transform2 = form.transform.Find("MainPanel/BtnGroup/DoubleStart"); Transform transform3 = form.transform.Find("MainPanel/BtnGroup/FiveStart"); Button button = null; Button button2 = null; Button button3 = null; if (transform) { button = transform.GetComponent <Button>(); } if (transform2) { button2 = transform2.GetComponent <Button>(); } if (transform3) { button3 = transform3.GetComponent <Button>(); } GameObject widget = form.GetWidget(11); widget.CustomSetActive(isQualified); if (isQualified) { form.transform.Find("ReqPanel").gameObject.CustomSetActive(false); form.transform.Find("MainPanel/ImgLock").gameObject.CustomSetActive(false); form.transform.Find("MainPanel/RankCon").gameObject.CustomSetActive(true); GameObject gameObject = form.transform.Find("MainPanel/RankCon").gameObject; if (data != null) { if (button) { CUICommonSystem.SetButtonEnableWithShader(button, data.bState == 1, true); } if (button2) { CUICommonSystem.SetButtonEnableWithShader(button2, data.bState == 1, true); if (CLadderSystem.MultiLadderMaxTeamerNum() == 2) { CUICommonSystem.SetTextContent(transform2.FindChild("Text"), Singleton <CTextManager> .GetInstance().GetText("Ladder_EntryBtn_Text1")); } else { CUICommonSystem.SetTextContent(transform2.FindChild("Text"), Singleton <CTextManager> .GetInstance().GetText("Ladder_EntryBtn_Text2")); } } if (button3) { CUICommonSystem.SetButtonEnableWithShader(button3, data.bState == 1, true); } CLadderView.ShowRankDetail(gameObject, ref data, false); CUIParticleScript component = form.GetWidget(16).GetComponent <CUIParticleScript>(); component.LoadRes(CLadderView.GetGradeParticleBgResName()); } else { if (button) { CUICommonSystem.SetButtonEnableWithShader(button, false, true); } if (button2) { CUICommonSystem.SetButtonEnableWithShader(button2, false, true); } if (button3) { CUICommonSystem.SetButtonEnableWithShader(button3, false, true); } } } else { if (button) { CUICommonSystem.SetButtonEnableWithShader(button, false, true); } if (button2) { CUICommonSystem.SetButtonEnableWithShader(button2, false, true); } if (button3) { CUICommonSystem.SetButtonEnableWithShader(button3, false, true); } form.transform.Find("ReqPanel").gameObject.CustomSetActive(true); form.transform.Find("MainPanel/ImgLock").gameObject.CustomSetActive(true); form.transform.Find("MainPanel/RankCon").gameObject.CustomSetActive(false); Text component2 = form.transform.Find("ReqPanel/txtHeroNum").GetComponent <Text>(); Text component3 = form.transform.Find("ReqPanel/txtReqHeroNum").GetComponent <Text>(); int num = 0; CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); if (masterRoleInfo != null) { num = masterRoleInfo.GetHaveHeroCount(false); } component2.set_text(string.Format("{0}/{1}", num, CLadderSystem.REQ_HERO_NUM)); component3.set_text(string.Format(Singleton <CTextManager> .GetInstance().GetText("Ladder_Req_Hero_Num"), CLadderSystem.REQ_HERO_NUM.ToString())); } CLadderView.ShowBraveScorePanel(form, data, isQualified); CLadderView.ShowRewardPanel(form, data); CLadderView.ShowBpModePanel(form); CLadderView.ShowSuperKingRankPanel(form); if (CSysDynamicBlock.bLobbyEntryBlocked) { form.transform.FindChild("MainPanel/pnlRankingBtn").gameObject.CustomSetActive(false); } }
public static bool IsSuperKing(byte rankGrade, uint rankClass) { ResGlobalInfo dataByKey = GameDataMgr.globalInfoDatabin.GetDataByKey(205u); return(dataByKey != null && (int)CLadderSystem.GetGradeDataByShowGrade((int)rankGrade).bLogicGrade == CLadderSystem.MAX_RANK_LEVEL && 0u < rankClass && rankClass <= dataByKey.dwConfValue); }
public static void ShowRankDetail(GameObject go, byte rankGrade, uint rankClass, uint score, bool bShowScore = true, bool useSmall = false, bool isLadderRewardForm = false, bool isUseSpecialColorWhenSuperKing = false, bool isImgSamll = true) { DebugHelper.Assert(go != null, "GameObject is NULL!!!"); Image image = go.transform.Find("ImgRank") ? go.transform.Find("ImgRank").GetComponent <Image>() : null; Image image2 = go.transform.Find("ImgSubRank") ? go.transform.Find("ImgSubRank").GetComponent <Image>() : null; Text text = go.transform.Find("txtRankName") ? go.transform.Find("txtRankName").GetComponent <Text>() : null; Text text2 = go.transform.Find("txtTopGroupScore") ? go.transform.Find("txtTopGroupScore").GetComponent <Text>() : null; byte bLogicGrade = CLadderSystem.GetGradeDataByShowGrade((int)rankGrade).bLogicGrade; if (image) { string rankIconPath = CLadderView.GetRankIconPath(rankGrade, rankClass); string text3 = "{0}"; if (isImgSamll) { text3 += "_small"; } image.SetSprite((!useSmall) ? rankIconPath : string.Format(text3, rankIconPath), null, true, false, false, false); image.gameObject.CustomSetActive(true); } if (image2) { if (isLadderRewardForm && (int)bLogicGrade >= CLadderSystem.MAX_RANK_LEVEL) { image2.gameObject.CustomSetActive(false); } else { image2.SetSprite(CLadderView.GetSubRankIconPath(rankGrade, rankClass), null, true, false, false, false); image2.gameObject.CustomSetActive(true); } } if (text) { text.set_text(CLadderView.GetRankName(rankGrade, rankClass)); if (isUseSpecialColorWhenSuperKing && CLadderView.IsSuperKing(rankGrade, rankClass)) { text.set_text("<color=#feba29>" + text.get_text() + "</color>"); } } if (text2) { if ((int)bLogicGrade >= CLadderSystem.MAX_RANK_LEVEL) { text2.set_text(string.Format("x{0}", score)); } text2.gameObject.CustomSetActive((int)bLogicGrade >= CLadderSystem.MAX_RANK_LEVEL); } Transform transform = go.transform.Find("ScoreCon"); if (!transform) { return; } if ((int)bLogicGrade >= CLadderSystem.MAX_RANK_LEVEL || !bShowScore) { transform.gameObject.CustomSetActive(false); } else { transform.Find("Con3Star").gameObject.CustomSetActive(false); transform.Find("Con4Star").gameObject.CustomSetActive(false); transform.Find("Con5Star").gameObject.CustomSetActive(false); ResRankGradeConf gradeDataByShowGrade = CLadderSystem.GetGradeDataByShowGrade((int)rankGrade); if (gradeDataByShowGrade != null) { Transform transform2 = transform.Find(string.Format("Con{0}Star", gradeDataByShowGrade.dwGradeUpNeedScore)); if (transform2) { transform2.gameObject.CustomSetActive(true); int num = 1; while ((long)num <= (long)((ulong)gradeDataByShowGrade.dwGradeUpNeedScore)) { Image component = transform2.Find(string.Format("ImgScore{0}", num)).GetComponent <Image>(); string prefabPath = ((ulong)score >= (ulong)((long)num)) ? CLadderView.LADDER_IMG_STAR : CLadderView.LADDER_IMG_STAR_EMPTY; if (component) { component.SetSprite(prefabPath, null, true, false, false, false); } num++; } } } transform.gameObject.CustomSetActive(true); } }