예제 #1
0
    public override void UpdateUI()
    {
        ItemTable.ItemData itemData = Singleton <ItemTable> .I.GetItemData(createData.needMaterial[0].itemID);

        if (itemData != null)
        {
            int haveingItemNum = MonoBehaviourSingleton <InventoryManager> .I.GetHaveingItemNum(itemData.id);

            int      num      = createData.needMaterial[0].num;
            bool     flag     = haveingItemNum >= num;
            ItemIcon itemIcon = ItemIconMaterial.CreateMaterialIcon(ItemIcon.GetItemIconType(itemData.type), itemData, GetCtrl(UI.OBJ_ICON_ROOT), haveingItemNum, num, "MATERIAL", 0, false);
            SetMaterialInfo(itemIcon._transform, REWARD_TYPE.ITEM, itemData.id, null);
            SetActive((Enum)UI.BTN_OK, flag);
            SetActive((Enum)UI.BTN_INACTIVE, !flag);
            base.UpdateUI();
        }
    }
예제 #2
0
    protected override void NeededMaterial()
    {
        //IL_0024: Unknown result type (might be due to invalid IL or missing references)
        //IL_0029: Expected O, but got Unknown
        //IL_0032: Unknown result type (might be due to invalid IL or missing references)
        //IL_003e: Unknown result type (might be due to invalid IL or missing references)
        //IL_00db: Unknown result type (might be due to invalid IL or missing references)
        //IL_00e0: Unknown result type (might be due to invalid IL or missing references)
        //IL_00f7: Unknown result type (might be due to invalid IL or missing references)
        //IL_00fc: Unknown result type (might be due to invalid IL or missing references)
        //IL_011c: Unknown result type (might be due to invalid IL or missing references)
        //IL_0121: Unknown result type (might be due to invalid IL or missing references)
        //IL_012a: Unknown result type (might be due to invalid IL or missing references)
        Transform ctrl = GetCtrl(UI.GRD_NEED_MATERIAL);

        while (ctrl.get_childCount() != 0)
        {
            Transform val = ctrl.GetChild(0);
            val.set_parent(null);
            val.get_gameObject().SetActive(false);
            Object.Destroy(val.get_gameObject());
        }
        int needEquipSize = 0;
        int num           = 0;

        if (needEquip != null)
        {
            needEquipSize = needEquip.Length;
        }
        if (needMaterial != null)
        {
            num = needMaterial.Length;
        }
        int needItemSize = needEquipSize + num;

        SetGrid(UI.GRD_NEED_MATERIAL, null, needItemSize, true, delegate(int i, Transform t, bool is_recycle)
        {
            if (i < needEquipSize && needEquip != null)
            {
                EquipItemTable.EquipItemData equipItemData = Singleton <EquipItemTable> .I.GetEquipItemData(needEquip[i].equipItemID);
                if (equipItemData != null)
                {
                    GET_TYPE getType = equipItemData.getType;
                    ItemIconEquipMaterial itemIconEquipMaterial = ItemIconEquipMaterial.CreateEquipMaterialIcon(ItemIcon.GetItemIconType(equipItemData.type), equipItemData, t, haveEquipNum[i], needEquip[i].num, "EQUIP", i, false, getType);
                    itemIconEquipMaterial.SelectUniqueID(selectedUniqueIdList[i]);
                    SetLongTouch(itemIconEquipMaterial.transform, "EQUIP", i);
                }
            }
            else if (i < needItemSize && needMaterial != null)
            {
                int num2 = i - needEquipSize;
                ItemTable.ItemData itemData = Singleton <ItemTable> .I.GetItemData(needMaterial[num2].itemID);
                if (itemData != null)
                {
                    ItemIcon itemIcon = ItemIconMaterial.CreateMaterialIcon(ItemIcon.GetItemIconType(itemData.type), itemData, t, haveMaterialNum[num2], needMaterial[num2].num, "MATERIAL", num2, false);
                    SetLongTouch(itemIcon.transform, "MATERIAL", num2);
                    SetEvent(t, "MATERIAL", num2);
                }
            }
        });
        SetLabelText((Enum)UI.LBL_GOLD, needMoney.ToString("N0"));
        Color color = Color.get_white();

        if (needMaterial == null && needEquip == null)
        {
            color = Color.get_gray();
        }
        else if (MonoBehaviourSingleton <UserInfoManager> .I.userStatus.money < needMoney)
        {
            color = Color.get_red();
        }
        SetColor((Enum)UI.LBL_GOLD, color);
    }
    public override void UpdateUI()
    {
        base.UpdateUI();
        SetActive((Enum)UI.SPR_COUNT_0_ON, exceedCount > 0);
        SetActive((Enum)UI.SPR_COUNT_1_ON, exceedCount > 1);
        SetActive((Enum)UI.SPR_COUNT_2_ON, exceedCount > 2);
        SetActive((Enum)UI.SPR_COUNT_3_ON, exceedCount > 3);
        SetLabelText((Enum)UI.LBL_SELECT_NOW, (selectPageIndex + 1).ToString());
        UpdateBonusDetail(true);
        bool is_only_lapis = true;
        int  item_num      = exceedData.exceed.Length;

        SetGrid(UI.GRD_LAPIS, "SmithExceedItem", item_num, false, delegate(int i, Transform t, bool is_recycle)
        {
            //IL_0276: Unknown result type (might be due to invalid IL or missing references)
            //IL_0295: Unknown result type (might be due to invalid IL or missing references)
            //IL_02a3: Unknown result type (might be due to invalid IL or missing references)
            //IL_02a8: Unknown result type (might be due to invalid IL or missing references)
            //IL_02af: Unknown result type (might be due to invalid IL or missing references)
            //IL_02b4: Unknown result type (might be due to invalid IL or missing references)
            if (exceedCount >= 4)
            {
                SetActive(t, false);
            }
            else if (i < selectPageIndex * 3 || i >= (selectPageIndex + 1) * 3)
            {
                SetActive(t, false);
            }
            else
            {
                EquipItemExceedTable.EquipItemExceedData.ExceedNeedItem exceedNeedItem = exceedData.exceed[i];
                if (exceedNeedItem == null || exceedNeedItem.itemId == 0 || exceedNeedItem.num[exceedCount] == 0)
                {
                    SetActive(t, false);
                }
                else
                {
                    ItemTable.ItemData itemData = Singleton <ItemTable> .I.GetItemData(exceedNeedItem.itemId);
                    if (itemData == null)
                    {
                        SetActive(t, false);
                    }
                    else
                    {
                        if (itemData.type != ITEM_TYPE.LAPIS)
                        {
                            is_only_lapis = false;
                        }
                        SetActive(t, true);
                        int haveingItemNum = MonoBehaviourSingleton <InventoryManager> .I.GetHaveingItemNum(exceedNeedItem.itemId);
                        int num            = (int)exceedNeedItem.num[exceedCount];
                        ItemIcon.GetIconShowData(REWARD_TYPE.ITEM, exceedNeedItem.itemId, out int _, out ITEM_ICON_TYPE icon_type, out RARITY_TYPE? _, out ELEMENT_TYPE _, out EQUIPMENT_TYPE? _, out int _, out int _, out GET_TYPE _, 0);
                        Transform val     = FindCtrl(t, UI.OBJ_MATERIAL_ICON_ROOT);
                        bool flag2        = haveingItemNum >= num;
                        ItemIcon itemIcon = ItemIconMaterial.CreateMaterialIcon(icon_type, itemData, val, haveingItemNum, num, (!flag2) ? "NEED" : "NEXT", i, false);
                        SetMaterialInfo(itemIcon._transform, REWARD_TYPE.ITEM, exceedNeedItem.itemId, GetCtrl(UI.SCR_LAPIS_ROOT));
                        ItemIconMaterial itemIconMaterial = itemIcon as ItemIconMaterial;
                        if (itemIconMaterial != null)
                        {
                            itemIconMaterial.SetVisibleBG(false);
                        }
                        FindCtrl(val, UI.SPR_EXCEED_BTN_BG).set_parent(itemIcon._transform);
                        SetActive(t, UI.SPR_EXCEED_GRAYOUT, !flag2);
                        if (itemData.endDate != default(DateTime))
                        {
                            string format = StringTable.Get(STRING_CATEGORY.SHOP, 15u);
                            SetLabelText(t, UI.LBL_LIMITED, string.Format(format, itemData.endDate.ToString("yyyy/MM/dd HH:mm")));
                        }
                        else
                        {
                            SetActive(t, UI.OBJ_EXCEED_LIMITED, false);
                        }
                        if (!IsValidExceedSection())
                        {
                            if (itemIcon.GetComponent <UINoAuto>() == null)
                            {
                                itemIcon.get_gameObject().AddComponent <UINoAuto>();
                            }
                            if (itemIcon.GetComponent <UIButtonScale>() == null)
                            {
                                UIButtonScale uIButtonScale = itemIcon.get_gameObject().AddComponent <UIButtonScale>();
                                uIButtonScale.hover         = Vector3.get_one();
                                uIButtonScale.pressed       = UIButtonEffect.buttonScale_pressed;
                                uIButtonScale.duration      = UIButtonEffect.buttonScale_duration;
                            }
                        }
                    }
                }
            }
        });
        bool flag = exceedCount < 4;

        SetActive((Enum)UI.OBJ_VALID_EXCEED_ROOT, flag);
        SetActive((Enum)UI.OBJ_INVALID_EXCEED_ROOT, !flag);
        int    id   = (!is_only_lapis) ? 6 : 5;
        string text = StringTable.Get(STRING_CATEGORY.ITEM_DETAIL, (uint)id);

        SetLabelText((Enum)UI.LBL_USE_MATERIAL_NAME, text);
    }