// 接受消息 public override void OnMessage(WndMsgID msgID, UIMsgData msgData) { switch (msgID) { case WndMsgID.WND_MSG_CHICKUPGRADEBUTTON_RETURN: { SetVisible(true); if (m_wndView == null) { return; } UIMsgCmdData uiHeroInfo = (UIMsgCmdData)msgData; cmd_entity_hero_diff_expend cmdData = IntPtrHelper.toData <cmd_entity_hero_diff_expend>(uiHeroInfo.ptrParam); m_wndView.setHeroUpStarInfo(cmdData); } break; case WndMsgID.WND_MSG_UPGRADESTARSUCESS_RESULT: { if (m_wndView == null) { return; } UIMsgCmdData uiHeroInfo = (UIMsgCmdData)msgData; cmd_Return_HeroDetail_Upgrade_Success cmdData = IntPtrHelper.toData <cmd_Return_HeroDetail_Upgrade_Success>(uiHeroInfo.ptrParam); m_wndView.showUpStarSucess(cmdData); } break; default: break; } }
public void showUpStarSucess(cmd_Return_HeroDetail_Upgrade_Success cmdInfo) { if (!IsVisible()) { return; } bool bSucess = (cmdInfo.nSucess == 1 ? true : false); if (bSucess) { UEffectManager.Instance.DestroyEffect(UEffectType.UET_EffectPrefab, ref m_effectParam); UEffectManager.Instance.CreateEffect(UEffectType.UET_EffectPrefab, ref m_effectParam); } }
public override void OnMessage(WndMsgID msgID, UIMsgData msgData) { switch (msgID) { case WndMsgID.WND_MSG_HERODETAIL_HERODETAILINFO: { HeroDetailViewData.Instance.Clear(); UIMsgCmdData uiInitHeroInfo = (UIMsgCmdData)msgData; cmd_Return_Hero_Detail_Info initHeroInfo = IntPtrHelper.toData <cmd_Return_Hero_Detail_Info>(uiInitHeroInfo.ptrParam); SetHeroDetailData(initHeroInfo.nHeroID, initHeroInfo.nPDBID); SetVisible(true); } break; case WndMsgID.WND_MSG_HERODETAIL_HERODETAILINFOREFRESH: { if (m_wndView == null) { return; } UIMsgCmdData uiRefreshHeroInfo = (UIMsgCmdData)msgData; cmd_Return_Hero_Detail_Info refreshHeroInfo = IntPtrHelper.toData <cmd_Return_Hero_Detail_Info>(uiRefreshHeroInfo.ptrParam); if (refreshHeroInfo.nHeroID != HeroDetailViewData.Instance.nHeroID || refreshHeroInfo.nPDBID != HeroDetailViewData.Instance.nReqPDBID) { return; } SetHeroDetailData(refreshHeroInfo.nHeroID, refreshHeroInfo.nPDBID); m_wndView.OnBuyOrChangeHeroSuccess(); } break; case WndMsgID.WND_MSG_CHICKUPGRADEBUTTON_RETURN: { if (m_wndView == null) { return; } UIMsgCmdData uiHeroInfo = (UIMsgCmdData)msgData; cmd_entity_hero_diff_expend cmdData = IntPtrHelper.toData <cmd_entity_hero_diff_expend>(uiHeroInfo.ptrParam); m_wndView.OnRecvHeroDiffInfo(cmdData); } break; case WndMsgID.WND_MSG_UPGRADESTARSUCESS_RESULT: { if (m_wndView == null) { return; } if (!this.IsVisible()) { return; } UIMsgCmdData uiHeroUpStarInfo = (UIMsgCmdData)msgData; cmd_Return_HeroDetail_Upgrade_Success cmdUpStarData = IntPtrHelper.toData <cmd_Return_HeroDetail_Upgrade_Success>(uiHeroUpStarInfo.ptrParam); m_wndView.ShowUpStarSucess(cmdUpStarData); } break; case WndMsgID.WND_MSG_HEROSKINVIEW_UPDATESKINDATA: { if (m_wndView == null) { return; } m_wndView.OnBuyOrChangeHeroSuccess(); } break; case WndMsgID.WND_MSG_HERODETAIL_HERODETAILXPUPDATE: { if (m_wndView == null) { return; } m_wndView.UpdateXPSkillList(); } break; case WndMsgID.WND_MSG_HEROPREVIEWFRAME_GETHEROINFO: { if (m_wndView != null) { // 购买卡牌,卡牌数据主动更新 int nHeroID = HeroDetailViewData.Instance.nHeroID; IntPtrHelper helper = new IntPtrHelper(); cmd_get_hero_detail_info data = new cmd_get_hero_detail_info(); data.nHeroID = nHeroID; data.nStarLv = 1; data.nStaticLv = 1; ActorHeroInfo info = LogicDataCenter.playerSystemDataManager.GetActorAllHero(); if (info.dicEntityHeroInfo.ContainsKey(nHeroID)) { data.nStarLv = info.dicEntityHeroInfo[nHeroID].byStarLv; data.nStaticLv = info.dicEntityHeroInfo[nHeroID].nLv; } IntPtr ptr = helper.toPtr <cmd_get_hero_detail_info>(ref data); int len = Marshal.SizeOf(data); GameLogicAPI.onEntityEvent(EntityFactory.MainHeroID, (int)EntityLogicDef.ENTITY_CMD_REQ_UPGRADESTARANDHEROPRO, len, "", ptr, len); } } break; case WndMsgID.WND_MSG_HERODETAIL_UPDATEGOLD: { if (m_wndView != null && IsVisible()) { UIMsgCmdData uiData = (UIMsgCmdData)msgData; m_wndView.UpdateUpStarGoldView(uiData.nParam); } } break; case WndMsgID.WND_ID_HEROTALENTVIEW_UPDATESTATICTALENT: { if (m_wndView != null && IsVisible()) { m_wndView.OnUpdateHeroTalent(); } } break; #region 新手引导相关 case WndMsgID.WND_MSG_HERODETAIL_GUIDE_ACTIONBEGIN: { UGuideWidgetMsgData cmdData = (UGuideWidgetMsgData)msgData; if (m_wndView != null && cmdData != null) { m_wndView.GuideActionBegin(cmdData); } } break; case WndMsgID.WND_MSG_HERODETAIL_GUIDE_ACTIONEND: { UGuideWidgetMsgData cmdData = (UGuideWidgetMsgData)msgData; if (m_wndView != null && cmdData != null) { m_wndView.GuideActionEnd(cmdData); } } break; #endregion default: break; } }