예제 #1
0
 protected void SetVisibleEmptySkillType(bool is_visible, int index = 0)
 {
     isVisibleEmptySkill = is_visible;
     SetActive((Enum)UI.OBJ_EMPTY_SKILL_ROOT, is_visible);
     if (is_visible)
     {
         SKILL_SLOT_TYPE sKILL_SLOT_TYPE = SKILL_SLOT_TYPE.NONE;
         if (equipItem != null)
         {
             SkillItemTable.SkillSlotData[] skillSlot = equipItem.tableData.GetSkillSlot(equipItem.exceed);
             if (skillSlot == null || skillSlot.Length <= index)
             {
                 SetActive((Enum)UI.OBJ_EMPTY_SKILL_ROOT, false);
                 return;
             }
             sKILL_SLOT_TYPE = skillSlot[index].slotType;
         }
         SetLabelText((Enum)UI.LBL_EMPTY_SKILL_TYPE, MonoBehaviourSingleton <StatusManager> .I.GetSkillItemGroupString(sKILL_SLOT_TYPE));
         SetSprite((Enum)UI.SPR_EMPTY_SKILL, UIBehaviour.GetSkillIconSpriteName(sKILL_SLOT_TYPE, true, true));
     }
 }
    protected void Set(EquipItemInfo item, SkillSlotUIData[] slot_data, bool is_show_main_status, int equipping_sp_index)
    {
        //IL_0142: Unknown result type (might be due to invalid IL or missing references)
        //IL_0153: Unknown result type (might be due to invalid IL or missing references)
        //IL_0164: Unknown result type (might be due to invalid IL or missing references)
        //IL_017e: Unknown result type (might be due to invalid IL or missing references)
        //IL_019b: 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_022f: Unknown result type (might be due to invalid IL or missing references)
        //IL_025e: Unknown result type (might be due to invalid IL or missing references)
        SetEquipIndexSprite(equipping_sp_index);
        SetFavorite(item.isFavorite);
        bool flag = item.tableData.IsWeapon();

        if (flag)
        {
            SetElement(item.GetTargetElement(), item.elemAtk, true);
        }
        else
        {
            int num = item.elemDef;
            if (item.tableData.isFormer)
            {
                num = Mathf.FloorToInt((float)num * 0.1f);
            }
            SetElement(item.GetTargetElement(), num, false);
        }
        if (is_show_main_status)
        {
            infoRootAry[2].SetActive(true);
            infoRootAry[3].SetActive(false);
            SetVisibleBG(true);
            SetName(item.tableData.name);
            SetLevel(item.level, item.tableData.maxLv, item.tableData.IsVisual());
            SetEquipValue(flag, (!flag) ? item.def : item.atk);
        }
        else
        {
            infoRootAry[2].SetActive(false);
            infoRootAry[3].SetActive(true);
            SetVisibleBG(false);
            SetName(string.Empty);
            int  num2  = (slot_data != null && slot_data.Length > 0) ? slot_data.Length : 0;
            bool flag2 = num2 > 0;
            spSkillBG.get_gameObject().SetActive(flag2);
            grdSkillRoot.get_gameObject().SetActive(flag2);
            lblNonSkillSlot.get_gameObject().SetActive(!flag2);
            if (flag2)
            {
                int childCount = grdSkillRoot.get_transform().get_childCount();
                for (int i = 0; i < childCount; i++)
                {
                    bool     flag3     = false;
                    UISprite component = grdSkillRoot.get_transform().GetChild(i).GetComponent <UISprite>();
                    if (i < num2 && component != null && slot_data[i] != null && slot_data[i].slotData != null)
                    {
                        flag3 = true;
                    }
                    if (flag3)
                    {
                        bool is_attached = slot_data[i].itemData != null && slot_data[i].itemData.isAttached && slot_data[i].itemData.tableData.type == slot_data[i].slotData.slotType;
                        component.get_gameObject().SetActive(true);
                        component.spriteName = UIBehaviour.GetSkillIconSpriteName(slot_data[i].slotData.slotType, is_attached, false);
                    }
                    else
                    {
                        component.get_gameObject().SetActive(false);
                        component.spriteName = string.Empty;
                    }
                }
            }
            grdSkillRoot.Reposition();
            bool enabled = true;
            EquipItemAbility[] ability = item.ability;
            objAbilityRoot.GetComponentsInChildren <UILabel>(Temporary.uiLabelList);
            int j = 0;
            for (int count = Temporary.uiLabelList.Count; j < count; j++)
            {
                UILabel uILabel = Temporary.uiLabelList[j];
                uILabel.set_enabled(j < ability.Length && ability[j].id != 0 && ability[j].ap > 0);
                if (uILabel.get_enabled())
                {
                    uILabel.text = ability[j].GetNameAndAP();
                    enabled      = false;
                }
            }
            Temporary.uiLabelList.Clear();
            lblNonAbility.set_enabled(enabled);
        }
    }
    protected void Set(EquipItemTable.EquipItemData table, SkillSlotUIData[] slot_data, bool is_show_main_status)
    {
        //IL_00fc: Unknown result type (might be due to invalid IL or missing references)
        //IL_010d: Unknown result type (might be due to invalid IL or missing references)
        //IL_011e: Unknown result type (might be due to invalid IL or missing references)
        //IL_0138: Unknown result type (might be due to invalid IL or missing references)
        //IL_0154: Unknown result type (might be due to invalid IL or missing references)
        //IL_015b: Unknown result type (might be due to invalid IL or missing references)
        //IL_01e8: Unknown result type (might be due to invalid IL or missing references)
        //IL_0217: Unknown result type (might be due to invalid IL or missing references)
        SetEquipIndexSprite(-1);
        SetFavorite(false);
        bool flag = table.IsWeapon();

        SetElement(table.GetTargetElement(0), (!flag) ? table.baseElemDef : table.baseElemAtk, flag);
        if (is_show_main_status)
        {
            infoRootAry[2].SetActive(true);
            infoRootAry[3].SetActive(false);
            SetVisibleBG(true);
            SetName(table.name);
            SetLevel(1, table.maxLv, table.IsVisual());
            SetEquipValue(flag, (!flag) ? table.baseDef : table.baseAtk);
        }
        else
        {
            infoRootAry[2].SetActive(false);
            infoRootAry[3].SetActive(true);
            SetVisibleBG(false);
            SetName(string.Empty);
            int  num   = (slot_data != null && slot_data.Length > 0) ? slot_data.Length : 0;
            bool flag2 = num > 0;
            spSkillBG.get_gameObject().SetActive(flag2);
            grdSkillRoot.get_gameObject().SetActive(flag2);
            lblNonSkillSlot.get_gameObject().SetActive(!flag2);
            if (flag2)
            {
                int childCount = grdSkillRoot.get_transform().get_childCount();
                for (int i = 0; i < childCount; i++)
                {
                    bool     flag3     = false;
                    UISprite component = grdSkillRoot.get_transform().GetChild(i).GetComponent <UISprite>();
                    if (i < num && component != null && slot_data[i] != null && slot_data[i].slotData != null)
                    {
                        flag3 = true;
                    }
                    if (flag3)
                    {
                        bool is_attached = slot_data[i].itemData != null && slot_data[i].itemData.isAttached && slot_data[i].itemData.tableData.type == slot_data[i].slotData.slotType;
                        component.get_gameObject().SetActive(true);
                        component.spriteName = UIBehaviour.GetSkillIconSpriteName(slot_data[i].slotData.slotType, is_attached, false);
                    }
                    else
                    {
                        component.get_gameObject().SetActive(false);
                        component.spriteName = string.Empty;
                    }
                }
            }
            grdSkillRoot.Reposition();
            bool enabled = true;
            objAbilityRoot.GetComponentsInChildren <UILabel>(Temporary.uiLabelList);
            EquipItemAbility[] array = new EquipItemAbility[Temporary.uiLabelList.Count];
            int j = 0;
            for (int count = Temporary.uiLabelList.Count; j < count; j++)
            {
                UILabel uILabel = Temporary.uiLabelList[j];
                array[j] = null;
                if (j < table.fixedAbility.Length)
                {
                    array[j] = new EquipItemAbility((uint)table.fixedAbility[j].id, table.fixedAbility[j].pt);
                }
                uILabel.set_enabled(array[j] != null && array[j].id != 0 && array[j].ap > 0);
                if (uILabel.get_enabled())
                {
                    uILabel.text = array[j].GetNameAndAP();
                    enabled      = false;
                }
            }
            Temporary.uiLabelList.Clear();
            lblNonAbility.set_enabled(enabled);
        }
    }