示例#1
0
 protected override void ChangeSelectItem(EquipItemInfo select_item, EquipItemInfo old_item)
 {
     GameSection.SetEventData(new ChangeEquipData(base.selectEquipSetData.setNo, base.selectEquipSetData.index, select_item));
     if (old_item == null || select_item == null)
     {
         GameSection.ChangeEvent("USER_EQUIP", null);
     }
     else
     {
         bool flag = false;
         for (int i = 0; i < old_item.GetMaxSlot(); i++)
         {
             if (old_item.GetSkillItem(i, MonoBehaviourSingleton <StatusManager> .I.GetCurrentEquipSetNo()) != null)
             {
                 flag = true;
                 break;
             }
         }
         if (flag)
         {
             migrationOldItem    = old_item;
             migrationSelectItem = select_item;
             object eventData = GameSection.GetEventData();
             GameSection.ChangeEvent("MIGRATION_SKILL_CONFIRM", null);
         }
         else
         {
             GameSection.ChangeEvent("USER_EQUIP", null);
         }
     }
 }
 protected virtual void ChangeSelectItem(EquipItemInfo select_item, EquipItemInfo old_item)
 {
     GameSection.SetEventData(new ChangeEquipData(selectEquipSetData.setNo, selectEquipSetData.index, select_item));
     if (old_item == null || select_item == null)
     {
         OnQuery_MAIN_MENU_STATUS();
     }
     else
     {
         bool flag = false;
         for (int i = 0; i < old_item.GetMaxSlot(); i++)
         {
             if (old_item.GetSkillItem(i, MonoBehaviourSingleton <StatusManager> .I.GetCurrentEquipSetNo()) != null)
             {
                 flag = true;
                 break;
             }
         }
         if (flag)
         {
             migrationOldItem    = old_item;
             migrationSelectItem = select_item;
             GameSection.ChangeEvent("MIGRATION_SKILL_CONFIRM", null);
         }
         else
         {
             OnQuery_MAIN_MENU_STATUS();
         }
     }
 }
    protected SkillSlotUIData[] GetSkillSlotData(EquipItemInfo equip)
    {
        if (equip == null)
        {
            return(null);
        }
        int maxSlot = equip.GetMaxSlot();

        if (maxSlot == 0)
        {
            return(null);
        }
        SkillSlotUIData[] ui_slot_data = new SkillSlotUIData[maxSlot];
        int currentSetNo = MonoBehaviourSingleton <StatusManager> .I.GetCurrentEquipSetNo();

        SkillItemInfo[] skillInventoryClone = MonoBehaviourSingleton <InventoryManager> .I.GetSkillInventoryClone();

        SkillItemInfo[] array = Array.FindAll(skillInventoryClone, (SkillItemInfo skill_item) => skill_item.equipSetSkill.Find((EquipSetSkillData skill) => skill.equipItemUniqId == equip.uniqueID && skill.equipSetNo == currentSetNo) != null);
        if (array != null && array.Length > maxSlot)
        {
            Log.Error("Attach Skill Num is Over Skill Slot Num");
        }
        SkillItemTable.SkillSlotData[] slot_data = equip.tableData.GetSkillSlot(equip.exceed);
        Array.ForEach(array, delegate(SkillItemInfo info)
        {
            if (info != null)
            {
                EquipSetSkillData equipSetSkillData = info.equipSetSkill.Find((EquipSetSkillData x) => x.equipSetNo == currentSetNo);
                if (equipSetSkillData != null)
                {
                    int num2 = equipSetSkillData.equipSlotNo;
                    if (equip.IsExceedSkillSlot(num2))
                    {
                        num2 = equip.GetExceedSkillIndex(equipSetSkillData.equipSlotNo);
                    }
                    ui_slot_data[num2]          = new SkillSlotUIData();
                    ui_slot_data[num2].slotData = new SkillItemTable.SkillSlotData(info.tableData.id, slot_data[num2].slotType);
                    ui_slot_data[num2].itemData = info;
                }
            }
        });
        int i = 0;

        for (int num = ui_slot_data.Length; i < num; i++)
        {
            if (ui_slot_data[i] == null)
            {
                ui_slot_data[i]          = new SkillSlotUIData();
                ui_slot_data[i].slotData = new SkillItemTable.SkillSlotData(0u, equip.tableData.GetSkillSlot(equip.exceed)[i].slotType);
            }
        }
        return(ui_slot_data);
    }
