// public void InitArenaBaseInfo() { ArenaBaseConfig cfg = ArenaConfigProvider.Instance.GetBaseConfigById(1); UnlockLevelArr[0] = cfg.MaxParterLimit[0]; UnlockLevelArr[1] = cfg.MaxParterLimit[2]; UnlockLevelArr[2] = cfg.MaxParterLimit[4]; m_MaxBattleCount = cfg.MaxBattleCount; m_BattleCd = cfg.BattleCd / 1000; }
//刷新基本信息 public void RefreshArenaBaseInfo(ArenaBaseConfig cfg) { if (cfg == null) { return; } RoleInfo role_info = LobbyClient.Instance.CurrentRole; if (role_info == null || role_info.ArenaStateInfo == null) { return; } int leftBattleCount = role_info.ArenaStateInfo.LeftFightCount; m_LeftBattleCount = leftBattleCount; if (lblCanChallengeCount != null) { lblCanChallengeCount.text = leftBattleCount + "/" + m_MaxBattleCount; } if (leftBattleCount > 0) { //倒计时 if (lblFightCountHint != null) { lblFightCountHint.color = UnityEngine.Color.white; } if (lblCanChallengeCount != null) { lblCanChallengeCount.color = UnityEngine.Color.white; } ChangeButton0State(Button0Type.Change); CanBuyFightCount(true); } else { if (lblFightCountHint != null) { lblFightCountHint.color = UnityEngine.Color.red; } if (lblCanChallengeCount != null) { lblCanChallengeCount.color = UnityEngine.Color.red; } ChangeButton0State(Button0Type.Buy); SetFightCountBuyTime(); EnableChallengeButton(false); } m_IsInCd = true; }
// 返回记录信息 void RecordInfoHandler(List <ArenaTargetInfo> RankList) { try { bool addMy = false; bool addPoint = false; int pointRank = 16; // 显示名省略号的名次 int topRank = 10; ArenaBaseConfig cg = ArenaConfigProvider.Instance.GetBaseConfigById(1); if (cg != null) { topRank = cg.QueryTopRankCount; pointRank = cg.QueryTopRankCount + cg.QueryFrontRankCount + 1; if (role.ArenaStateInfo.Rank > pointRank) { addPoint = true; } } for (int index = 0; index < RankList.Count; ++index) { if (RankList[index].Rank > topRank && addPoint) { AddPointItem(); addPoint = false; } if (RankList[index].Rank > role.ArenaStateInfo.Rank && !addMy && role.ArenaStateInfo.Rank > 0) { AddMyItem(); addMy = true; } AddItem(RankList[index]); } if (role.ArenaStateInfo.Rank < 0) { AddMyItem(); } GridSort(); curPosition = SeacherMyPosition(); } catch (Exception ex) { ArkCrossEngine.LogicSystem.LogFromGfx("[Error]:Exception:{0}\n{1}", ex.Message, ex.StackTrace); } }
// private void HandleBuyFightCount(int result, int currentTime, int curFightCount) { try { LogicSystem.EventChannelForGfx.Publish("ge_ui_connect_hint", "ui", true, false); if (result == (int)ArkCrossEngine.Network.GeneralOperationResult.LC_Succeed) { ArenaBaseConfig arenaBaseCfg = ArenaConfigProvider.Instance.GetBaseConfigById(1); if (uiPartnerPvpRightInfo != null) { uiPartnerPvpRightInfo.RefreshArenaBaseInfo(arenaBaseCfg); } } else { string CHN = StrDictionaryProvider.Instance.GetDictString(1114); LogicSystem.EventChannelForGfx.Publish("ge_screen_tip", "ui", CHN, UIScreenTipPosEnum.AlignTop, UnityEngine.Vector3.zero); } } catch (Exception ex) { ArkCrossEngine.LogicSystem.LogFromGfx("[Error]:Exception:{0}\n{1}", ex.Message, ex.StackTrace); } }
//设置玩家自己的基本信息 private void SetSelfBaseInfo() { RoleInfo role_info = LobbyClient.Instance.CurrentRole; if (role_info != null && role_info.ArenaStateInfo != null) { if (lblMyRanking != null) { string desc = role_info.ArenaStateInfo.Rank.ToString(); if (role_info.ArenaStateInfo.Rank == -1) { //-1表示未排名 desc = StrDictionaryProvider.Instance.GetDictString(1105); } lblMyRanking.text = desc; } ArenaPrizeConfig prizeCfg = GetPrizeCfg(role_info.ArenaStateInfo.Rank); if (prizeCfg != null) { if (lblRankingAwardDiamond != null) { lblRankingAwardDiamond.text = prizeCfg.Gold.ToString(); } if (lblRankingAwardMoney != null) { lblRankingAwardMoney.text = prizeCfg.Money.ToString(); } SetAwardItem(prizeCfg.Items); } else { if (lblRankingAwardDiamond != null) { lblRankingAwardDiamond.text = "0"; } if (lblRankingAwardMoney != null) { lblRankingAwardMoney.text = "0"; } if (goAwardItem != null) { NGUITools.SetActive(goAwardItem, false); } } } ArenaBaseConfig arenaBaseCfg = ArenaConfigProvider.Instance.GetBaseConfigById(1); if (arenaBaseCfg != null) { string chn_des = StrDictionaryProvider.Instance.GetDictString(1106); string desc = string.Format(chn_des, arenaBaseCfg.PrizePresentTime.Hour, arenaBaseCfg.PrizePresentTime.Minutes); if (lblAwardTime != null) { lblAwardTime.text = desc; } } if (uiPartnerPvpRightInfo != null) { uiPartnerPvpRightInfo.RefreshArenaBaseInfo(arenaBaseCfg); uiPartnerPvpRightInfo.RefreshPlayedPartner(); } }
//初始化item信息 public void InitItemInfo(ChallengeInfo info) { int maxRank = 8000; ArenaBaseConfig bc = ArenaConfigProvider.Instance.GetBaseConfigById(1); if (null != bc) { maxRank = bc.MaxRank + 1; } RoleInfo role = LobbyClient.Instance.CurrentRole; ChallengeEntityInfo challengeInfo; if (role.Guid == info.Challenger.Guid) { // 自己是挑战者 challengeInfo = info.Target; int rankUp = 0; if (info.IsChallengerSuccess) { // 挑战别人赢了 if (info.Target.Rank < 0) { // 别人未上榜 , 名次不变 rankUp = 0; } else if (info.Challenger.Rank == -1 && info.Target.Rank > 0) { //自己未上榜 别人在榜上 rankUp = maxRank - info.Target.Rank; } else { // 都在榜上 if (info.Challenger.Rank - info.Target.Rank < 0) { // 名次高于他人 ,此时名次不变 rankUp = 0; } else {//自己在榜上 ,且名次低于他人, 改变名次此时要改变名次 rankUp = info.Challenger.Rank - info.Target.Rank; } } winLabel.text = rankUp.ToString(); NGUITools.SetActive(win, true); NGUITools.SetActive(fail, false); } else {// 挑战他人失败 if (winLabel != null) { failNum.text = "0"; } NGUITools.SetActive(win, false); NGUITools.SetActive(fail, true); } } else { // 自己是被挑战者 challengeInfo = info.Challenger; if (info.IsChallengerSuccess) { // 挑战者赢了 (我输了), NGUITools.SetActive(win, false); NGUITools.SetActive(fail, true); if (winLabel != null) { int rankUp = 0; if (info.Target.Rank == -1) {// 我未上榜 rankUp = 0; } else if (info.Challenger.Rank == -1) { // 他未上榜,那么我将是未上榜的人了 下降自己的名次 rankUp = info.Target.Rank + 1; } else if (info.Target.Rank - info.Challenger.Rank > 0) { // 都在榜上,我名次低于他 名次不变 rankUp = 0; } else { // 我名次高于他 rankUp = info.Challenger.Rank - info.Target.Rank; } failNum.text = rankUp.ToString(); } } else { // 我赢了(挑战的人输了) 名次不变 NGUITools.SetActive(win, true); NGUITools.SetActive(fail, false); if (winLabel != null) { winLabel.text = "0"; } } } if (playerName != null) { playerName.text = challengeInfo.NickName; } if (playerLevel != null) { playerLevel.text = "Lv." + challengeInfo.Level.ToString(); } if (PlayerScore != null) { PlayerScore.text = challengeInfo.FightScore.ToString(); } if (heroHead != null) { Data_PlayerConfig cg = PlayerConfigProvider.Instance.GetPlayerConfigById(challengeInfo.HeroId); heroHead.spriteName = cg.m_PortraitForCell; } }