示例#1
0
    private void OnQuery_LESS_RARITY()
    {
        AbilityItemSortData abilityItemSortData = GameSection.GetEventData() as AbilityItemSortData;

        if (abilityItemSortData == null)
        {
            GameSection.StopEvent();
        }
        else if (isSellMode)
        {
            ChangeSellModeSelectItem(abilityItemSortData);
        }
    }
示例#2
0
 public override void Initialize()
 {
     object[] array = GameSection.GetEventData() as object[];
     if (array[0] is EquipItemInfo)
     {
         equipItemInfo = (array[0] as EquipItemInfo);
     }
     if (array[1] is AbilityItemSortData)
     {
         abilityItemInfo = (array[1] as AbilityItemSortData);
     }
     base.Initialize();
 }
示例#3
0
    private ItemIcon CreateIcon(AbilityItemSortData item_data, Transform parent, int index)
    {
        bool is_new = MonoBehaviourSingleton <InventoryManager> .I.IsNewItem(ITEM_ICON_TYPE.ABILITY_ITEM, item_data.GetUniqID());

        MonoBehaviourSingleton <InventoryManager> .I.AddShowFragsAbilityItem(item_data.GetUniqID());

        ItemTable.ItemData itemData = Singleton <ItemTable> .I.GetItemData(item_data.GetTableID());

        if (currentShowInventoryMode != SHOW_INVENTORY_MODE.SMALL)
        {
            return(ItemIconDetail.CreateMaterialIcon(item_data.GetIconType(), item_data.GetIconID(), item_data.GetRarity(), itemData, true, parent, item_data.GetNum(), item_data.GetName(), "SELECT_ITEM", index, -1, false, is_new));
        }
        return(ItemIconDetailSmall.CreateSmallMaterialIcon(item_data.GetIconType(), item_data.GetIconID(), item_data.GetRarity(), parent, item_data.GetNum(), item_data.GetName(), "SELECT_ITEM", index, -1, false, is_new, 0, 0, ItemIconDetail.ICON_STATUS.NONE));
    }
示例#4
0
 private void ChangeSellModeSelectItem(AbilityItemSortData abilityItem)
 {
     if (sellItemData.Contains(abilityItem))
     {
         sellItemData.Remove(abilityItem);
         RefreshSelectSell();
         GameSection.StopEvent();
     }
     else if (MonoBehaviourSingleton <UserInfoManager> .I.userInfo.constDefine.SELL_SELECT_MAX > sellItemData.Count)
     {
         sellItemData.Add(abilityItem);
         RefreshSelectSell();
         GameSection.StopEvent();
     }
     else
     {
         GameSection.ChangeEvent("OVER_SELL_ITEM", null);
     }
 }
示例#5
0
    private void OnQuery_SELECT_ITEM()
    {
        AbilityItemSortData abilityItemSortData = GameSection.GetEventData() as AbilityItemSortData;

        if (abilityItemSortData == null)
        {
            GameSection.StopEvent();
        }
        else if (isSellMode)
        {
            ChangeSellModeSelectItem(abilityItemSortData);
        }
        else
        {
            GameSection.SetEventData(new object[2]
            {
                equipItemInfo,
                abilityItemSortData
            });
        }
    }
示例#6
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();
    }