示例#4
0
    public override void SetupSortingData(SortBase.SORT_REQUIREMENT requirement, EquipItemStatus status = null)
    {
        switch (requirement)
        {
        default:
            sortingData = (long)equipData.uniqueID;
            break;

        case SortBase.SORT_REQUIREMENT.RARITY:
            sortingData = (long)equipData.tableData.rarity;
            break;

        case SortBase.SORT_REQUIREMENT.LV:
            sortingData = equipData.level;
            break;

        case SortBase.SORT_REQUIREMENT.ATK:
            sortingData = equipData.atk + equipData.elemAtk;
            break;

        case SortBase.SORT_REQUIREMENT.DEF:
            sortingData = equipData.def + equipData.elemDef;
            break;

        case SortBase.SORT_REQUIREMENT.SALE:
            sortingData = equipData.tableData.sale;
            break;

        case SortBase.SORT_REQUIREMENT.SOCKET:
            sortingData = equipData.GetMaxSlot();
            break;

        case SortBase.SORT_REQUIREMENT.PRICE:
            sortingData = 0L;
            break;

        case SortBase.SORT_REQUIREMENT.NUM:
            sortingData = 1L;
            break;

        case SortBase.SORT_REQUIREMENT.ELEMENT:
            sortingData = 6L - (long)GetIconElement();
            break;

        case SortBase.SORT_REQUIREMENT.ELEM_ATK:
            sortingData = equipData.elemAtk;
            break;

        case SortBase.SORT_REQUIREMENT.ELEM_DEF:
            sortingData = equipData.elemDef;
            break;
        }
    }
    protected virtual void OnQuery_StatusMigrationSkillConfirm_YES()
    {
        //IL_0175: Unknown result type (might be due to invalid IL or missing references)
        List <SkillItemInfo>      list  = new List <SkillItemInfo>();
        List <MigrationSkillData> list2 = new List <MigrationSkillData>();

        for (int i = 0; i < migrationOldItem.GetMaxSlot(); i++)
        {
            bool          flag      = false;
            SkillItemInfo skillItem = migrationOldItem.GetSkillItem(i, MonoBehaviourSingleton <StatusManager> .I.GetCurrentEquipSetNo());
            if (skillItem != null)
            {
                for (int j = 0; j < migrationSelectItem.GetMaxSlot(); j++)
                {
                    SkillItemTable.SkillSlotData skillSlotData = migrationSelectItem.tableData.GetSkillSlot(migrationSelectItem.exceed)[j];
                    if (skillSlotData != null && skillSlotData.slotType == skillItem.tableData.type)
                    {
                        int toSlot = j;
                        if (migrationSelectItem.IsExceedSkillSlot(j))
                        {
                            toSlot = migrationSelectItem.GetExceedSkillSlotNo(j);
                        }
                        if (list2.All((MigrationSkillData x) => x.toSlotNo != toSlot))
                        {
                            MigrationSkillData item = new MigrationSkillData(migrationSelectItem.uniqueID, toSlot, skillItem);
                            list2.Add(item);
                            flag = true;
                            break;
                        }
                    }
                }
                if (!flag)
                {
                    list.Add(skillItem);
                }
            }
        }
        migrationSendCount = list2.Count + list.Count;
        GameSection.SetEventData(new ChangeEquipData(selectEquipSetData.setNo, selectEquipSetData.index, migrationSelectItem));
        GameSection.StayEvent();
        this.StartCoroutine(SendReplacementSkill(list2, list));
    }
