protected override NeedMaterial[] CreateNeedMaterialAry()
    {
        List <NeedMaterial> list     = new List <NeedMaterial>();
        ItemInfo            itemInfo = item.GetItemData() as ItemInfo;

        if (itemInfo != null && itemInfo.tableData.type == ITEM_TYPE.LITHOGRAPH)
        {
            uint num = 0u;
            EquipItemExceedTable.EquipItemExceedData equipItemExceedData = Singleton <EquipItemExceedTable> .I.GetEquipItemExceedData(itemInfo.tableData.rarity, itemInfo.tableData.getType, itemInfo.tableData.eventId);

            if (equipItemExceedData != null)
            {
                num = equipItemExceedData.exchangeItemId;
            }
            if (num != 0)
            {
                ItemTable.ItemData itemData = Singleton <ItemTable> .I.GetItemData(num);

                if (itemData != null)
                {
                    list.Add(new NeedMaterial(num, this.num));
                }
            }
        }
        return(list.ToArray());
    }
 private void ToNotEnableSkillTypeConfirm()
 {
     //IL_0057: Unknown result type (might be due to invalid IL or missing references)
     if (is_not_enable_skill_type)
     {
         is_not_enable_skill_type = false;
         GameSection.ChangeEvent("COME_BACK", null);
         Action action = delegate
         {
             SortCompareData sortCompareData = inventory.datas[selectIndex];
             SkillItemInfo   skillItemInfo   = sortCompareData.GetItemData() as SkillItemInfo;
             EQUIPMENT_TYPE? enableEquipType = skillItemInfo.tableData.GetEnableEquipType();
             DispatchEvent("NOT_SKILL_ENABLE_TYPE", new object[1]
             {
                 MonoBehaviourSingleton <StatusManager> .I.GetEquipItemGroupString(enableEquipType.Value)
             });
         };
         if (MonoBehaviourSingleton <GameSceneManager> .I.GetCurrentScreenName().Contains(this.get_name()))
         {
             action();
         }
         else
         {
             this.StartCoroutine(DelayCall(action));
         }
     }
 }
    public override void Initialize()
    {
        object[] array = GameSection.GetEventData() as object[];
        callSection = (ItemDetailEquip.CURRENT_SECTION)(int) array[0];
        itemData    = array[1];
        if (array.Length > 2)
        {
            equipInfo = (array[2] as EquipItemInfo);
            slotIndex = (int)array[3];
        }
        SortCompareData sortCompareData = itemData as SortCompareData;

        if (sortCompareData != null)
        {
            itemData = (sortCompareData.GetItemData() as SkillItemInfo);
        }
        SkillItemInfo skillItemInfo = itemData as SkillItemInfo;

        if (skillItemInfo != null)
        {
            GameSaveData.instance.RemoveNewIconAndSave(ITEM_ICON_TYPE.SKILL_ATTACK, skillItemInfo.uniqueID);
        }
        bool flag = equipInfo != null;

        SetActive((Enum)UI.BTN_CHANGE, flag);
        SetActive((Enum)UI.BTN_GROW, ItemDetailEquip.CanSmithSection(callSection) && skillItemInfo != null && !skillItemInfo.IsLevelMax());
        SetActive((Enum)UI.BTN_SELL, MonoBehaviourSingleton <ItemExchangeManager> .I.IsExchangeScene() && !flag);
        base.Initialize();
    }
    public override void UpdateUI()
    {
        ItemInfo itemInfo = data.GetItemData() as ItemInfo;

        SetActive((Enum)UI.STR_SELL, data.CanSale());
        SetActive((Enum)UI.BTN_DETAIL_SELL, data.CanSale() && MonoBehaviourSingleton <ItemExchangeManager> .I.IsExchangeScene());
        SetLabelText((Enum)UI.LBL_NAME, data.GetName());
        SetLabelText((Enum)UI.LBL_HAVE_NUM, data.GetNum().ToString());
        SetLabelText((Enum)UI.LBL_DESCRIPTION, itemInfo.tableData.text);
        SetLabelText((Enum)UI.LBL_SELL, data.GetSalePrice().ToString());
        int num  = 0;
        int num2 = 0;

        num  = itemInfo.tableData.enemyIconID;
        num2 = itemInfo.tableData.enemyIconID2;
        GET_TYPE getType = data.GetGetType();

        ItemIcon.Create(data.GetIconType(), data.GetIconID(), data.GetRarity(), GetCtrl(UI.OBJ_ICON_ROOT), data.GetIconElement(), data.GetIconMagiEnableType(), -1, null, 0, false, -1, false, null, false, num, num2, false, getType);
    }
    private bool CheckEnableSkillType()
    {
        SortCompareData sortCompareData = inventory.datas[selectIndex];

        if (sortCompareData != null)
        {
            SkillItemInfo  skillItemInfo   = sortCompareData.GetItemData() as SkillItemInfo;
            EQUIPMENT_TYPE?enableEquipType = skillItemInfo.tableData.GetEnableEquipType();
            if (skillItemInfo != null && enableEquipType.HasValue && enableEquipType.Value != EQUIPMENT_TYPE.ARMOR && !skillItemInfo.tableData.IsEnableEquipType(equipItem.tableData.type))
            {
                return(false);
            }
        }
        return(true);
    }
