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)); }
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(); }
private void OnQuery_SmithConfirmAbilityItem_YES() { GameSection.StayEvent(); MonoBehaviourSingleton <SmithManager> .I.SendUseAbilityItem(equipItemInfo.uniqueID, abilityItemInfo.GetUniqID(), delegate(Error error, EquipItemInfo itemInfo) { GameSection.ResumeEvent(error == Error.None, null); }); }