Пример #1
0
 private void OnCloseDialog_AbilityItemSellConfirm()
 {
     inventory  = null;
     isSellMode = false;
     sellItemData.Clear();
     SetDirty(GetCurrentInventoryRoot());
     RefreshUI();
 }
Пример #2
0
 public override void OnNotify(NOTIFY_FLAG flags)
 {
     if ((flags & NOTIFY_FLAG.UPDATE_ABILITY_ITEM_INVENTORY) != (NOTIFY_FLAG)0L)
     {
         inventory = null;
         SetDirty(GetCurrentInventoryRoot());
     }
     base.OnNotify(flags);
 }
Пример #3
0
    public override void UpdateUI()
    {
        if (inventory == null)
        {
            inventory = new ItemStorageTop.AbilityItemInventory();
        }
        SetActive((Enum)UI.OBJ_BTN_SELL_MODE, !isSellMode);
        SetActive((Enum)UI.OBJ_SELL_MODE_ROOT, isSellMode);
        SetLabelText((Enum)UI.LBL_MAX_HAVE_NUM, MonoBehaviourSingleton <UserInfoManager> .I.userStatus.maxAbilityItem.ToString());
        SetLabelText((Enum)UI.LBL_NOW_HAVE_NUM, inventory.datas.Length.ToString());
        SetActive((Enum)UI.GRD_INVENTORY, false);
        SetActive((Enum)UI.GRD_INVENTORY_SMALL, false);
        SetLabelText((Enum)UI.LBL_SORT, inventory.sortSettings.GetSortLabel());
        SetToggle((Enum)UI.TGL_ICON_ASC, inventory.sortSettings.orderTypeAsc);
        if (isSellMode)
        {
            SetLabelText((Enum)UI.LBL_MAX_SELECT_NUM, MonoBehaviourSingleton <UserInfoManager> .I.userInfo.constDefine.SELL_SELECT_MAX.ToString());
            SetLabelText((Enum)UI.LBL_SELECT_NUM, sellItemData.Count.ToString());
            int num = 0;
            foreach (AbilityItemSortData sellItemDatum in sellItemData)
            {
                num += sellItemDatum.itemData.GetItemTableData().price;
            }
            SetLabelText((Enum)UI.LBL_TOTAL, num.ToString());
        }
        UI currentInventoryRoot = GetCurrentInventoryRoot();

        SetActive((Enum)currentInventoryRoot, true);
        SetDynamicList((Enum)currentInventoryRoot, (string)null, inventory.datas.Length, false, (Func <int, bool>) delegate(int i)
        {
            SortCompareData sortCompareData = inventory.datas[i];
            if (sortCompareData == null || !sortCompareData.IsPriority(inventory.sortSettings.orderTypeAsc))
            {
                return(false);
            }
            return(true);
        }, (Func <int, Transform, Transform>) null, (Action <int, Transform, bool>) delegate(int i, Transform t, bool is_recycre)
        {
            //IL_00e0: 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)
            SmithUseAbilityItemList smithUseAbilityItemList = this;
            AbilityItemSortData abilityItem = inventory.datas[i] as AbilityItemSortData;
            int num2          = sellItemData.FindIndex((AbilityItemSortData x) => x.GetUniqID() == abilityItem.GetUniqID());
            ItemIcon itemIcon = CreateIcon(abilityItem, t, i);
            if (itemIcon != null)
            {
                itemIcon.SetUniqID(abilityItem.GetUniqID());
                bool flag = abilityItem.itemData.GetItemTableData().rarity <= equipItemInfo.tableData.rarity;
                itemIcon.SetGrayout(!flag);
                if (itemIcon is ItemIconDetail)
                {
                    (itemIcon as ItemIconDetail).setupperMaterial.SetDescription(abilityItem.itemData.GetDescription());
                    (itemIcon as ItemIconDetail).setupperMaterial.SetActiveInfo(1);
                }
                itemIcon.textLabel.get_gameObject().SetActive(true);
                if (isSellMode)
                {
                    itemIcon.selectFrame.get_gameObject().SetActive(num2 >= 0);
                    if (num2 >= 0)
                    {
                        if (itemIcon is ItemIconDetail)
                        {
                            (itemIcon as ItemIconDetail).setupperEquip.SetupSelectNumberSprite(num2 + 1);
                        }
                        else
                        {
                            (itemIcon as ItemIconDetailSmall).SetupSelectNumberSprite(num2 + 1);
                        }
                    }
                }
                SetEvent(itemIcon.transform, (!flag) ? "LESS_RARITY" : "SELECT_ITEM", abilityItem);
            }
        });
        SetToggle((Enum)UI.TGL_CHANGE_INVENTORY, currentShowInventoryMode != SHOW_INVENTORY_MODE.SMALL);
        UpdateAnchors();
        base.UpdateUI();
    }