Пример #6
0
    protected override void UpdateInventoryUI()
    {
        SetupEnableInventoryUI();
        bool reset = false;
        int  num   = inventory.datas.Length;

        if (preInventoryDataSize != num)
        {
            reset = true;
            preInventoryDataSize = num;
        }
        SetDynamicList((Enum)inventoryUI, (string)null, num, reset, (Func <int, bool>) delegate(int i)
        {
            SortCompareData sortCompareData2 = inventory.datas[i];
            if (sortCompareData2 == null || !sortCompareData2.IsPriority(inventory.sortSettings.orderTypeAsc))
            {
                return(false);
            }
            SkillItemInfo skillItemInfo2 = sortCompareData2.GetItemData() as SkillItemInfo;
            if (skillItemInfo2 == null)
            {
                return(false);
            }
            if (!skillItemInfo2.IsLevelMax())
            {
                return(true);
            }
            return(skillItemInfo2.IsEnableExceed());
        }, (Func <int, Transform, Transform>) null, (Action <int, Transform, bool>) delegate(int i, Transform t, bool is_recycle)
        {
            SortCompareData sortCompareData = inventory.datas[i];
            if (sortCompareData != null && sortCompareData.IsPriority(inventory.sortSettings.orderTypeAsc))
            {
                SkillItemInfo skillItemInfo = sortCompareData.GetItemData() as SkillItemInfo;
                if (skillItemInfo != null && (!skillItemInfo.IsLevelMax() || skillItemInfo.IsExistNextExceed()))
                {
                    ITEM_ICON_TYPE iconType = sortCompareData.GetIconType();
                    bool is_new             = MonoBehaviourSingleton <InventoryManager> .I.IsNewItem(iconType, sortCompareData.GetUniqID());
                    bool isShowEnableExceed = skillItemInfo.IsEnableExceed() && skillItemInfo.exceedCnt == 0;
                    bool isValidExceed      = skillItemInfo.IsEnableExceed();
                    ItemIcon itemIcon       = CreateItemIconDetail(iconType, sortCompareData.GetIconID(), sortCompareData.GetRarity(), sortCompareData as SkillItemSortData, base.IsShowMainStatus, t, "SELECT", i, is_new, 100, selectIndex == i, sortCompareData.IsEquipping(), isValidExceed, isShowEnableExceed);
                    itemIcon.SetItemID(sortCompareData.GetTableID());
                    itemIcon.SetButtonColor(inventory.datas[i].IsPriority(inventory.sortSettings.orderTypeAsc), true);
                    SetLongTouch(itemIcon.transform, "DETAIL", i);
                }
            }
        });
    }
    protected virtual void OnCloseSort()
    {
        SortSettings sortSettings = (SortSettings)GameSection.GetEventData();

        if (sortSettings != null)
        {
            SortCompareData sortCompareData = null;
            if (selectIndex >= 0)
            {
                sortCompareData = inventory.datas[selectIndex];
            }
            if (inventory.Sort(sortSettings))
            {
                if (sortCompareData != null)
                {
                    selectIndex = GetSelectItemIndex(sortCompareData.GetItemData() as SkillItemInfo);
                }
                SetDirty(UI.GRD_INVENTORY);
                RefreshUI();
            }
        }
    }
    protected override void UpdateInventoryUI()
    {
        int find_index = -1;

        if (equipSkillItem != null)
        {
            find_index = Array.FindIndex(inventory.datas, (SortCompareData data) => data.GetUniqID() == equipSkillItem.uniqueID);
            if (find_index > -1 && (inventory.datas[find_index] == null || !inventory.datas[find_index].IsPriority(inventory.sortSettings.orderTypeAsc)))
            {
                find_index = -1;
            }
        }
        SetupEnableInventoryUI();
        SetDynamicList((Enum)inventoryUI, (string)null, inventory.datas.Length + 2, false, (Func <int, bool>) delegate(int i)
        {
            if (i == 0)
            {
                return(!isVisibleEmptySkill && find_index >= 0);
            }
            bool flag  = false;
            bool flag2 = true;
            int num2   = i - 1;
            if (find_index >= 0)
            {
                if (num2 == 0)
                {
                    flag = true;
                }
                else
                {
                    num2--;
                }
            }
            if (!flag && (num2 >= inventory.datas.Length || (find_index >= 0 && num2 == find_index)))
            {
                flag2 = false;
            }
            if (flag2)
            {
                SortCompareData sortCompareData2 = inventory.datas[num2];
                if (sortCompareData2 == null || !sortCompareData2.IsPriority(inventory.sortSettings.orderTypeAsc))
                {
                    flag2 = false;
                }
            }
            return(flag2);
        }, (Func <int, Transform, Transform>) null, (Action <int, Transform, bool>) delegate(int i, Transform t, bool is_recycle)
        {
            if (i == 0)
            {
                if (!isVisibleEmptySkill)
                {
                    CreateRemoveIcon(t, "SELECT", -1, 100, selectIndex == -1, base.sectionData.GetText("STR_DETACH"));
                }
            }
            else
            {
                int num = i - 1;
                if (find_index >= 0)
                {
                    num = ((num != 0) ? (num - 1) : find_index);
                }
                SetActive(t, true);
                SortCompareData sortCompareData = inventory.datas[num];
                SkillItemInfo skillItemInfo     = sortCompareData.GetItemData() as SkillItemInfo;
                ITEM_ICON_TYPE iconType         = sortCompareData.GetIconType();
                bool is_new       = MonoBehaviourSingleton <InventoryManager> .I.IsNewItem(iconType, sortCompareData.GetUniqID());
                ItemIcon itemIcon = CreateItemIconDetail(iconType, sortCompareData.GetIconID(), sortCompareData.GetRarity(), sortCompareData as SkillItemSortData, base.IsShowMainStatus, t, "SELECT", num, is_new, 100, selectIndex == num, skillItemInfo.IsCurrentEquipSetAttached, sortCompareData.IsExceeded(), false);
                itemIcon.SetItemID(sortCompareData.GetTableID());
                SetLongTouch(itemIcon.transform, "DETAIL", num);
            }
        });
    }
    protected override void OnDecision()
    {
        List <GameSectionHistory.HistoryData> historyList = MonoBehaviourSingleton <GameSceneManager> .I.GetHistoryList();

        string sectionName = historyList[historyList.Count - 2].sectionName;
        bool   flag        = sectionName == "ItemDetailSkillDialog" || sectionName == "ItemDetailSkill";

        if (selectIndex == -1)
        {
            if (equipSkillItem == null)
            {
                GameSection.BackSection();
            }
            else
            {
                GameSection.ChangeEvent("DETACH", null);
                SendDetachEquipSkill();
            }
        }
        else
        {
            SortCompareData sortCompareData = inventory.datas[selectIndex];
            if (equipSkillItem != null && equipSkillItem.uniqueID == sortCompareData.GetUniqID())
            {
                GameSection.BackSection();
            }
            else
            {
                EquipItemInfo equipItemInfo = null;
                SkillItemInfo skillItemInfo = sortCompareData.GetItemData() as SkillItemInfo;
                if (skillItemInfo.IsCurrentEquipSetAttached)
                {
                    EquipSetSkillData equipSetSkillData = skillItemInfo.equipSetSkill.Find((EquipSetSkillData x) => x.equipSetNo == MonoBehaviourSingleton <StatusManager> .I.GetCurrentEquipSetNo());
                    equipItemInfo = MonoBehaviourSingleton <InventoryManager> .I.equipItemInventory.Find(equipSetSkillData.equipItemUniqId);
                }
                if (equipSkillItem != null)
                {
                    if (!skillItemInfo.IsCurrentEquipSetAttached)
                    {
                        GameSection.ChangeEvent((!flag) ? "EQUIP" : "EQUIP_DETAIL", null);
                        CheckSendEquipSkill();
                    }
                    else
                    {
                        GameSection.ChangeEvent((!flag) ? "STEAL" : "STEAL_DETAIL", new object[5]
                        {
                            equipSkillItem.tableData.name,
                            equipSkillItem.level.ToString(),
                            equipItemInfo.tableData.name,
                            sortCompareData.GetName(),
                            sortCompareData.GetLevel().ToString()
                        });
                    }
                }
                else if (skillItemInfo.IsCurrentEquipSetAttached)
                {
                    GameSection.ChangeEvent((!flag) ? "REPLACE" : "REPLACE_DETAIL", new object[3]
                    {
                        equipItemInfo.tableData.name,
                        sortCompareData.GetName(),
                        sortCompareData.GetLevel().ToString()
                    });
                }
                else
                {
                    GameSection.ChangeEvent((!flag) ? "EQUIP" : "EQUIP_DETAIL", null);
                    CheckSendEquipSkill();
                }
            }
        }
    }
