Beispiel #1
0
    private void UpdateEmbedEnchantmentList()
    {
        this.equipEnchantmentListPool.Clear();
        EquipSimpleInfo wearingEquipSimpleInfoByPos = EquipGlobal.GetWearingEquipSimpleInfoByPos(this.EquipPos);

        if (wearingEquipSimpleInfoByPos != null && wearingEquipSimpleInfoByPos.enchantAttrs != null && wearingEquipSimpleInfoByPos.enchantAttrs.get_Count() > 0)
        {
            List <int> typeIdList = new List <int>();
            for (int i = 0; i < wearingEquipSimpleInfoByPos.enchantAttrs.get_Count(); i++)
            {
                int attrId = wearingEquipSimpleInfoByPos.enchantAttrs.get_Item(i).attrId;
                if (attrId > 0)
                {
                    typeIdList.Add(attrId);
                }
            }
            this.equipEnchantmentListPool.Create(typeIdList.get_Count(), delegate(int index)
            {
                if (index < typeIdList.get_Count() && index < this.equipEnchantmentListPool.Items.get_Count())
                {
                    RewardItem component = this.equipEnchantmentListPool.Items.get_Item(index).GetComponent <RewardItem>();
                    component.SetRewardItem(typeIdList.get_Item(index), -1L, 0L);
                }
            });
        }
    }
Beispiel #2
0
    private void UpdateEmbedGemList()
    {
        this.equipGemListPool.Clear();
        EquipSimpleInfo wearingEquipSimpleInfoByPos = EquipGlobal.GetWearingEquipSimpleInfoByPos(this.EquipPos);

        if (wearingEquipSimpleInfoByPos != null)
        {
            List <int> gemTypeIdList = new List <int>();
            for (int i = 0; i < 4; i++)
            {
                GemEmbedInfo gemEmbedInfo = GemManager.Instance.equipSlots[this.EquipPos - EquipLibType.ELT.Weapon, i];
                if (gemEmbedInfo != null && gemEmbedInfo.typeId > 0)
                {
                    gemTypeIdList.Add(gemEmbedInfo.typeId);
                }
            }
            this.equipGemListPool.Create(gemTypeIdList.get_Count(), delegate(int index)
            {
                if (index < gemTypeIdList.get_Count() && index < this.equipGemListPool.Items.get_Count())
                {
                    RewardItem component = this.equipGemListPool.Items.get_Item(index).GetComponent <RewardItem>();
                    component.SetRewardItem(gemTypeIdList.get_Item(index), -1L, 0L);
                }
            });
        }
    }
Beispiel #3
0
    private void SetEquipPartBtn(EquipLibType.ELT type)
    {
        if (!this.equipPartTransDic.ContainsKey(type))
        {
            return;
        }
        if (EquipmentManager.Instance.equipmentData == null || EquipmentManager.Instance.equipmentData.equipLibs == null)
        {
            return;
        }
        EquipLib equipLib = EquipmentManager.Instance.equipmentData.equipLibs.Find((EquipLib a) => a.type == type);

        if (equipLib == null)
        {
            return;
        }
        EquipSimpleInfo wearingEquipSimpleInfoByPos = EquipGlobal.GetWearingEquipSimpleInfoByPos(type);

        if (wearingEquipSimpleInfoByPos == null)
        {
            return;
        }
        Dictionary <string, string> iconNamesByEquipPos = EquipGlobal.GetIconNamesByEquipPos(type, true);

        if (iconNamesByEquipPos == null)
        {
            return;
        }
        int       excellentAttrsCountByColor = EquipGlobal.GetExcellentAttrsCountByColor(wearingEquipSimpleInfoByPos.equipId, 1f);
        Transform transform = this.equipPartTransDic.get_Item(type).FindChild("ImageIcon");

        this.equipPartTransDic.get_Item(type).FindChild("Num").GetComponent <Text>().set_text((equipLib.lv <= 0) ? string.Empty : ("+" + equipLib.lv));
        this.equipPartTransDic.get_Item(type).FindChild("EquipStepText").GetComponent <Text>().set_text(iconNamesByEquipPos.get_Item("EquipStep"));
        ResourceManager.SetSprite(this.equipPartTransDic.get_Item(type).FindChild("ImageIcon").GetComponent <Image>(), ResourceManager.GetIconSprite(iconNamesByEquipPos.get_Item("IconName")));
        if (this.equipPartFxDic.ContainsKey(type))
        {
            FXSpineManager.Instance.DeleteSpine(this.equipPartFxDic.get_Item(type), true);
        }
        TaoZhuangDuanZhu equipForgeCfgData = EquipGlobal.GetEquipForgeCfgData(wearingEquipSimpleInfoByPos.equipId);
        int num;

        if (equipForgeCfgData != null && wearingEquipSimpleInfoByPos.suitId > 0)
        {
            ResourceManager.SetSprite(this.equipPartTransDic.get_Item(type).FindChild("ImageFrame").GetComponent <Image>(), ResourceManager.GetIconSprite(equipForgeCfgData.frame));
            num = FXSpineManager.Instance.PlaySpine(equipForgeCfgData.fxId, transform, "EquipDetailedUI", 2000, null, "UI", 0f, 0f, 1f, 1f, false, FXMaskLayer.MaskState.None);
        }
        else
        {
            ResourceManager.SetSprite(this.equipPartTransDic.get_Item(type).FindChild("ImageFrame").GetComponent <Image>(), ResourceManager.GetIconSprite(iconNamesByEquipPos.get_Item("IconFrameName")));
            num = EquipGlobal.GetEquipIconFX(wearingEquipSimpleInfoByPos.cfgId, excellentAttrsCountByColor, transform, "EquipPartBtns", 2000, false);
        }
        if (this.equipPartFxDic.ContainsKey(type))
        {
            this.equipPartFxDic.set_Item(type, num);
        }
        this.equipPartTransDic.get_Item(type).FindChild("ExcellentAttrIconList").FindChild("Image1").GetComponent <Image>().set_enabled(excellentAttrsCountByColor >= 1);
        this.equipPartTransDic.get_Item(type).FindChild("ExcellentAttrIconList").FindChild("Image2").GetComponent <Image>().set_enabled(excellentAttrsCountByColor >= 2);
        this.equipPartTransDic.get_Item(type).FindChild("ExcellentAttrIconList").FindChild("Image3").GetComponent <Image>().set_enabled(excellentAttrsCountByColor >= 3);
        this.equipPartTransDic.get_Item(type).FindChild("ImageBinding").get_gameObject().SetActive(false);
    }
