// 战场玩家信息更新 public void updatePersonInfo(ulong pdbid, EWarPersonInfoUpdateType updateType, IntPtrVaArgParseHelper helper) { WarPersonInfo person; if (recordInfoArry.TryGetValue(pdbid, out person) == false) { Debug.LogWarning("recordInfoArry.ContainsKey(pdbid) == false, pdbid=" + pdbid); return; } switch (updateType) { case EWarPersonInfoUpdateType.EWPTUT_VOCATION: { person.nHeroId = helper.getInt(); person.nSkinID = helper.getInt(); Debug.Log("战场人物数据更新:英雄ID=" + person.nHeroId + ",皮肤=" + person.nSkinID); // 更新头像 UIWarUpdateHeroIcon uiMsgData = new UIWarUpdateHeroIcon(); uiMsgData.msgID = (int)WndMsgID.WND_MSG_WAR_UPDATE_HEROICON; uiMsgData.nHeroID = person.nHeroId; uiMsgData.nSkinID = person.nSkinID; uiMsgData.nPdbid = pdbid; UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_WAR_UPDATE_HEROICON, uiMsgData); } break; default: break; } }
public void updateHeroIcon(UIWarUpdateHeroIcon uiMsgData) { int nSlotId = LogicDataCenter.recordTableDataManager.getIndexAcordPDBID(uiMsgData.nPdbid); TeammateViewItem myTeamItem; if (m_dicMyTeam.TryGetValue(nSlotId, out myTeamItem)) { myTeamItem.HeroIconImage.sprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_HeadPortrait, WndID.WND_ID_WAR_TEAMRIGHTVIEW, 1, 6, uiMsgData.nHeroID); } }
public void updateHeroIcon(UIWarUpdateHeroIcon data) { BattleWarPlayerRecordInfo playerRecordInfo = null; if (playerRecordInfoList.TryGetValue(data.nPdbid, out playerRecordInfo)) { WarRecordTableDataManager.WarPersonInfo playerInfo = LogicDataCenter.recordTableDataManager.getWarPersonInfoByPDBID(data.nPdbid); if (playerInfo != null) { playerRecordInfo.updateHeroIcon(data.nHeroID, data.nSkinID); } } }
// 接收消息 public override void OnMessage(WndMsgID msgID, UIMsgData msgData) { saveCacheUIMsg(msgID, msgData); switch (msgID) { case WndMsgID.WND_MSG_RECORDTABLE_FIGHTING_SETPLAYERINFOINIT: { if (m_wndView == null) { return; } m_wndView.initWarRecordTable(); } break; //case WndMsgID.WND_MSG_RECORDTABLE_FIGHTING_BOSSCDTIME: // { // BossCdTime uiInfo = (BossCdTime)msgData; // if (m_wndView == null) // { // return; // } // m_wndView.SetTeamBossReliveTime(uiInfo.nIndex, uiInfo.nTime); // } // break; case WndMsgID.WND_MSG_COMMON_BATTLESTATE_LEAVE: case WndMsgID.WND_MSG_COMMON_WAREND: { if (m_wndView != null) { this.UnloadView(); } m_CacheUIMsgList.Clear(); } break; case WndMsgID.WND_MSG_COMMON_BATTLESTATE_ENTER: { if (m_wndView == null) { this.LoadView(); } // 运行缓存的消息 runCacheUIMsg(); } break; case WndMsgID.WND_MSG_RECORDTABLE_FIGHTING_UPDATERECORDINFO: { if (m_wndView == null) { return; } m_wndView.showRecordTable(); } break; case WndMsgID.WND_MSG_WARRELIVETIME_SHOWRELIVETIME: { if (m_wndView == null) { return; } UIWarShowReliveTimeData data = msgData as UIWarShowReliveTimeData; m_wndView.setHeroDieCountdown((ulong)data.pdbid, data.nReliveTime); } break; case WndMsgID.WND_MSG_RECORDTABLE_FIGHTING_SWITCH_WND: { switchTabWnd(); } break; case WndMsgID.WND_MSG_WAR_UPDATE_HEROICON: { if (m_wndView == null) { return; } UIWarUpdateHeroIcon data = msgData as UIWarUpdateHeroIcon; m_wndView.updateHeroIcon(data); } break; default: break; } }