Пример #10
0
    public override void Initialize()
    {
        //IL_03bb: Unknown result type (might be due to invalid IL or missing references)
        gameEventData     = (GameSection.GetEventData() as object[]);
        callSection       = (CURRENT_SECTION)(int)gameEventData[0];
        eventData         = gameEventData[1];
        localEquipSetData = gameEventData.OfType <StatusEquip.LocalEquipSetData>().FirstOrDefault();
        switch (callSection)
        {
        case CURRENT_SECTION.STATUS_TOP:
        case CURRENT_SECTION.STATUS_EQUIP:
        case CURRENT_SECTION.STATUS_AVATAR:
        case CURRENT_SECTION.EQUIP_SET_DETAIL_STATUS:
        {
            EquipItemInfo equipItemInfo3 = eventData as EquipItemInfo;
            if (equipItemInfo3 != null)
            {
                detailItemData   = equipItemInfo3;
                equipAttachSkill = GetSkillSlotData(detailItemData as EquipItemInfo);
            }
            break;
        }

        case CURRENT_SECTION.ITEM_STORAGE:
        case CURRENT_SECTION.SMITH_SELL:
        {
            SortCompareData sortCompareData = eventData as SortCompareData;
            if (sortCompareData != null)
            {
                EquipItemInfo equipItemInfo4 = (EquipItemInfo)(detailItemData = (sortCompareData.GetItemData() as EquipItemInfo));
                equipAttachSkill = GetSkillSlotData(equipItemInfo4);
                MonoBehaviourSingleton <StatusManager> .I.SetSelectEquipItem(equipItemInfo4);
            }
            break;
        }

        case CURRENT_SECTION.QUEST_ROOM:
        {
            EquipItemInfo equipItemInfo = eventData as EquipItemInfo;
            if (equipItemInfo != null)
            {
                detailItemData   = equipItemInfo;
                equipAttachSkill = GetSkillSlotData(detailItemData as EquipItemInfo);
            }
            if (gameEventData.Length > 2)
            {
                sex    = (int)gameEventData[2];
                faceID = (int)gameEventData[3];
            }
            break;
        }

        case CURRENT_SECTION.QUEST_RESULT:
        {
            EquipItemAndSkillData equipItemAndSkillData = eventData as EquipItemAndSkillData;
            if (equipItemAndSkillData != null)
            {
                detailItemData   = equipItemAndSkillData.equipItemInfo;
                equipAttachSkill = equipItemAndSkillData.skillSlotUIData;
            }
            if (gameEventData.Length > 2)
            {
                sex    = (int)gameEventData[2];
                faceID = (int)gameEventData[3];
            }
            break;
        }

        case CURRENT_SECTION.SMITH_EVOLVE:
        case CURRENT_SECTION.SMITH_GROW:
        {
            EquipItemInfo equipItemInfo2 = eventData as EquipItemInfo;
            if (equipItemInfo2 != null)
            {
                detailItemData   = equipItemInfo2;
                equipAttachSkill = GetSkillSlotData(detailItemData as EquipItemInfo);
            }
            break;
        }

        case CURRENT_SECTION.SMITH_CREATE:
        case CURRENT_SECTION.GACHA_EQUIP_PREVIEW:
            detailItemData   = eventData;
            equipAttachSkill = GetSkillSlotData(detailItemData as EquipItemTable.EquipItemData, 0);
            break;

        case CURRENT_SECTION.EQUIP_LIST:
            detailItemData   = eventData;
            equipAttachSkill = GetSkillSlotData(detailItemData as EquipItemTable.EquipItemData, 0);
            for (int i = 0; i < equipAttachSkill.Length; i++)
            {
                equipAttachSkill[i].slotData.skill_id = 0u;
            }
            break;
        }
        if (detailItemData != null)
        {
            EquipItemInfo equipItemInfo5 = detailItemData as EquipItemInfo;
            if (equipItemInfo5 != null)
            {
                GameSaveData.instance.RemoveNewIconAndSave(ItemIcon.GetItemIconType(equipItemInfo5.tableData.type), equipItemInfo5.uniqueID);
            }
        }
        if (sex == -1)
        {
            sex = MonoBehaviourSingleton <UserInfoManager> .I.userStatus.sex;
        }
        Transform ctrl = GetCtrl(UI.BTN_GRAPH);

        if (ctrl != null)
        {
            int           num            = -1;
            EquipItemInfo equipItemInfo6 = detailItemData as EquipItemInfo;
            if (equipItemInfo6 != null)
            {
                num = equipItemInfo6.tableData.damageDistanceId;
            }
            else
            {
                EquipItemTable.EquipItemData equipItemData = detailItemData as EquipItemTable.EquipItemData;
                if (equipItemData != null)
                {
                    num = equipItemData.damageDistanceId;
                }
            }
            bool active = num >= 0;
            ctrl.get_gameObject().SetActive(active);
        }
        base.Initialize();
    }