Beispiel #4
0
    private void OnEquipWeapon(int equipCfgID)
    {
        if (this.roleModel == null)
        {
            return;
        }
        int             gogokNum = 0;
        EquipSimpleInfo wearingEquipSimpleInfoByPos = EquipGlobal.GetWearingEquipSimpleInfoByPos(EquipLibType.ELT.Weapon);

        if (wearingEquipSimpleInfoByPos != null)
        {
            long equipId = wearingEquipSimpleInfoByPos.equipId;
            gogokNum = EquipGlobal.GetExcellentAttrsCountByColor(equipId, 1f);
        }
        this.roleModel.EquipOn(equipCfgID, gogokNum);
    }
Beispiel #5
0
    private void UpdateEmbedStarList()
    {
        this.equipStarUpListPool.Clear();
        EquipSimpleInfo wearingEquipSimpleInfoByPos = EquipGlobal.GetWearingEquipSimpleInfoByPos(this.EquipPos);

        if (wearingEquipSimpleInfoByPos != null && wearingEquipSimpleInfoByPos.starToMaterial != null && wearingEquipSimpleInfoByPos.starToMaterial.get_Count() > 0)
        {
            List <int> typeIdList = wearingEquipSimpleInfoByPos.starToMaterial;
            this.equipStarUpListPool.Create(typeIdList.get_Count(), delegate(int index)
            {
                if (index < typeIdList.get_Count() && index < this.equipStarUpListPool.Items.get_Count())
                {
                    Image component            = this.equipStarUpListPool.Items.get_Item(index).get_transform().FindChild("OpenStar").GetComponent <Image>();
                    string starLevelSpriteName = this.GetStarLevelSpriteName(typeIdList.get_Item(index));
                    ResourceManager.SetSprite(component, ResourceManager.GetIconSprite(starLevelSpriteName));
                }
            });
        }
    }
Beispiel #6
0
    private void UpdateSuitForgeContent()
    {
        EquipSimpleInfo wearingEquipSimpleInfoByPos = EquipGlobal.GetWearingEquipSimpleInfoByPos(this.EquipPos);

        if (wearingEquipSimpleInfoByPos != null)
        {
            if (wearingEquipSimpleInfoByPos.suitId <= 0)
            {
                if (EquipGlobal.CheckForgeMaterialIsEnough(wearingEquipSimpleInfoByPos.equipId))
                {
                    this.equipPosTipText.set_text(GameDataUtils.GetChineseContent(510208, false));
                }
                else
                {
                    this.equipPosTipText.set_text(TextColorMgr.GetColor(GameDataUtils.GetChineseContent(510209, false), "ff0000", string.Empty));
                }
            }
            else
            {
                this.equipPosTipText.set_text(TextColorMgr.GetColor(GameDataUtils.GetChineseContent(510207, false), "33beff", string.Empty));
            }
        }
    }