private void AttrCheckStatusChanged(UICompoundSelectAttrGrid grid) { uint index = grid.Index; if (emgr.IsEquipCompoundResultOpen(index)) { if (emgr.CompoundSelectIndex != index) { if (emgr.CompoundSelectIndex != 0) { UICompoundSelectAttrGrid tempGrid = GetGridByIndex(emgr.CompoundSelectIndex); if (null != tempGrid) { tempGrid.SetSelect(false); } } emgr.SetSelectCompoundResult(index); } grid.SetSelect(true); } else { emgr.OpenEquipCompoundResult(index); } }
//全局事件处理 public void GlobalEventHandler(int eventid, object data) { switch (eventid) { case (int)Client.GameEventID.UIEVENTEQUIPCOMPOUNDOPENRESULT: { if (null != data && data is uint) { uint openIndex = (uint)data; if (openIndex >= 1 && openIndex <= 3 && null != cardArray && cardArray.Length == 3) { bool isOpen = false; UICompoundSelectAttrGrid tempGrid = null; for (int i = 0, max = cardArray.Length; i < max; i++) { tempGrid = cardArray[i]; if (null == tempGrid) { continue; } isOpen = emgr.IsEquipCompoundResultOpen(tempGrid.Index); if (tempGrid.Index == openIndex) { if (emgr.CompoundSelectIndex == tempGrid.Index) { tempGrid.SetSelect(true); } tempGrid.OpenCard(); } else if (!isOpen) { tempGrid.UpdateCloseCostStatus(false); } } } } } break; case (int)Client.GameEventID.UIEVENT_UPDATEITEM: { if (null != data && data is ItemDefine.UpdateItemPassData) { ItemDefine.UpdateItemPassData passData = (ItemDefine.UpdateItemPassData)data; if (passData.BaseId == m_assistID && null != cardArray) { UpdateAssistData(); bool freeGet = emgr.CompoundSelectIndex == 0; if (!freeGet) { UICompoundSelectAttrGrid tempGrid = null; bool isOpen = false; for (int i = 0, max = cardArray.Length; i < max; i++) { tempGrid = cardArray[i]; if (null == tempGrid) { continue; } isOpen = emgr.IsEquipCompoundResultOpen(tempGrid.Index); if (isOpen) { continue; } tempGrid.UpdateCloseCostStatus(freeGet); } } } } } break; } }