//int[] m_ProductItemList = null; //List<int> m_NeedShowItem = new List<int>(1); void SetLeftListContent(int index, GameObject go) { UICompoundWndListItem item = go.GetComponent <UICompoundWndListItem>(); if (item == null) { return; } if (index < 0 || index >= m_ItemDataList.Count) { return; } ItemProto data = m_ItemDataList[index]; if (!this.m_Formulas.ContainsKey(data.id)) { return; } //lz-2016.08.08 有任何可以合成这个Item的新脚本就标记为new bool newFlag = this.m_Formulas[data.id].Any(a => a.flag == true); item.SetItem(data.GetName(), data.id, newFlag, data.icon, data.GetName(), index, ListItemType.mItem); item.SetSelectmState(false); //lz-2017.01.16 错误 #8503 item颜色不正确 item.SetTextColor(Color.white); item.mItemClick -= ListItemOnClick; item.mItemClick += ListItemOnClick; }
//lz-2016.08.08 点击ScriptItem事件 private void ScriptItemEvent(int itemID, int scriptIndex) { if (!this.m_Formulas.ContainsKey(itemID) || scriptIndex >= this.m_Formulas[itemID].Count || scriptIndex < 0) { return; } //更改new的状态 Pathea.Replicator.KnownFormula knownFornula = this.m_Formulas[itemID][scriptIndex]; Pathea.Replicator r = replicator; if (null != r) { r.SetKnownFormulaFlag(knownFornula.id); } //颜色根据选的脚本改变 List <GameObject> ListItems = m_LeftList.Gos; if (mListSelectedIndex >= 0 && mListSelectedIndex < ListItems.Count) { Pathea.Replicator.Formula formula = knownFornula.Get(); bool isInColony = (formula.workSpace != 0) ? true : false; Color textColor = isInColony ? Color.red : Color.white; UICompoundWndListItem listItem = ListItems[mListSelectedIndex].GetComponent <UICompoundWndListItem>(); listItem.SetTextColor(textColor); } //绘制当前选择的脚本和Item bool ok = ReDrawGraph(itemID, scriptIndex); if (ok) { AddGraphResetList(itemID); SetBottomInfo(); QueryGridItems(itemID); } }