void OnEeventAddBuff(int eventID, Client.stAddBuff state) { BuffDataBase db = GameTableManager.Instance.GetTableItem <BuffDataBase>(state.buffid); if (db != null) { if (db.dwShield == 1) {//不显示的直接跳过 return; } } if (ClientGlobal.Instance().IsMainPlayer(state.uid)) { mainRoleBuffList.Insert(0, state); stShowBuffInfo info = new stShowBuffInfo(); info.IsMainRole = true; DataManager.Manager <UIPanelManager>().SendMsg(PanelID.MainPanel, UIMsgID.stShowBuff, info); } else { Client.IEntity target = ClientGlobal.Instance().GetControllerSystem().GetActiveCtrl().GetCurTarget(); if (target != null) { if (target.GetUID() == state.uid) { targetBuffList.Insert(0, state); stShowBuffInfo info = new stShowBuffInfo(); info.IsMainRole = false; DataManager.Manager <UIPanelManager>().SendMsg(PanelID.MainPanel, UIMsgID.stShowBuff, info); } } } }
void OnEventRemoveBuff(int eventID, stRemoveBuff param) { if (ClientGlobal.Instance().IsMainPlayer(param.uid)) { for (int i = 0; i < mainRoleBuffList.Count; i++) { Client.stAddBuff st = (Client.stAddBuff)mainRoleBuffList[i]; if (st.buffThisID == param.buffThisID) { mainRoleBuffList.RemoveAt(i); break; } } stShowBuffInfo info = new stShowBuffInfo(); info.IsMainRole = true; DataManager.Manager <UIPanelManager>().SendMsg(PanelID.MainPanel, UIMsgID.stShowBuff, info); } else { for (int i = 0; i < targetBuffList.Count; i++) { Client.stAddBuff st = (Client.stAddBuff)targetBuffList[i]; if (st.buffThisID == param.buffThisID && st.uid == param.uid) { targetBuffList.RemoveAt(i); break; } } stShowBuffInfo info = new stShowBuffInfo(); info.IsMainRole = false; DataManager.Manager <UIPanelManager>().SendMsg(PanelID.MainPanel, UIMsgID.stShowBuff, info); } }
public override bool OnMsg(UIMsgID msgid, object param) { if (msgid == UIMsgID.eSetRoleProperty)//添加主角的时候刷新界面 { // Client.IEntity entity = (Client.IEntity)param; Client.IEntity entity = param as Client.IEntity; if (entity != null) { //SetRoleHp(entity); //SetRoleMp(entity); //SetRoleExp(entity); //SetRolePkModel(entity); //if (m_label_lablePower != null) //{ // m_label_lablePower.text = entity.GetProp((int)FightCreatureProp.Power).ToString(); //} SetRoleHpMpExpPkPower(entity); } } else if (msgid == UIMsgID.stShowBuff) { stShowBuffInfo info = (stShowBuffInfo)param; if (info.IsMainRole) { ArrayList list = DataManager.Manager <BuffDataManager>().MainRoleBuffList; RefreshBuffIcon(m_trans_MainRoleBUffContainer, list); ShowBuffInfo(m_trans_MainRoleBUffContainer, true); } else { ArrayList list = DataManager.Manager <BuffDataManager>().TargetBuffList; RefreshBuffIcon(m_trans_TargetBUffContainer, list); ShowBuffInfo(m_trans_TargetBUffContainer, false); } } else if (msgid == UIMsgID.eRefreshEnemyList) { GameCmd.stEnmityDataUserCmd_S cmd = (GameCmd.stEnmityDataUserCmd_S)param; OnEnemyList(cmd); } else if (msgid == UIMsgID.eShowCopyInfo) { stCopyInfo info = (stCopyInfo)param; ShowFBWidgetUI(info.bShow, info.bShowBattleInfoBtn); } else if (msgid == UIMsgID.eSkillBtnRefresh) {//走新手引导 OnUIEvent SetSkillIcon(); } else if (msgid == UIMsgID.eSkillChangeState) { LearnSkillDataManager data = DataManager.Manager <LearnSkillDataManager>(); if (m_widget_SkillBtns != null) { Quaternion rotation = m_widget_SkillBtns.transform.localRotation; if (data.CurState == SkillSettingState.StateTwo) { m_widget_SkillBtns.transform.DORotate(new Vector3(0, 0, 125), rotTime); } else { m_widget_SkillBtns.transform.DORotate(new Vector3(0, 0, 0), rotTime); } SetPlayerSkillIcon(); uint stateSkill = data.GetCurStateSkillIDByJob(); ExecutePublicCD(stateSkill); } data.SetCurStateSkillList(); } else if (msgid == UIMsgID.eSkillShowPetSkill) { if (m_lstSkillBtns.Count > 9) { m_lstSkillBtns[9].Refresh(); } } else if (msgid == UIMsgID.eShortcutList) { InitShortcutGrid();//快捷使用道具 } else if (msgid == UIMsgID.eShortcutRect) { Vector3 pos = (Vector3)param; PointInRectEvent(pos); } else if (msgid == UIMsgID.eShortcutRect) { Vector3 pos = (Vector3)param; PointInRectEvent(pos); } else if (msgid == UIMsgID.eRefreshNpcBelong) { stRefreshNPCBelongParam data = (stRefreshNPCBelongParam)param; UpdateTargetStatus(data.npcid, data.teamid, data.ownerid, data.clanid, data.ownerName); } else if (msgid == UIMsgID.eAnswerState) { InitAnswerUI(); } return(true); }