示例#6
0
    public override void UpdateUI()
    {
        //IL_007c: Unknown result type (might be due to invalid IL or missing references)
        //IL_0081: Expected O, but got Unknown
        //IL_0093: Unknown result type (might be due to invalid IL or missing references)
        //IL_0098: Unknown result type (might be due to invalid IL or missing references)
        //IL_00a7: Unknown result type (might be due to invalid IL or missing references)
        //IL_00a9: Unknown result type (might be due to invalid IL or missing references)
        //IL_00ad: Unknown result type (might be due to invalid IL or missing references)
        //IL_00b4: Unknown result type (might be due to invalid IL or missing references)
        SetToggle((Enum)UI.TGL_WINDOW_TITLE, lookOnly);
        SetActive((Enum)UI.BTN_ATTACH, !lookOnly);
        SetActive((Enum)UI.BTN_DETACH, !lookOnly);
        SetActive((Enum)UI.BTN_GROW, !lookOnly);
        int       num  = equipAndSkill.Length;
        Transform ctrl = GetCtrl(UI.TBL_SKILL_LIST);

        for (int j = 0; j < num; j++)
        {
            if (j < ctrl.get_childCount())
            {
                Transform val           = ctrl.GetChild(j);
                Transform val2          = FindCtrl(val, UI.SPR_EQUIP_INDEX_ICON);
                Vector3   localPosition = val2.get_localPosition();
                localPosition.y = 0f;
                Transform obj            = val;
                Vector3   localPosition2 = localPosition;
                val2.set_localPosition(localPosition2);
                obj.set_localPosition(localPosition2);
                Transform t3 = FindCtrl(val, UI.GRD_ATTACH_SKILL);
                t3.DestroyChildren();
                base.GetComponent <UITable>(val, (Enum)UI.TBL_SPACE).Reposition();
            }
        }
        SetTable(UI.TBL_SKILL_LIST, "EquipSetDetailTopItem", num, false, delegate(int i, Transform t, bool is_recycle)
        {
            //IL_0180: Unknown result type (might be due to invalid IL or missing references)
            //IL_0185: Unknown result type (might be due to invalid IL or missing references)
            //IL_019d: Unknown result type (might be due to invalid IL or missing references)
            //IL_01a2: Unknown result type (might be due to invalid IL or missing references)
            //IL_01b9: Unknown result type (might be due to invalid IL or missing references)
            //IL_01be: Unknown result type (might be due to invalid IL or missing references)
            //IL_01d6: Unknown result type (might be due to invalid IL or missing references)
            //IL_01db: Unknown result type (might be due to invalid IL or missing references)
            //IL_01f9: Unknown result type (might be due to invalid IL or missing references)
            EquipSetDetailTop equipSetDetailTop = this;
            EquipItemInfo item = equipAndSkill[i].equipItemInfo;
            if (item == null || item.GetMaxSlot() == 0)
            {
                SetActive(t, false);
            }
            else
            {
                EquipSetDetailTop equipSetDetailTop2 = this;
                ItemIcon itemIcon = ItemIcon.CreateEquipItemIconByEquipItemInfo(item, sex, FindCtrl(t, UI.OBJ_ICON_ROOT), null, -1, null, 0, false, -1, false, null, false, false);
                itemIcon.SetEnableCollider(false);
                SetEquipIndexIcon(t, UI.SPR_EQUIP_INDEX_ICON, i);
                SetLabelText(t, UI.LBL_EQUIP_NAME, item.tableData.name);
                SetLabelText(t, UI.LBL_EQUIP_NOW_LV, item.level.ToString());
                SetLabelText(t, UI.LBL_EQUIP_MAX_LV, item.tableData.maxLv.ToString());
                SkillSlotUIData[] slotData = equipAndSkill[i].skillSlotUIData;
                SetGrid(t, UI.GRD_ATTACH_SKILL, "EquipSetDetailTopItem2", item.GetMaxSlot(), true, delegate(int i2, Transform t2, bool is_recycle2)
                {
                    //IL_0237: Unknown result type (might be due to invalid IL or missing references)
                    int num3 = (i << 16) + i2;
                    SkillItemInfo skillItemInfo = slotData[i2].itemData;
                    bool flag = skillItemInfo != null && slotData[i2].slotData.skill_id != 0 && skillItemInfo.tableData.type == slotData[i2].slotData.slotType;
                    equipSetDetailTop2.SetSkillIcon(t2, UI.TEX_SKILL_ICON, slotData[i2].slotData.slotType, flag, false);
                    if (!flag)
                    {
                        skillItemInfo = null;
                    }
                    equipSetDetailTop2.SetToggle(t2, UI.TGL_ACTIVE_OBJ, skillItemInfo != null);
                    equipSetDetailTop2.SetActive(t2, UI.LBL_NAME, true);
                    equipSetDetailTop2.SetActive(t2, UI.LBL_NAME_NOT_ENABLE_TYPE, false);
                    equipSetDetailTop2.SetEvent(t2, (!flag) ? "SLOT" : "SLOT_DETAIL", num3);
                    equipSetDetailTop2.SetLongTouch(t2, "SLOT_DETAIL", num3);
                    if (skillItemInfo == null)
                    {
                        equipSetDetailTop2.SetLabelText(t2, UI.LBL_NAME, equipSetDetailTop2.sectionData.GetText("EMPTY_SLOT"));
                        equipSetDetailTop2.SetActive(t2, UI.SPR_ENABLE_WEAPON_TYPE, false);
                    }
                    else
                    {
                        SkillItemTable.SkillItemData tableData = skillItemInfo.tableData;
                        equipSetDetailTop2.SetLabelText(t2, UI.LBL_NAME, tableData.name);
                        equipSetDetailTop2.SetLabelText(t2, UI.LBL_NAME_NOT_ENABLE_TYPE, tableData.name);
                        equipSetDetailTop2.SetLabelText(t2, UI.LBL_NOW_LV, skillItemInfo.level.ToString());
                        equipSetDetailTop2.SetLabelText(t2, UI.LBL_MAX_LV, skillItemInfo.tableData.GetMaxLv(skillItemInfo.exceedCnt).ToString());
                        bool flag2 = skillItemInfo.IsExceeded();
                        equipSetDetailTop2.SetActive(t2, UI.LBL_EX_LV, flag2);
                        if (flag2)
                        {
                            equipSetDetailTop2.SetSupportEncoding(t2, UI.LBL_EX_LV, true);
                            equipSetDetailTop2.SetLabelText(t2, UI.LBL_EX_LV, UIUtility.GetColorText(StringTable.Format(STRING_CATEGORY.SMITH, 9u, skillItemInfo.exceedCnt), ExceedSkillItemTable.color));
                        }
                        EQUIPMENT_TYPE?enableEquipType = skillItemInfo.tableData.GetEnableEquipType();
                        equipSetDetailTop2.SetActive(t2, UI.SPR_ENABLE_WEAPON_TYPE, enableEquipType.HasValue);
                        if (enableEquipType.HasValue)
                        {
                            bool flag3 = enableEquipType.Value == item.tableData.type;
                            equipSetDetailTop2.SetSkillEquipIconKind(t2, UI.SPR_ENABLE_WEAPON_TYPE, enableEquipType.Value, flag3);
                            equipSetDetailTop2.SetActive(t2, UI.LBL_NAME, flag3);
                            equipSetDetailTop2.SetActive(t2, UI.LBL_NAME_NOT_ENABLE_TYPE, !flag3);
                        }
                    }
                });
            }
            base.GetComponent <UITable>(t, (Enum)UI.TBL_SPACE).Reposition();
            Vector3 localPosition3 = t.get_localPosition();
            float y = localPosition3.y;
            Vector3 localPosition4 = FindCtrl(t, UI.OBJ_SPACE).get_localPosition();
            float y2 = localPosition4.y;
            Vector3 localPosition5 = FindCtrl(t, UI.TBL_SPACE).get_localPosition();
            float num2             = y2 + localPosition5.y;
            Vector3 localPosition6 = FindCtrl(t, UI.SPR_EQUIP_INDEX_ICON).get_localPosition();
            localPosition6.y       = (num2 - y) * 0.5f;
            FindCtrl(t, UI.SPR_EQUIP_INDEX_ICON).set_localPosition(localPosition6);
        });
    }