Exemplo n.º 1
0
    public void SetEquipItemData(int itemID, long equipID, SelectImgType selectType = SelectImgType.HighLight)
    {
        FXSpineManager.Instance.DeleteSpine(this.m_equipFXID, true);
        if (!this.isInit)
        {
            this.InitUI();
        }
        this.EquipID = equipID;
        this.ItemID  = itemID;
        Dictionary <string, string> equipIconNamesByEquipDataID = EquipGlobal.GetEquipIconNamesByEquipDataID(itemID, true);

        if (equipIconNamesByEquipDataID == null)
        {
            return;
        }
        if (this.m_spImageFrame == null)
        {
            return;
        }
        if (this.m_spImageFramePet == null)
        {
            return;
        }
        ResourceManager.SetSprite(this.m_spImageFrame, ResourceManager.GetIconSprite(equipIconNamesByEquipDataID.get_Item("IconFrameName")));
        ResourceManager.SetSprite(this.m_spImageFramePet, ResourceManagerBase.GetNullSprite());
        ResourceManager.SetSprite(this.m_spImageIcon, ResourceManager.GetIconSprite(equipIconNamesByEquipDataID.get_Item("IconName")));
        this.m_numTxt.set_text(string.Empty);
        this.currentSelectType = selectType;
        base.FindTransform("ItemStep").get_gameObject().SetActive(true);
        this.m_itemStepTxt.set_text(equipIconNamesByEquipDataID.get_Item("EquipStep"));
        this.ExcellentCount = EquipGlobal.GetExcellentAttrsCountByColor(equipID, 1f);
        EquipSimpleInfo  equipSimpleInfoByEquipID = EquipGlobal.GetEquipSimpleInfoByEquipID(equipID);
        TaoZhuangDuanZhu equipForgeCfgData        = EquipGlobal.GetEquipForgeCfgData(equipID);

        if (equipSimpleInfoByEquipID != null && equipForgeCfgData != null && equipSimpleInfoByEquipID.suitId > 0)
        {
            ResourceManager.SetSprite(this.m_spImageFrame, ResourceManager.GetIconSprite(equipForgeCfgData.frame));
        }
        this.SetImageBinding(equipSimpleInfoByEquipID != null && equipSimpleInfoByEquipID.binding);
    }
