Exemplo n.º 1
0
    void SetMenuListItemContent(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.name, data.id, newFlag, data.icon, data.GetName(), index, ListItemType.mItem);
        item.SetSelectmState(false);

        item.mItemClick -= OnMenuListItemClick;
        item.mItemClick += OnMenuListItemClick;
    }
Exemplo n.º 2
0
    private void ListItemOnClick(int index)
    {
        if (IsCompounding)
        {
            return;
        }
        if (index < 0 || index >= m_ItemDataList.Count)
        {
            return;
        }
        List <GameObject> items = m_LeftList.Gos;

        if (mListSelectedIndex != -1 && mListSelectedIndex < items.Count)
        {
            UICompoundWndListItem item = items[mListSelectedIndex].GetComponent <UICompoundWndListItem>();
            item.SetSelectmState(false);
        }
        if (index < items.Count)
        {
            UICompoundWndListItem item = items[index].GetComponent <UICompoundWndListItem>();
            item.SetSelectmState(true);
        }
        mListSelectedIndex = index;
        this.UpdateCurItemScriptList(this.m_ItemDataList[index].id);
        this.SelectFirstScritItem();
    }
Exemplo n.º 3
0
    void OnMenuListItemClick(int index)
    {
        if (index < 0 || index >= m_ItemDataList.Count)
        {
            return;
        }
        List <GameObject> items = FactoryReplicator.m_MenuContent.gridList.Gos;

        if (mListSelectedIndex != -1 && mListSelectedIndex < items.Count)
        {
            UICompoundWndListItem item = items[mListSelectedIndex].GetComponent <UICompoundWndListItem>();
            item.SetSelectmState(false);
        }
        if (index < items.Count)
        {
            UICompoundWndListItem item = items[index].GetComponent <UICompoundWndListItem>();
            item.SetSelectmState(true);
        }
        mListSelectedIndex = index;
        this.UpdateCurItemScriptList(this.m_ItemDataList[index].id);
        this.SelectFirstScritItem();
    }