public int AddItemsOfCategory(ItemDataBlock.ItemCategory category, List <BlueprintDataBlock> checkList, int yPos)
 {
     if (this.AnyOfCategoryInList(category, checkList))
     {
         GameObject obj2 = NGUITools.AddChild(base.gameObject, this.CategoryHeaderPrefab);
         obj2.transform.localPosition = new Vector3(0f, (float)yPos, -1f);
         obj2.GetComponentInChildren <UILabel>().text = category.ToString();
         yPos -= 0x10;
         foreach (BlueprintDataBlock block in checkList)
         {
             if (block.resultItem.category == category)
             {
                 GameObject go = NGUITools.AddChild(base.gameObject, this.ItemPlaquePrefab);
                 go.GetComponentInChildren <UILabel>().text = block.resultItem.name;
                 go.transform.localPosition = new Vector3(10f, (float)yPos, -1f);
                 UIEventListener listener1 = UIEventListener.Get(go);
                 listener1.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(listener1.onClick, new UIEventListener.VoidDelegate(this.craftWindow.ItemClicked));
                 go.GetComponent <RPOSCraftItemEntry>().actualItemDataBlock = block.resultItem;
                 go.GetComponent <RPOSCraftItemEntry>().blueprint           = block;
                 go.GetComponent <RPOSCraftItemEntry>().craftWindow         = this.craftWindow;
                 go.GetComponent <RPOSCraftItemEntry>().SetSelected(false);
                 yPos -= 0x10;
             }
         }
     }
     return(yPos);
 }
Пример #2
0
    public bool AnyOfCategoryInList(ItemDataBlock.ItemCategory category, List <BlueprintDataBlock> checkList)
    {
        bool flag;

        List <BlueprintDataBlock> .Enumerator enumerator = checkList.GetEnumerator();
        try
        {
            while (enumerator.MoveNext())
            {
                BlueprintDataBlock current = enumerator.Current;
                if (current != null)
                {
                    if (current.resultItem.category != category)
                    {
                        continue;
                    }
                    flag = true;
                    return(flag);
                }
                else
                {
                    Debug.Log("WTFFFF");
                    flag = false;
                    return(flag);
                }
            }
            return(false);
        }
        finally
        {
            ((IDisposable)(object)enumerator).Dispose();
        }
        return(flag);
    }
 public bool AnyOfCategoryInList(ItemDataBlock.ItemCategory category, List <BlueprintDataBlock> checkList)
 {
     foreach (BlueprintDataBlock block in checkList)
     {
         if (block == null)
         {
             Debug.Log("WTFFFF");
             return(false);
         }
         if (block.resultItem.category == category)
         {
             return(true);
         }
     }
     return(false);
 }
 public void AddItemCategoryHeader(ItemDataBlock.ItemCategory category)
 {
 }