Exemplo n.º 2
0
    private void SetEquipItemData(int equipItemID, int equipLV = 0)
    {
        FXSpineManager.Instance.DeleteSpine(this.equipFxID, true);
        this.equipFxID = 0;
        if (this.DepthValue < 3000)
        {
            this.DepthValue = 3000;
        }
        zZhuangBeiPeiZhiBiao data = DataReader <zZhuangBeiPeiZhiBiao> .Get(equipItemID);

        if (data == null)
        {
            return;
        }
        Dictionary <string, string> equipIconNamesByEquipDataID = EquipGlobal.GetEquipIconNamesByEquipDataID(equipItemID, true);

        ResourceManager.SetSprite(base.FindTransform("ItemFrame").GetComponent <Image>(), ResourceManager.GetIconSprite(equipIconNamesByEquipDataID.get_Item("IconFrameName")));
        ResourceManager.SetSprite(base.FindTransform("ItemIcon").GetComponent <Image>(), ResourceManager.GetIconSprite(equipIconNamesByEquipDataID.get_Item("IconName")));
        DepthOfUI depthOfUI = base.FindTransform("EquipStepImg").GetComponent <DepthOfUI>();

        if (depthOfUI == null)
        {
            depthOfUI = base.FindTransform("EquipStepImg").get_gameObject().AddComponent <DepthOfUI>();
        }
        depthOfUI.SortingOrder = this.DepthValue + 2;
        DepthOfUI depthOfUI2 = base.FindTransform("EquipStepText").GetComponent <DepthOfUI>();

        if (depthOfUI2 == null)
        {
            depthOfUI2 = base.FindTransform("EquipStepText").get_gameObject().AddComponent <DepthOfUI>();
        }
        depthOfUI2.SortingOrder = this.DepthValue + 2;
        DepthOfUI depthOfUI3 = base.FindTransform("ExcellentAttrIconList").GetComponent <DepthOfUI>();

        if (depthOfUI3 == null)
        {
            depthOfUI3 = base.FindTransform("ExcellentAttrIconList").get_gameObject().AddComponent <DepthOfUI>();
        }
        depthOfUI3.SortingOrder = this.DepthValue + 2;
        DepthOfUI depthOfUI4 = base.FindTransform("ImageBinding").GetComponent <DepthOfUI>();

        if (depthOfUI4 == null)
        {
            depthOfUI4 = base.FindTransform("ImageBinding").get_gameObject().AddComponent <DepthOfUI>();
        }
        depthOfUI4.SortingOrder = this.DepthValue + 2;
        base.FindTransform("ImageBinding").get_gameObject().SetActive(false);
        base.FindTransform("ExcellentAttrIconList").get_gameObject().SetActive(false);
        base.FindTransform("EquipStepText").GetComponent <Text>().set_text(equipIconNamesByEquipDataID.get_Item("EquipStep"));
        base.FindTransform("ItemName").GetComponent <Text>().set_text(equipIconNamesByEquipDataID.get_Item("ItemName"));
        int color = DataReader <Items> .Get(equipItemID).color;

        Dictionary <string, Color> textColorByQuality = GameDataUtils.GetTextColorByQuality(color);

        base.FindTransform("ItemNum").GetComponent <Text>().set_text(string.Empty);
        if (this.IsWearing)
        {
            if (equipLV > 0)
            {
                base.FindTransform("ItemNum").GetComponent <Text>().set_text("+" + equipLV.ToString());
                base.FindTransform("ItemNum").GetComponent <Text>().set_color(textColorByQuality.get_Item("TextColor"));
                base.FindTransform("ItemNum").GetComponent <Outline>().set_effectColor(textColorByQuality.get_Item("TextOutlineColor"));
            }
            else
            {
                base.FindTransform("ItemNum").GetComponent <Text>().set_text(string.Empty);
            }
        }
        base.FindTransform("ItemLv").GetComponent <Text>().set_text(data.level.ToString());
        string equipOccupationName = EquipGlobal.GetEquipOccupationName(data.id);

        base.FindTransform("ItemCareerLimit").GetComponent <Text>().set_text(equipOccupationName);
        base.FindTransform("AdvancedTipText").GetComponent <Text>().set_text(string.Empty);
        int i;

        for (i = 0; i < data.starNum; i++)
        {
            this.starTransformList.get_Item(i).get_gameObject().SetActive(true);
            this.starTransformList.get_Item(i).FindChild("OpenStar").get_gameObject().SetActive(false);
        }
        for (int j = i; j < this.starTransformList.get_Count(); j++)
        {
            this.starTransformList.get_Item(j).get_gameObject().SetActive(false);
        }
        Attrs attrs = DataReader <Attrs> .Get(data.attrBaseValue);

        Attrs attrs2 = DataReader <Attrs> .Get(data.attrGrowValue);

        int      key      = 0;
        EquipLib equipLib = EquipmentManager.Instance.equipmentData.equipLibs.Find((EquipLib a) => a.type == (EquipLibType.ELT)data.position);

        equipLV = equipLib.lv;
        if (EquipmentManager.Instance.dicEquips.ContainsKey(equipLib.wearingId))
        {
            key = EquipmentManager.Instance.dicEquips.get_Item(equipLib.wearingId).cfgId;
        }
        zZhuangBeiPeiZhiBiao zZhuangBeiPeiZhiBiao = DataReader <zZhuangBeiPeiZhiBiao> .Get(key);

        if (attrs != null)
        {
            for (int k = 0; k < attrs.attrs.get_Count(); k++)
            {
                if (k > 2)
                {
                    break;
                }
                long value = (long)attrs.values.get_Item(k);
                this.BaseAttr.FindChild("EquipItem2Text" + k).get_gameObject().SetActive(true);
                this.BaseAttr.FindChild("EquipItem2Text" + k).FindChild("Item2Text").GetComponent <Text>().set_text(AttrUtility.GetStandardAddDesc((GameData.AttrType)attrs.attrs.get_Item(k), value, "ff7d4b"));
                if (attrs2 != null)
                {
                    int  num    = attrs2.values.get_Item(k) * equipLV;
                    long value2 = (long)num;
                    this.BaseAttr.FindChild("EquipItem2Text" + k).FindChild("Item2TextRange").GetComponent <Text>().set_text("(强化 +" + AttrUtility.GetAttrValueDisplay((GameData.AttrType)attrs2.attrs.get_Item(k), value2) + ")");
                    if (!this.IsWearing)
                    {
                        if (zZhuangBeiPeiZhiBiao != null)
                        {
                            Attrs attrs3 = DataReader <Attrs> .Get(zZhuangBeiPeiZhiBiao.attrGrowValue);

                            float num2 = (float)(attrs3.values.get_Item(k) * equipLV);
                            if (num2 > (float)num)
                            {
                                this.BaseAttr.FindChild("EquipItem2Text" + k).FindChild("Attrup").get_gameObject().SetActive(false);
                                this.BaseAttr.FindChild("EquipItem2Text" + k).FindChild("Attrdown").get_gameObject().SetActive(true);
                            }
                            else if (num2 == (float)num)
                            {
                                this.BaseAttr.FindChild("EquipItem2Text" + k).FindChild("Attrup").get_gameObject().SetActive(false);
                                this.BaseAttr.FindChild("EquipItem2Text" + k).FindChild("Attrdown").get_gameObject().SetActive(false);
                            }
                            else
                            {
                                this.BaseAttr.FindChild("EquipItem2Text" + k).FindChild("Attrup").get_gameObject().SetActive(true);
                                this.BaseAttr.FindChild("EquipItem2Text" + k).FindChild("Attrdown").get_gameObject().SetActive(false);
                            }
                        }
                    }
                    else
                    {
                        this.BaseAttr.FindChild("EquipItem2Text" + k).FindChild("Attrup").get_gameObject().SetActive(false);
                        this.BaseAttr.FindChild("EquipItem2Text" + k).FindChild("Attrdown").get_gameObject().SetActive(false);
                    }
                }
            }
            for (int l = attrs.attrs.get_Count(); l < 3; l++)
            {
                this.BaseAttr.FindChild("EquipItem2Text" + l).get_gameObject().SetActive(false);
            }
        }
    }