public void init(int index, List <MemberBattleInfo> dataList, BattleMaxInfo maxInfo, double co_op, long teamDam, long teamBeDam, double teamKill) { this.AchiSprite = Resources.Load <GameObject>("Prefab/UI/Achievement/AchiSprite"); if (index % 2 == 0) { this.Bg.color = new Color32(0, 32, 23, 255); } else { this.Bg.color = new Color32(0, 38, 27, 255); } this.SetInfo(dataList[index], maxInfo, co_op, teamDam, teamBeDam, teamKill); switch (index) { case 0: { UIWidget arg_C0_0 = this.Number; Color color = new Color32(0, 183, 168, 255); this.Bar.color = color; arg_C0_0.color = color; break; } case 1: { UIWidget arg_F8_0 = this.Number; Color color = new Color32(201, 133, 0, 255); this.Bar.color = color; arg_F8_0.color = color; break; } case 2: { UIWidget arg_12D_0 = this.Number; Color color = new Color32(6, 121, 218, 255); this.Bar.color = color; arg_12D_0.color = color; break; } case 3: { UIWidget arg_163_0 = this.Number; Color color = new Color32(179, 56, 32, 255); this.Bar.color = color; arg_163_0.color = color; break; } case 4: { UIWidget arg_199_0 = this.Number; Color color = new Color32(175, 11, 119, 255); this.Bar.color = color; arg_199_0.color = color; break; } } }
private void SetInfo(MemberBattleInfo rankData, BattleMaxInfo maxInfo) { this.achi.Clear(); double num = 0.0; SysHeroMainVo heroMainData = BaseDataMgr.instance.GetHeroMainData(rankData.heroId); this.portrait.mainTexture = ResourceManager.Load <Texture>(heroMainData.avatar_icon, true, true, null, 0, false); this.Name.text = rankData.userName; string b = ModelManager.Instance.Get_userData_filed_X("UserId"); string text = ModelManager.Instance.Get_userData_filed_X("NickName"); if (rankData.userId == b) { this.BG.color = new Color32(0, 39, 53, 255); this.Name.text = text; this.Name.color = new Color32(224, 178, 39, 255); } else { this.BG.color = new Color32(0, 25, 34, 255); this.Name.color = Color.white; } this.Name.gameObject.GetComponent <AllochroicLabelChecker>().StoreLabelStyle(true); this.Name.gameObject.GetComponent <AllochroicLabelChecker>().RenderLabel(rankData.CharmRankvalue); if (rankData.playercounter != null) { if (rankData.playercounter.allDamage == maxInfo.maxDamage && rankData.playercounter.allDamage != 0L) { this.achi.Add(13, 1); } if (rankData.playercounter.allBeDamage == maxInfo.maxBedamage && rankData.playercounter.allBeDamage != 0L) { this.achi.Add(12, 1); } int killMonsterCount = rankData.playercounter.killMonsterCount; if (killMonsterCount == maxInfo.maxMonsterKill && killMonsterCount != 0) { this.achi.Add(10, 1); } if (rankData.playercounter.killTowerCount == maxInfo.maxTower && rankData.playercounter.killTowerCount != 0) { this.achi.Add(11, 1); } if (rankData.playercounter.allmoney == maxInfo.maxMoney) { double value = (double)rankData.playercounter.allmoney / 1000.0; value = Math.Round(value, 1); this.Money.text = "[00ff42]" + value.ToString("F1") + "K[-]"; this.achi.Add(9, 1); } else { double value = (double)rankData.playercounter.allmoney / 1000.0; value = Math.Round(value, 1); this.Money.text = "[0075a6]" + value.ToString("F1") + "K[-]"; } string text2; if (rankData.playercounter.killHoreCount == maxInfo.maxK && rankData.playercounter.killHoreCount != 0) { this.achi.Add(7, 1); text2 = "[ffc000]" + rankData.playercounter.killHoreCount.ToString() + "[-]"; } else { text2 = "[0075a6]" + rankData.playercounter.killHoreCount.ToString() + "[-]"; } string text3; if (rankData.playercounter.deadCount == maxInfo.maxD) { text3 = "[ffc000]" + rankData.playercounter.deadCount.ToString() + "[-]"; } else { text3 = "[0075a6]" + rankData.playercounter.deadCount.ToString() + "[-]"; } string text4; if (rankData.playercounter.helpKillHoreCount == maxInfo.maxA && rankData.playercounter.helpKillHoreCount != 0) { this.achi.Add(8, 1); text4 = "[ffc000]" + rankData.playercounter.helpKillHoreCount.ToString() + "[-]"; } else { text4 = "[0075a6]" + rankData.playercounter.helpKillHoreCount.ToString() + "[-]"; } this.KDA.text = string.Concat(new string[] { text2, "[0075a6]/[-]", text3, "[0075a6]/[-]", text4 }); if (rankData.playercounter.deadCount == 0) { num = (double)(rankData.playercounter.killHoreCount + rankData.playercounter.helpKillHoreCount) / 1.0 * 3.0; } else { num = (double)(rankData.playercounter.killHoreCount + rankData.playercounter.helpKillHoreCount) / (double)rankData.playercounter.deadCount * 3.0; } } else { UILabel arg_4F6_0 = this.Money; string empty = string.Empty; this.KDA.text = empty; arg_4F6_0.text = empty; } num = Math.Round(num, 1); if (num == maxInfo.maxEvaluate && num != 0.0) { this.Evaluate.text = "[ffc000]" + num.ToString("F1") + "[-]"; } else { this.Evaluate.text = "[0075a6]" + num.ToString("F1") + "[-]"; } if (rankData.isWin) { this.LightLine.spriteName = "Data_statistics_team_green"; if (rankData == maxInfo.maxMVP) { this.Mvp.gameObject.SetActive(true); } else { this.Mvp.gameObject.SetActive(false); } } else { this.LightLine.spriteName = "Data_statistics_team_red"; this.Mvp.gameObject.SetActive(false); } this.UpdateEquipmentList(rankData); if (rankData.playercounter != null) { this.Achieve(rankData.playercounter); } }
public void init(int index, List <MemberBattleInfo> dataList, BattleMaxInfo maxInfo) { this.AchiSprite = Resources.Load <GameObject>("Prefab/UI/Achievement/AchiSprite"); this.SetInfo(dataList[index], maxInfo); }
private void SetInfo(MemberBattleInfo rankData, BattleMaxInfo maxInfo, double co_op, long teamDam, long teamBeDam, double teamKill) { this.achi.Clear(); this.MVP.gameObject.SetActive(false); SysHeroMainVo heroMainData = BaseDataMgr.instance.GetHeroMainData(rankData.heroId); this.Portrait.mainTexture = ResourceManager.Load <Texture>(heroMainData.avatar_icon, true, true, null, 0, false); if (rankData.playercounter != null) { if (rankData.playercounter.killTowerCount == maxInfo.maxTower && maxInfo.maxTower != 0) { this.achi.Add(11, 1); } if (rankData.playercounter.allmoney == maxInfo.maxMoney) { double value = (double)rankData.playercounter.allmoney / 1000.0; value = Math.Round(value, 1); this.Money.text = "[ffe400]" + value.ToString("F1") + "K[-]"; this.achi.Add(9, 1); } else { double value = (double)rankData.playercounter.allmoney / 1000.0; value = Math.Round(value, 1); this.Money.text = "[bba85b]" + value.ToString("F1") + "K[-]"; } string text; if (rankData.playercounter.killHoreCount == maxInfo.maxK && rankData.playercounter.killHoreCount != 0) { this.achi.Add(7, 1); text = "[ffe400]" + rankData.playercounter.killHoreCount.ToString() + "[-]"; } else { text = "[bba85b]" + rankData.playercounter.killHoreCount.ToString() + "[-]"; } string text2; if (rankData.playercounter.deadCount == maxInfo.maxD) { text2 = "[ffe400]" + rankData.playercounter.deadCount.ToString() + "[-]"; } else { text2 = "[bba85b]" + rankData.playercounter.deadCount.ToString() + "[-]"; } string text3; if (rankData.playercounter.helpKillHoreCount == maxInfo.maxA && rankData.playercounter.helpKillHoreCount != 0) { this.achi.Add(8, 1); text3 = "[ffe400]" + rankData.playercounter.helpKillHoreCount.ToString() + "[-]"; } else { text3 = "[bba85b]" + rankData.playercounter.helpKillHoreCount.ToString() + "[-]"; } this.KDA.text = string.Concat(new string[] { text, "[bba85b]/[-]", text2, "[bba85b]/[-]", text3 }); double num; if (rankData.playercounter.deadCount == 0) { num = (double)(rankData.playercounter.killHoreCount + rankData.playercounter.helpKillHoreCount) / 1.0 * 3.0; } else { num = (double)(rankData.playercounter.killHoreCount + rankData.playercounter.helpKillHoreCount) / (double)rankData.playercounter.deadCount * 3.0; } num = Math.Round(num, 1); if (num == maxInfo.maxEvaluate && num != 0.0) { this.Evaluate.text = "[ffe400]" + num.ToString("F1") + "[-]"; } else { this.Evaluate.text = "[bba85b]" + num.ToString("F1") + "[-]"; } float num2 = 0f; if (teamDam != 0L) { num2 = (float)rankData.playercounter.allDamage / (float)teamDam * 100f; } if (rankData.playercounter.allDamage == maxInfo.maxDamage && maxInfo.maxDamage != 0L) { this.achi.Add(13, 1); this.Damage.text = "[ffe400]" + rankData.playercounter.allDamage.ToString(); } else { this.Damage.text = "[bba85b]" + rankData.playercounter.allDamage.ToString(); } this.DamagePer.text = "(" + num2.ToString("F0") + "%)"; float num3 = 0f; if (teamBeDam != 0L) { num3 = (float)rankData.playercounter.allBeDamage / (float)teamBeDam * 100f; } if (rankData.playercounter.allBeDamage == maxInfo.maxBedamage && maxInfo.maxBedamage != 0L) { this.achi.Add(12, 1); this.BeDamage.text = "[ffe400]" + rankData.playercounter.allBeDamage.ToString() + "[-]"; this.BeDamagePer.text = "(" + num3.ToString("F0") + "%)"; } else { this.BeDamage.text = "[bba85b]" + rankData.playercounter.allBeDamage.ToString(); this.BeDamagePer.text = "(" + num3.ToString("F0") + "%)"; } if (rankData.playercounter.killMonsterCount == maxInfo.maxMonsterKill && maxInfo.maxMonsterKill != 0) { this.achi.Add(10, 1); this.MonstersKill.text = "[ffe400]" + rankData.playercounter.killMonsterCount.ToString() + "[-]"; } else { this.MonstersKill.text = "[bba85b]" + rankData.playercounter.killMonsterCount.ToString() + "[-]"; } double num4 = (double)(rankData.playercounter.killHoreCount + rankData.playercounter.helpKillHoreCount) / teamKill * 100.0; this.Number.text = num4.ToString("F0") + "%"; this.Number.text = ((!(this.Number.text == "NaN%")) ? this.Number.text : "0%"); this.Bar.width = (int)(num4 / co_op * 226.0); } else { UILabel arg_73A_0 = this.Money; string text4 = string.Empty; this.Number.text = text4; text4 = text4; this.MonstersKill.text = text4; text4 = text4; this.BeDamagePer.text = text4; text4 = text4; this.BeDamage.text = text4; text4 = text4; this.Damage.text = text4; text4 = text4; this.Evaluate.text = text4; text4 = text4; this.KDA.text = text4; arg_73A_0.text = text4; } if (rankData.isWin) { this.LightLine.spriteName = "Data_statistics_team_green"; this.Name.text = rankData.userName; this.Name.color = new Color32(0, 198, 154, 255); } else { this.LightLine.spriteName = "Data_statistics_team_red"; this.Name.text = rankData.userName; this.Name.color = new Color32(246, 62, 62, 255); } string b = ModelManager.Instance.Get_userData_filed_X("UserId"); string text5 = ModelManager.Instance.Get_userData_filed_X("NickName"); if (rankData.userId == b) { this.Frame.gameObject.SetActive(true); this.Name.text = text5; if (rankData.isWin) { Singleton <AchievementView> .Instance.dtl_vectory.spriteName = "Settlement_images_win"; } else { Singleton <AchievementView> .Instance.dtl_vectory.spriteName = "Settlement_images_lose"; } } else { this.Frame.gameObject.SetActive(false); } if (rankData.isWin && rankData == maxInfo.maxMVP) { this.MVP.gameObject.SetActive(true); } this.Name.gameObject.GetComponent <AllochroicLabelChecker>().StoreLabelStyle(true); this.Name.gameObject.GetComponent <AllochroicLabelChecker>().RenderLabel(rankData.CharmRankvalue); string stringById = LanguageManager.Instance.GetStringById(Singleton <FriendView> .Instance.GetState((int)rankData.ladderScore)); this.Grade.text = ((stringById.Length <= 4) ? stringById.Substring(2, 2) : stringById.Substring(2, 3)); if (rankData.playercounter != null) { this.Achieve(rankData.playercounter); } }