Ejemplo n.º 1
0
        // ================== 已装备属性 ==================

        public void ShowEquippedInfo(int[] eids)
        {
            if (eids == null)
            {
                return;
            }

            var attr = new HeroEquipmentTotleAttr();

            for (int i = 0; i < eids.Length; i++)
            {
                int eid = eids[i];

                if (eid != 0)
                {
                    DetailedEquipmentInfo info = LTPartnerEquipDataManager.Instance.GetEquipmentInfoByEID(eid);

                    if (info == null)
                    {
                        continue;
                    }

                    attr.AddSuitInfo(info);
                }
            }

            ShowEquippedSuitView(attr.SuitList);
            ShowEquippedAttr(attr);
        }
Ejemplo n.º 2
0
        public void GetSelectUpLevelItemExp(DetailedEquipmentInfo Equip, out int UpLevel, out int UpExp)
        {
            int totleExp = 0;

            for (int i = 0; i < UpLevelSelectList.Count; ++i)
            {
                totleExp += LTPartnerEquipDataManager.Instance.GetTotleExpByEid(UpLevelSelectList[i]);
            }
            foreach (var item in EquipUpItemNumDic)
            {
                totleExp += LTPartnerEquipDataManager.Instance.getEquipUpItemExp(item.Key) * item.Value;
            }
            UpExp = totleExp;

            int level = 0;

            totleExp += Equip.Exp;
            var temp = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetLevelUpListByQuality(Equip.QualityLevel);

            for (int i = 0; i < temp.Count; ++i)
            {
                if (totleExp < temp[i].TotalNeedExp)
                {
                    level = i;
                    break;
                }
            }
            UpLevel = level;
        }
Ejemplo n.º 3
0
 public void PlayFxLevelUp()
 {
     OldData = data;
     data    = LTPartnerEquipDataManager.Instance.GetEquipmentInfoByEID(data.Eid);
     StartCoroutine(LevelUpScrollAniPlay());
     StartCoroutine(LevelUpAttrAniPlay());
 }
Ejemplo n.º 4
0
        public bool IsCheckEquipUpLv()
        {
            if (HeroId <= 0)
            {
                return(false);
            }

            if (!IsGoIntoBattle)
            {
                return(false);
            }

            bool isOK = false;
            List <BaseEquipmentInfo> equipList = LTPartnerEquipDataManager.Instance.GetFreeEquipInfoList();
            List <int> EquipType = new List <int>();

            for (int i = 0; i < equipList.Count; i++)
            {
                if (!EquipType.Contains((int)equipList[i].Type))
                {
                    EquipType.Add((int)equipList[i].Type);
                }
                if (EquipType.Count == 6)
                {
                    break;
                }
            }
            if (equipList.Count == 0)
            {
                return(false);
            }

            HeroEquipmentInfo[] e = EquipmentsInfo;
            for (int i = 0; i < e.Length; i++)
            {
                if (e[i].Eid != 0)//有装备看是否到15级
                {
                    DetailedEquipmentInfo info = LTPartnerEquipDataManager.Instance.GetEquipmentInfoByEID(e[i].Eid);
                    if (info == null)
                    {
                        EB.Debug.LogError("IsCheckEquipUpLv info is null,Eid = {0}", e[i].Eid);
                        continue;
                    }
                    if (info.EquipLevel != 15)
                    {
                        isOK = true; break;
                    }
                }
                else//没装备看能否穿装备
                {
                    if (EquipType.Contains(i + 1))
                    {
                        isOK = true; break;
                    }
                }
            }
            return(isOK);
        }
Ejemplo n.º 5
0
 public override void SetMenuData(object param)
 {
     EquipmentInfo = param as DetailedEquipmentInfo;
     if (EquipmentInfo != null)
     {
         Equipcell.Fill(EquipmentInfo);
         InitEquipShow(EquipmentInfo);
     }
 }
Ejemplo n.º 6
0
 public void OnLockBtnClick()
 {
     LTPartnerEquipDataManager.Instance.RequireLock(data.Eid, !data.isLock, delegate {
         data = LTPartnerEquipDataManager.Instance.GetEquipmentInfoByEID(data.Eid);
         if (data == null)
         {
             EB.Debug.LogError("LTEquipmentSecondInfo.OnLockBtnClick data is null");
             return;
         }
         LockIcon.spriteName = data.isLock ? "Equipment_Icon_Suoding" : "Equipment_Icon_Jiesuo";
         Hotfix_LT.Messenger.Raise(Hotfix_LT.EventName.OnPartnerEquipChange);
     });
 }
Ejemplo n.º 7
0
        public DetailedEquipmentInfo GetEquipmentInfoByEID(int EID)
        {
            Hashtable data;

            DataLookupsCache.Instance.SearchDataByID <Hashtable>(string.Format("inventory.{0}", EID), out data);
            if (data == null)
            {
                EB.Debug.LogError("LTPartnerEquipDataManager.GetEquipmentInfoByEID not found this Equip,EId = {0}", EID);
                return(null);
            }
            DetailedEquipmentInfo info = PreseDetailedEquipmentInfor(data, EID);

            return(info);
        }
Ejemplo n.º 8
0
 /// <summary>
 /// 判断是否显示合成按钮,以及相关处理
 /// </summary>
 /// <param name="isShow"></param>
 public void ShowSynthesis(DetailedEquipmentInfo data)
 {
     if (data.EquipLevel >= MaxLevel && data.QualityLevel == 6)
     {
         //获取创建账号登录时间
         Hotfix_LT.Data.FuncTemplate tempFun = new Hotfix_LT.Data.FuncTemplate();
         tempFun = Hotfix_LT.Data.FuncTemplateManager.Instance.GetFunc(10086);
         bool isUnLock = false;
         if (tempFun == null)
         {
             isUnLock = true;
         }
         else
         {
             isUnLock = tempFun.IsConditionOK();
         }
         UpLevelBtnRoot.CustomSetActive(false);
         SynthesisBtn.CustomSetActive(true);
         ///先做修改进行测试
         if (isUnLock)
         {
             SynthesisLabelTop.transform.localPosition = new Vector3(0, 14, 0);
             SynthesisLabelTop.transform.localScale    = Vector3.one;
             SynthesisReflashTip.text = "";
             SynthesisBtnBG.GetComponent <BoxCollider>().enabled = isUnLock;
             SynthesisBtnBG.GetComponent <UISprite>().color      = new Color(1, 1, 1, 1);
             SynthesisBtnBG.GetComponent <UISprite>().spriteName = "Ty_Button_3";
         }
         else
         {
             SynthesisLabelTop.transform.localPosition = new Vector3(0, 50, 0);
             SynthesisLabelTop.transform.localScale    = Vector3.one;
             SynthesisReflashTip.text = tempFun.GetConditionStr();
             SynthesisBtnBG.GetComponent <BoxCollider>().enabled = false;
             SynthesisBtnBG.GetComponent <UISprite>().color      = new Color(1, 0, 1, 1);
             SynthesisBtnBG.GetComponent <UISprite>().spriteName = "Ty_Button_1";
         }
     }
     else
     {
         UpLevelBtnRoot.CustomSetActive(true);
         SynthesisBtn.CustomSetActive(false);
     }
 }
Ejemplo n.º 9
0
        private void InitEquipShow(DetailedEquipmentInfo info)
        {
            MainAttr.GetChild(0).GetComponent <UILabel>().text = "[fff348]" + EquipmentUtility.AttrTypeTrans(info.MainAttributes.Name);
            MainAttr.GetChild(1).GetComponent <UILabel>().text = EquipmentUtility.AttrTypeValue(info.MainAttributes);
            int ExIndex = info.ExAttributes.Count - 1;

            for (int i = 0; i < 4; i++)
            {
                if (i > ExIndex)
                {
                    ExAttr[i].gameObject.CustomSetActive(false);
                }
                else
                {
                    string ExNameStr = EquipmentUtility.AttrTypeTrans(info.ExAttributes[i].Name);
                    ExAttr[i].GetChild(0).GetComponent <UILabel>().text = ExNameStr;
                    ExAttr[i].GetChild(1).GetComponent <UILabel>().text = EquipmentUtility.AttrTypeValue(info.ExAttributes[i]);
                    ExAttr[i].gameObject.CustomSetActive(true);
                }
            }
        }
Ejemplo n.º 10
0
        /// <summary>
        /// 装备栏
        /// </summary>
        /// <param name="equipmentInfo"></param>
        private void SetHeroEquipment(Hashtable equipmentInfo)
        {
            for (int i = 0; i < equipments.Length; i++)
            {
                equipments[i].SetCellData(this, -1, -1, -1);
            }

            if (equipmentInfo == null)
            {
                EB.Debug.Log("null equipment");
                return;;
            }

            foreach (Hashtable info in equipmentInfo.Values)
            {
                if (info == null || info["equipment_type"] == null)
                {
                    continue;
                }
                int equipmentType  = int.Parse(info["equipment_type"].ToString());
                int eid            = int.Parse(info["economy_id"].ToString());
                int equipmentLevel = EB.Dot.Integer("level", info, 0);

                DetailedEquipmentInfo einfo = info.ContainsKey("currentLevel") ? LTPartnerEquipDataManager.Instance.GetEquipmentInfoByEID(info) :
                                              LTPartnerEquipDataManager.Instance.GetEquipmentInfoByEID(int.Parse(info["inventory_id"].ToString()));

                if (!equipmentAttrs.ContainsKey(eid))
                {
                    equipmentAttrs.Add(eid, einfo);
                }
                else
                {
                    equipmentAttrs[eid] = einfo;
                }

                equipments[equipmentType - 1].SetCellData(this, eid, equipmentType, equipmentLevel);
            }
        }
Ejemplo n.º 11
0
        private void SetSuit(DetailedEquipmentInfo info)
        {
            LockObj.CustomSetActive(info.isLock);
            LevelBG.gameObject.CustomSetActive(info.EquipLevel > 0);
            if (info.EquipLevel > 0)
            {
                Level.text = string.Format("+{0}", info.EquipLevel);
            }
            LevelBG.spriteName  = UIItemLvlDataLookup.GetEquipLevelBGStr(info.QualityLevel);
            SuitType.spriteName = info.SuitIcon;

            SuitEffect.CustomSetActive(false);
            int count = (Hotfix_LT.Data.EconemyTemplateManager.Instance.GetSuitTypeInfoByEcidSuitType(info.SuitType).SuitAttr2 != 0) ? 2 : 4;//套装件数

            for (int i = 0; i < partnerData.EquipmentTotleAttr.SuitList.Count; i++)
            {
                if (partnerData.EquipmentTotleAttr.SuitList[i].SuitType == info.SuitType && partnerData.EquipmentTotleAttr.SuitList[i].count >= count)
                {
                    SuitEffect.CustomSetActive(true);
                    break;
                }
            }
        }
Ejemplo n.º 12
0
 private void Init()
 {
     isHaveEquip = false;
     SuitType.gameObject.CustomSetActive(eid != 0);
     if (eid == 0)
     {
         SetEquipActive(false);
         SuitEffect.CustomSetActive(false);
         LockObj.CustomSetActive(false);
         LevelBG.gameObject.CustomSetActive(false);
         IconBG.CustomSetActive(true);
         if (partnerData.HeroId <= 0)
         {
             SetAddIconObj(false);
         }
         else
         {
             isHaveEquip = IsHaveEquip();
             SetAddIconObj(isHaveEquip);
         }
     }
     else
     {
         SetEquipActive(true);
         SetAddIconObj(false);
         IconBG.CustomSetActive(false);
         DetailedEquipmentInfo info = LTPartnerEquipDataManager.Instance.GetEquipmentInfoByEID(eid);
         if (info == null)
         {
             EB.Debug.LogError("LTPartnerEquipItemController.Init info is null");
             return;
         }
         SetIcon(info.IconName);
         SetFrame(info.QualityLevel);
         SetSuit(info);
     }
 }
Ejemplo n.º 13
0
 public void OnLockBtnClick()
 {
     LTPartnerEquipDataManager.Instance.RequireLock(data.Eid, !data.isLock, delegate
     {
         data = LTPartnerEquipDataManager.Instance.GetEquipmentInfoByEID(data.Eid);
         if (data == null)
         {
             EB.Debug.LogError("LTEquipmentFirstinfo.OnLockBtnClick data is null");
             return;
         }
         LockIcon.spriteName = data.isLock ? "Equipment_Icon_Suoding" : "Equipment_Icon_Jiesuo";
         Hotfix_LT.Messenger.Raise(Hotfix_LT.EventName.OnPartnerEquipChange);
         if (m_type == 2)
         {
             if (LTPartnerEquipDataManager.Instance.UpLevelSelectList.Contains(data.Eid))
             {
                 LTPartnerEquipDataManager.Instance.UpLevelSelectList.Remove(data.Eid);
             }
             SelectEquipEven.LockBtnClick(data.Eid);
             SelectEquipEven.ChooseEquipment();
             mDMono.transform.parent.GetComponent <UIController>().Close();
         }
     });
 }
Ejemplo n.º 14
0
        /// <summary>
        /// 刷新强化所有属性
        /// </summary>
        /// <param name="eid"></param>
        public void Show(int eid)
        {
            StopAllCoroutines();
            SliderFx.ResetList();
            LabelFx.ResetList();
            data = LTPartnerEquipDataManager.Instance.GetEquipmentInfoByEID(eid);
            if (data == null)
            {
                EB.Debug.LogError("LTPartnerEquipUplevelController.Show data is null,Eid = {0}", eid);
                return;
            }
            if (data.Eid == 0)
            {
                return;
            }
            UpLeveItem.Fill(data);
            ItemNameLabel.applyGradient  = true;
            ItemNameLabel.gradientTop    = LT.Hotfix.Utility.ColorUtility.QualityToGradientTopColor(data.QualityLevel);
            ItemNameLabel.gradientBottom = LT.Hotfix.Utility.ColorUtility.QualityToGradientBottomColor(data.QualityLevel);
            ItemNameLabel.text           = data.Name;
            LevelUpList        = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetLevelUpListByQuality(data.QualityLevel);
            nowLevelLabel.text = nowLevelLabel.transform.GetChild(0).GetComponent <UILabel>().text = nextLevelLabel.text = nextLevelLabel.transform.GetChild(0).GetComponent <UILabel>().text = data.EquipLevel.ToString();
            nextLevelLabel.gameObject.CustomSetActive(false);
            NextLevel          = data.EquipLevel;
            MaxLevel           = LevelUpList.Count;
            maxLevelLabel.text = maxLevelLabel.transform.GetChild(0).GetComponent <UILabel>().text = MaxLevel.ToString();
            if (data.MainAttributes.Name != null)
            {
                MainAttrObj.AttrName.text = AttrTypeTrans(data.MainAttributes.Name);
                MainAttrObj.CurValue.text = AttrTrans(data.MainAttributes);
                // MainAttrObj.FxObj.CustomSetActive(false);
                if (MainAttrObj.NextValue.gameObject.activeSelf)
                {
                    MainAttrObj.CurValue.GetComponent <TweenScale>().ResetToBeginning();
                    MainAttrObj.CurValue.GetComponent <TweenScale>().PlayForward();
                    MainAttrObj.NextValue.gameObject.CustomSetActive(false);
                }
            }
            else
            {
                EB.Debug.LogError(string.Format("Equipment(id={0}) Main Attribbute is Missing", data.Eid));
                MainAttrObj.AttrName.gameObject.CustomSetActive(false);
                MainAttrObj.CurValue.gameObject.CustomSetActive(false);
                MainAttrObj.NextValue.gameObject.CustomSetActive(false);
                MainAttrObj.LockObj.CustomSetActive(false);
                // MainAttrObj.FxObj.CustomSetActive(false);
            }
            int UpLv = data.EquipLevel / 3;
            int high = 0;
            EquipAttributeRate rate = EconemyTemplateManager.Instance.GetEquipAttributeRate(data.QualityLevel);

            for (int i = rate.rating.Count - 1; i >= 0; i--)
            {
                if (rate.rating[i] > 0)
                {
                    high = i;
                    break;
                }
            }
            for (int i = 0; i < 4; i++)
            {
                if (i < data.ExAttributes.Count)
                {
                    ExAttrObj[i].AttrName.text = AttrTypeTrans(data.ExAttributes[i].Name);
                    ExAttrObj[i].CurValue.text = AttrTrans(data.ExAttributes[i]);
                    ExAttrObj[i].AttrName.gameObject.CustomSetActive(true);
                    ExAttrObj[i].CurValue.gameObject.CustomSetActive(true);
                    ExAttrObj[i].LockObj.CustomSetActive(false);
                    if (ExAttrObj[i].NextValue.gameObject.activeSelf)
                    {
                        ExAttrObj[i].CurValue.GetComponent <TweenScale>().ResetToBeginning();
                        ExAttrObj[i].CurValue.GetComponent <TweenScale>().PlayForward();
                        ExAttrObj[i].NextValue.gameObject.CustomSetActive(false);
                    }
                }
                else
                {
                    UpLv++;
                    if (i < high)
                    {
                        ExAttrObj[i].LockObj.GetComponent <UILabel>().text = ExAttrObj[i].LockObj.transform.GetChild(0).GetComponent <UILabel>().text = string.Format(EB.Localizer.GetString("ID_codefont_in_LTPartnerEquipUplevelController_4355"), UpLv * 3);
                    }
                    else
                    {
                        ExAttrObj[i].LockObj.GetComponent <UILabel>().text = ExAttrObj[i].LockObj.transform.GetChild(0).GetComponent <UILabel>().text = string.Empty;
                    }
                    ExAttrObj[i].AttrName.gameObject.CustomSetActive(false);
                    ExAttrObj[i].CurValue.gameObject.CustomSetActive(false);
                    ExAttrObj[i].NextValue.gameObject.CustomSetActive(false);
                    ExAttrObj[i].LockObj.CustomSetActive(true);
                    // ExAttrObj[i].FxObj.CustomSetActive(false);
                }
            }
            int NowExp      = 0;
            int NeedExp     = 0;
            int OverPlueExp = 0;

            if (data.EquipLevel < MaxLevel)
            {
                Hotfix_LT.Data.EquipmentLevelUp LevelUpInfo = LevelUpList[data.EquipLevel];
                OverPlueExp = LevelUpInfo.TotalNeedExp - LevelUpInfo.needExp;

                NowExp           = data.Exp - OverPlueExp;
                NeedExp          = LevelUpInfo.needExp;
                SliderLabel.text = string.Format("{0}/{1}", NowExp, NeedExp);
            }
            else
            {
                SliderLabel.text = string.Format(EB.Localizer.GetString("ID_codefont_in_LTEquipLabelAni_1251"));
            }

            nowExpSlider.value = nextExpSlider.value = (data.EquipLevel >= MaxLevel) ? 1.0f : ((float)NowExp / (float)NeedExp);
            CostLabel.text     = CostLabel.transform.GetChild(0).GetComponent <UILabel>().text = "0";
            //CostLabel.updateAnchors = UIRect.AnchorUpdate.OnUpdate;
            CostIcon.UpdateAnchors();
            SetUplevelBtn();
        }
Ejemplo n.º 15
0
        public void AddSuitInfo(DetailedEquipmentInfo info)
        {
            bool unFind = true;

            for (int j = 0; j < this.SuitList.Count; j++)
            {
                if (info.SuitType == this.SuitList[j].SuitType)
                {
                    this.SuitList[j].count += 1;
                    unFind = false;
                    break;
                }
            }
            if (unFind)
            {
                SuitAttrsSuitTypeAndCount mTemp = new SuitAttrsSuitTypeAndCount(info.SuitType);
                this.SuitList.Add(mTemp);
            }
            switch (info.MainAttributes.Name)
            {
            case "ATK": this.ATK += info.MainAttributes.Value; break;

            case "MaxHP": this.MaxHP += info.MainAttributes.Value; break;

            case "DEF": this.DEF += info.MainAttributes.Value; break;

            case "CritP": this.CritP += info.MainAttributes.Value; break;

            case "CritV": this.CritV += info.MainAttributes.Value; break;

            case "ChainAtk": this.ChainAtk += info.MainAttributes.Value; break;

            case "SpExtra": this.SpExtra += info.MainAttributes.Value; break;

            case "SpRes": this.SpRes += info.MainAttributes.Value; break;

            case "MaxHPrate": this.MaxHPrate += info.MainAttributes.Value; break;

            case "ATKrate": this.ATKrate += info.MainAttributes.Value; break;

            case "DEFrate": this.DEFrate += info.MainAttributes.Value; break;

            case "Speed": this.Speed += info.MainAttributes.Value; break;

            case "speedrate": this.Speedrate += info.MainAttributes.Value; break;

            default: EB.Debug.LogWarning("Equipment MainAttribute Miss{0}", info.MainAttributes.Name); break;
            }
            for (int j = 0; j < info.ExAttributes.Count; j++)
            {
                switch (info.ExAttributes[j].Name)
                {
                case "ATK": this.ATK += info.ExAttributes[j].Value; break;

                case "MaxHP": this.MaxHP += info.ExAttributes[j].Value; break;

                case "DEF": this.DEF += info.ExAttributes[j].Value; break;

                case "CritP": this.CritP += info.ExAttributes[j].Value; break;

                case "CritV": this.CritV += info.ExAttributes[j].Value; break;

                case "ChainAtk": this.ChainAtk += info.ExAttributes[j].Value; break;

                case "SpExtra": this.SpExtra += info.ExAttributes[j].Value; break;

                case "SpRes": this.SpRes += info.ExAttributes[j].Value; break;

                case "MaxHPrate": this.MaxHPrate += info.ExAttributes[j].Value; break;

                case "ATKrate": this.ATKrate += info.ExAttributes[j].Value; break;

                case "DEFrate": this.DEFrate += info.ExAttributes[j].Value; break;

                case "Speed": this.Speed += info.ExAttributes[j].Value; break;

                case "speedrate": this.Speedrate += info.ExAttributes[j].Value; break;

                default: EB.Debug.LogWarning("Equipment ExAttribute Miss{0}", info.ExAttributes[j].Name); break;
                }
            }
        }
Ejemplo n.º 16
0
        public void OnEquipmentClick(int Eid, int equipmentLevel, int equipmentType)
        {
            infoPanel.gameObject.SetActive(true);
            infoPanel.GetComponent <TweenScale>().ResetToBeginning();
            infoPanel.GetComponent <TweenScale>().PlayForward();
            ClickItemCell.SetCellData(this, Eid, equipmentType, equipmentLevel);
            Hotfix_LT.Data.EquipmentItemTemplate tpl = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetEquipment(Eid);
            DetailedEquipmentInfo attr = equipmentAttrs[Eid];

            Effect_4Label.effectStyle = UILabel.Effect.None;
            Effect_4Label.transform.GetChild(1).GetComponent <UISprite>().color = new Color(0.75f, 0.75f, 0.75f);
            ClickItemTitle.applyGradient  = true;
            ClickItemTitle.gradientTop    = LT.Hotfix.Utility.ColorUtility.QualityToGradientTopColor(tpl.QualityLevel);
            ClickItemTitle.gradientBottom = LT.Hotfix.Utility.ColorUtility.QualityToGradientBottomColor(tpl.QualityLevel);
            ClickItemTitle.text           = ClickItemTitle.transform.GetChild(0).GetComponent <UILabel>().text = tpl.Name;
            Hotfix_LT.Data.SkillTemplate suitAttr1 = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(tpl.SuitAttrId_1);
            Hotfix_LT.Data.SkillTemplate suitAttr2 = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(tpl.SuitAttrId_2);
            int need       = 0;
            int SuitAttrId = -1;

            if (suitAttr1 != null)
            {
                need = 2;
                string FirstSuitAttr = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(tpl.SuitAttrId_1).Description;
                SuitAttrId = tpl.SuitAttrId_1;
                if (data.equipmentSuits.Count > 0)
                {
                    LTUIUtil.SetText(Effect_4Label, string.Format(EB.Localizer.GetString("ID_codefont_in_LTEquipmentFirstInfo_1924"), LTPartnerEquipConfig.HasEffectStrDic[data.equipmentSuits[SuitAttrId] >= need], FirstSuitAttr));
                }
            }
            else if (suitAttr2 != null)
            {
                need       = 4;
                SuitAttrId = tpl.SuitAttrId_2;
                string SecondSuitAttr = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(tpl.SuitAttrId_2).Description;
                LTUIUtil.SetText(Effect_4Label, string.Format(EB.Localizer.GetString("ID_codefont_in_LTEquipmentFirstInfo_2136"), LTPartnerEquipConfig.HasEffectStrDic[data.equipmentSuits[SuitAttrId] >= need], SecondSuitAttr));
            }

            if (data.equipmentSuits.Count > 0 && data.equipmentSuits[SuitAttrId] >= need)
            {
                Effect_4Label.effectStyle = UILabel.Effect.Outline8;
                Effect_4Label.transform.GetChild(1).GetComponent <UISprite>().color = new Color(0.74f, 1f, 0.85f);
            }
            else
            {
                Effect_4Label.effectStyle = UILabel.Effect.None;
                Effect_4Label.transform.GetChild(1).GetComponent <UISprite>().color = new Color(0.75f, 0.75f, 0.75f);
            }

            EquipmentAttr MainAttributes = attr.MainAttributes;
            string        MainStr        = AttrTypeTrans(MainAttributes.Name);

            MainAttr.GetChild(0).GetComponent <UILabel>().text = "[fff348]" + MainStr;
            MainAttr.GetChild(1).GetComponent <UILabel>().text = AttrTypeValue(MainAttributes.Name, MainAttributes.Value);

            List <EquipmentAttr> exadd = attr.ExAttributes;
            int exCount = exadd.Count;

            for (int i = 0; i < 4; i++)
            {
                if (i > exCount - 1)
                {
                    ExAttr[i].gameObject.CustomSetActive(false);
                }
                else
                {
                    EquipmentAttr add        = exadd[i];
                    string        exAddName  = add.Name;
                    float         exAddValue = add.Value;
                    string        ExNameStr  = AttrTypeTrans(exAddName);
                    ExAttr[i].GetChild(0).GetComponent <UILabel>().text = ExNameStr;
                    ExAttr[i].GetChild(1).GetComponent <UILabel>().text = AttrTypeValue(exAddName, exAddValue);
                    ExAttr[i].gameObject.CustomSetActive(true);
                }
            }
            infoPanel.GetComponent <UIWidget>().height = 413 + 88 * exCount + ((Effect_4Label.gameObject.activeSelf) ? Effect_4Label.height : 0);
            EffectPos.UpdateAnchors();
            Effect2BgPos.UpdateAnchors();
            Effect4BgPos.UpdateAnchors();
        }
Ejemplo n.º 17
0
        public void Show(int type, int eid)//0为装备背包栏,1为已装备栏,2为升级背包栏
        {
            m_type = type;
            Pdata  = LTPartnerEquipMainController.CurrentPartnerData;
            if (Pdata == null)
            {
                EB.Debug.LogError("LTEquipmentFirstInfo.Show Pdata == null");
            }
            data = LTPartnerEquipDataManager.Instance.GetEquipmentInfoByEID(eid);
            if (data == null)
            {
                EB.Debug.LogError("LTEquipmentFirstInfo.Show data == null");
                return;
            }
            if (type == 0)
            {
                LevelupBtn.transform.localPosition = new Vector3(-160, -985, 0);
                LevelupBtn.transform.localScale    = Vector3.one;
                LevelupBtn.CustomSetActive(true);
                GetOffBtn.CustomSetActive(false);
                hasEquipObj.CustomSetActive(false);
                EquipSynBtn.CustomSetActive(false);

                if (Pdata == null)
                {
                    return;
                }

                var equippedId = Pdata.GetEquipmentsInfo((int)data.Type - 1).Eid;

                if (LTPartnerEquipMainController.instance.CurrentEquipmentViewState == LTPartnerEquipMainController.EquipmentViewState.PresetEditView)
                {
                    equippedId = LTPartnerEquipmentInfoController.instance.Eids[(int)data.Type - 1];
                }

                if (equippedId == 0)//没装备
                {
                    ReplaceBtn.transform.GetChild(0).GetComponent <UILabel>().text = ReplaceBtn.transform.GetChild(0).GetChild(0).GetComponent <UILabel>().text = EB.Localizer.GetString("ID_EQUIP_TIPS_LOAD");
                    SecondInfoUI.mDMono.gameObject.CustomSetActive(false);
                }
                else//有装备
                {
                    ReplaceBtn.transform.GetChild(0).GetComponent <UILabel>().text = ReplaceBtn.transform.GetChild(0).GetChild(0).GetComponent <UILabel>().text = EB.Localizer.GetString("ID_REPLACE");
                    SecondInfoUI.Show();
                    SecondInfoUI.mDMono.gameObject.CustomSetActive(true);
                }

                ReplaceBtn.CustomSetActive(true);

                Effect_4Label.effectStyle = UILabel.Effect.None;
                Effect_4Label.transform.GetChild(1).GetComponent <UISprite>().color = new Color(0.75f, 0.75f, 0.75f);
                if (data.FirstSuitAttr != null)
                {
                    Effect_4Label.text = string.Format(EB.Localizer.GetString("ID_codefont_in_LTEquipmentFirstInfo_1924"), LTPartnerEquipConfig.HasEffectStrDic[false], data.FirstSuitAttr);
                }
                else if (data.SecondSuitAttr != null)
                {
                    Effect_4Label.text = string.Format(EB.Localizer.GetString("ID_codefont_in_LTEquipmentFirstInfo_2136"), LTPartnerEquipConfig.HasEffectStrDic[false], data.SecondSuitAttr);
                }
            }
            else if (type == 1)
            {
                LevelupBtn.transform.localPosition = new Vector3(-160, -985, 0);
                LevelupBtn.transform.localScale    = Vector3.one;
                LevelupBtn.CustomSetActive(true);
                GetOffBtn.CustomSetActive(true);
                hasEquipObj.CustomSetActive(true);
                ReplaceBtn.CustomSetActive(false);
                EquipSynBtn.CustomSetActive(false);
                SecondInfoUI.mDMono.gameObject.CustomSetActive(false);
                if (LTPartnerEquipMainController.m_Open && LTPartnerEquipMainController.instance.CurrentEquipmentViewState != LTPartnerEquipMainController.EquipmentViewState.PresetView)
                {
                    GetOffBtn.transform.GetChild(0).GetComponent <UILabel>().text = GetOffBtn.transform.GetChild(0).GetChild(0).GetComponent <UILabel>().text = EB.Localizer.GetString("ID_EQUIP_TIPS_UNLOAD");
                }
                else
                {
                    GetOffBtn.transform.GetChild(0).GetComponent <UILabel>().text = GetOffBtn.transform.GetChild(0).GetChild(0).GetComponent <UILabel>().text = EB.Localizer.GetString("ID_REPLACE");
                }
                if (Pdata == null)
                {
                    return;
                }
                List <SuitAttrsSuitTypeAndCount> SuitList = Pdata.EquipmentTotleAttr.SuitList;
                int Count = 0;
                for (int i = 0; i < SuitList.Count; i++)
                {
                    if (data.SuitType == SuitList[i].SuitType)
                    {
                        Count = SuitList[i].count;
                    }
                }

                int suitNeed = 6;
                if (data.FirstSuitAttr != null)
                {
                    suitNeed           = 2;
                    Effect_4Label.text = string.Format(EB.Localizer.GetString("ID_codefont_in_LTEquipmentFirstInfo_1924"), LTPartnerEquipConfig.HasEffectStrDic[Count >= suitNeed], data.FirstSuitAttr);
                }
                else if (data.SecondSuitAttr != null)
                {
                    suitNeed           = 4;
                    Effect_4Label.text = string.Format(EB.Localizer.GetString("ID_codefont_in_LTEquipmentFirstInfo_2136"), LTPartnerEquipConfig.HasEffectStrDic[Count >= suitNeed], data.SecondSuitAttr);
                }

                if (Count >= suitNeed)
                {
                    Effect_4Label.effectStyle = UILabel.Effect.Outline8;
                    Effect_4Label.transform.GetChild(1).GetComponent <UISprite>().color = new Color(0.74f, 1f, 0.85f);
                }
                else
                {
                    Effect_4Label.effectStyle = UILabel.Effect.None;
                    Effect_4Label.transform.GetChild(1).GetComponent <UISprite>().color = new Color(0.75f, 0.75f, 0.75f);
                }
            }
            else if (type == 2)
            {
                LevelupBtn.CustomSetActive(false);
                GetOffBtn.CustomSetActive(false);
                hasEquipObj.CustomSetActive(false);
                ReplaceBtn.CustomSetActive(false);
                EquipSynBtn.CustomSetActive(false);
                SecondInfoUI.mDMono.gameObject.CustomSetActive(false);

                Effect_4Label.effectStyle = UILabel.Effect.None;
                Effect_4Label.transform.GetChild(1).GetComponent <UISprite>().color = new Color(0.75f, 0.75f, 0.75f);
                if (data.FirstSuitAttr != null)
                {
                    Effect_4Label.text = string.Format(EB.Localizer.GetString("ID_codefont_in_LTEquipmentFirstInfo_1924"), LTPartnerEquipConfig.HasEffectStrDic[false], data.FirstSuitAttr);
                }
                else if (data.SecondSuitAttr != null)
                {
                    Effect_4Label.text = string.Format(EB.Localizer.GetString("ID_codefont_in_LTEquipmentFirstInfo_2136"), LTPartnerEquipConfig.HasEffectStrDic[false], data.SecondSuitAttr);
                }
            }
            else if (type == 3)
            {
                LevelupBtn.transform.localPosition = new Vector3(160, -985, 0);
                LevelupBtn.transform.localScale    = Vector3.one;
                LevelupBtn.CustomSetActive(true);
                GetOffBtn.CustomSetActive(false);
                hasEquipObj.CustomSetActive(false);
                ReplaceBtn.CustomSetActive(false);
                //判断显示取回还是放入
                BaseEquipmentInfo[] synArray = LTPartnerEquipMainController.EquipSynArray;
                bool tempisInList            = false;

                for (int i = 0; i < synArray.Length; i++)
                {
                    if (synArray[i] != null)
                    {
                        if (synArray[i].Eid == eid)
                        {
                            //取出
                            EquipSynConditionLabel.text = EquipSynConditionLabel.transform.GetChild(0).GetComponent <UILabel>().text = EB.Localizer.GetString("ID_EQUIP_SYN_OUTOFLIST");
                            EquipSynBtn.GetComponent <ConsecutiveClickCoolTrigger>().clickEvent[0] = new EventDelegate(delegate { SelectEquipEven.SelectSynEquipment(eid, false, delegate { InforUI.controller.Close(); }); });
                            tempisInList = true;
                        }
                    }
                }
                if (!tempisInList)
                {
                    //放入
                    EquipSynConditionLabel.text = EquipSynConditionLabel.transform.GetChild(0).GetComponent <UILabel>().text = EB.Localizer.GetString("ID_EQUIP_SYN_INTOLIST");
                    EquipSynBtn.GetComponent <ConsecutiveClickCoolTrigger>().clickEvent[0] = new EventDelegate(delegate { SelectEquipEven.SelectSynEquipment(eid, true, delegate { InforUI.controller.Close(); }); });
                }
                EquipSynBtn.CustomSetActive(true);
                SecondInfoUI.mDMono.gameObject.CustomSetActive(false);
                Effect_4Label.effectStyle = UILabel.Effect.None;
                Effect_4Label.transform.GetChild(1).GetComponent <UISprite>().color = new Color(0.75f, 0.75f, 0.75f);
                if (data.FirstSuitAttr != null)
                {
                    Effect_4Label.text = string.Format(EB.Localizer.GetString("ID_codefont_in_LTEquipmentFirstInfo_1924"), LTPartnerEquipConfig.HasEffectStrDic[false], data.FirstSuitAttr);
                }
                else if (data.SecondSuitAttr != null)
                {
                    Effect_4Label.text = string.Format(EB.Localizer.GetString("ID_codefont_in_LTEquipmentFirstInfo_2136"), LTPartnerEquipConfig.HasEffectStrDic[false], data.SecondSuitAttr);
                }
            }

            DataItem.Fill(data);
            NameLabel.applyGradient  = true;
            NameLabel.gradientTop    = LT.Hotfix.Utility.ColorUtility.QualityToGradientTopColor(data.QualityLevel);
            NameLabel.gradientBottom = LT.Hotfix.Utility.ColorUtility.QualityToGradientBottomColor(data.QualityLevel);
            NameLabel.text           = NameLabel.transform.GetChild(0).GetComponent <UILabel>().text = data.Name;

            string MainStr = EquipmentUtility.AttrTypeTrans(data.MainAttributes.Name);

            MainAttr.GetChild(0).GetComponent <UILabel>().text = "[fff348]" + MainStr;
            MainAttr.GetChild(1).GetComponent <UILabel>().text = EquipmentUtility.AttrTypeValue(data.MainAttributes);
            int ExIndex = data.ExAttributes.Count - 1;

            for (int i = 0; i < 4; i++)
            {
                if (i > ExIndex)
                {
                    ExAttr[i].gameObject.CustomSetActive(false);
                }
                else
                {
                    string ExNameStr = EquipmentUtility.AttrTypeTrans(data.ExAttributes[i].Name);
                    ExAttr[i].GetChild(0).GetComponent <UILabel>().text = ExNameStr;
                    ExAttr[i].GetChild(1).GetComponent <UILabel>().text = EquipmentUtility.AttrTypeValue(data.ExAttributes[i]);
                    ExAttr[i].gameObject.CustomSetActive(true);
                }
            }
            Effect_2Label.gameObject.CustomSetActive(false);

            int trans = 0;

            if (type == 2)
            {
                trans = 166;
                EffectTrans.SetParent(EffectPos[0]);
                EffectTrans.localPosition = Vector3.zero;
            }
            else
            {
                EffectTrans.SetParent(EffectPos[1]);
                EffectTrans.localPosition = Vector3.zero;
            }
            mDMono.transform.GetComponent <UIWidget>().height = 619 + 88 * data.ExAttributes.Count + ((Effect_2Label.gameObject.activeSelf) ? Effect_2Label.height : 0) + ((Effect_4Label.gameObject.activeSelf) ? Effect_4Label.height : 0) - trans;
            LockIcon.spriteName = data.isLock ? "Equipment_Icon_Suoding" : "Equipment_Icon_Jiesuo";
        }
Ejemplo n.º 18
0
        public void Refresh()
        {
            _showCompareInfo          = !_isEditing && _equipmentPresetController.EquippedPresetItem != null && _equipmentPresetController.EquippedPresetItem != _equipmentPresetController.CurrentEquipmentPresetItem;
            CurrentEquipmentTotalAttr = new HeroEquipmentTotleAttr();

            if (_showCompareInfo)
            {
                ShowEquippedInfo(_equipmentPresetController.EquippedPresetItem.KVP.Value.eids);
            }

            //为了显示套装特效,这里需提前把数据归拢
            for (int i = 0; i < Eids.Length; i++)
            {
                int eid = Eids[i];

                if (eid != 0)
                {
                    DetailedEquipmentInfo info = LTPartnerEquipDataManager.Instance.GetEquipmentInfoByEID(eid);

                    if (info != null)
                    {
                        CurrentEquipmentTotalAttr.AddSuitInfo(info);
                    }
                }
            }

            for (int i = 0; i < Eids.Length; i++)
            {
                int eid = Eids[i];

                if (eid == 0)
                {
                    _equipInfoCells[i].Fill(null);
                }
                else
                {
                    DetailedEquipmentInfo info = LTPartnerEquipDataManager.Instance.GetEquipmentInfoByEID(eid);

                    if (info == null)
                    {
                        EB.Debug.LogError("LTPartnerEquipmentInfoController.Show info is null, Eid = {0}", eid);
                        continue;
                    }

                    _equipInfoCells[i].Fill(info);
                }
            }

            TypeSelect();

            if (mDMono.gameObject.activeSelf)
            {
                StartCoroutine(ChangeCurrentAttrColor(isChangeColor));
            }

            for (int i = 0; i < CurrentEquipmentTotalAttr.SuitList.Count; i++)
            {
                Data.SuitTypeInfo info = Data.EconemyTemplateManager.Instance.GetSuitTypeInfoByEcidSuitType(CurrentEquipmentTotalAttr.SuitList[i].SuitType);

                if (CurrentEquipmentTotalAttr.SuitList[i].SuitType == isSuitTypeShow)
                {
                    if (CurrentEquipmentTotalAttr.SuitList[i].count == 4 && isSuitTextShow && info.SuitAttr4 != 0 || CurrentEquipmentTotalAttr.SuitList[i].count == 2 && isSuitTextShow && info.SuitAttr2 != 0)
                    {
                        for (int j = 0; j < _rightSuitFxTweeners.Length; ++j)
                        {
                            _rightSuitFxTweeners[j].tweenFactor = 0;
                            _rightSuitFxTweeners[j].PlayForward();
                        }

                        StartCoroutine(PlayShowSuitItem());
                    }
                }
            }

            ShowCurrentSuitView(CurrentEquipmentTotalAttr.SuitList);
            isSuitTextShow = false;
            isChangeColor  = false;
            ShowCompareInfo(_showCompareInfo);
        }
Ejemplo n.º 19
0
        public void Show(LTPartnerData Data)
        {
            if (Data == null)
            {
                return;
            }
            m_Data = Data;
            HeroQualityIcon.spriteName = LTPartnerConfig.PARTNER_GRADE_SPRITE_NAME_DIC[(PartnerGrade)Data.HeroInfo.role_grade];
            HeroNameLabel.text         = Data.HeroInfo.name;
            PartnerInfoItem.Clean();
            PartnerInfoItem.Fill(Data);

            for (int i = 0; i < 6; i++)
            {
                int Eid = Data.GetEquipmentsInfo(i).Eid;
                if (Eid == 0)
                {
                    EquipmentCell[i].Fill(null);
                }
                else
                {
                    DetailedEquipmentInfo info = LTPartnerEquipDataManager.Instance.GetEquipmentInfoByEID(Eid);
                    if (info == null)
                    {
                        EB.Debug.LogError("LTPartnerEquipPartnerInfoController.Show info is null,Eid = {0}", Eid);
                        continue;
                    }
                    EquipmentCell[i].Fill(info);
                }
            }
            TypeSelect();

            LTAttributesData       attrData = AttributesUtil.GetBaseAttributes(Data);
            HeroEquipmentTotleAttr E_Attr   = Data.EquipmentTotleAttr;

            if (mDMono.gameObject.activeSelf)
            {
                StartCoroutine(ColorAttrShow(isChangeColor));
            }

            for (int k = 0; k < E_Attr.SuitList.Count; k++)
            {
                Hotfix_LT.Data.SuitTypeInfo info = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetSuitTypeInfoByEcidSuitType(E_Attr.SuitList[k].SuitType);
                if (E_Attr.SuitList[k].SuitType == isSuitTypeShow)
                {
                    if (E_Attr.SuitList[k].count == 4 && isSuitTextShow && info.SuitAttr4 != 0 || E_Attr.SuitList[k].count == 2 && isSuitTextShow && info.SuitAttr2 != 0)
                    {
                        UITweener[] tweeners = SuitFxObj.GetComponents <UITweener>();
                        for (int j = 0; j < tweeners.Length; ++j)
                        {
                            tweeners[j].tweenFactor = 0;
                            tweeners[j].PlayForward();
                        }
                        StartCoroutine(PlayShowSuitItem());
                    }
                }
            }
            SuitViewShow(E_Attr.SuitList);
            isSuitTextShow = false;
            isChangeColor  = false;
        }
Ejemplo n.º 20
0
        private DetailedEquipmentInfo PreseDetailedEquipmentInfor(object data, int EID = 0)
        {
            int eid = EID;

            if (eid == 0)
            {
                eid = EB.Dot.Integer("inventory_id", data, 0);
            }
            DetailedEquipmentInfo info = new DetailedEquipmentInfo(eid);

            info.ECid       = EB.Dot.String("economy_id", data, info.ECid);
            info.EquipLevel = EB.Dot.Integer("currentLevel", data, info.EquipLevel);
            info.IconName   = EB.Dot.String("iconId", data, null);
            string location = EB.Dot.String("location", data, null);

            switch (location)
            {
            case "equipment": { info.isDress = true; }; break;

            default: { info.isDress = false; }; break;
            }
            info.isLock       = EB.Dot.Bool("lock", data, info.isLock);
            info.QualityLevel = EB.Dot.Integer("qualityLevel", data, info.QualityLevel);
            info.CellPos      = EB.Dot.String("cell", data, null);
            string EquipTypeStr = EB.Dot.String("equipment_type", data, null);

            switch (EquipTypeStr)
            {
            case "1": info.Type = EquipPartType.part1; break;

            case "2": info.Type = EquipPartType.part2; break;

            case "3": info.Type = EquipPartType.part3; break;

            case "4": info.Type = EquipPartType.part4; break;

            case "5": info.Type = EquipPartType.part5; break;

            case "6": info.Type = EquipPartType.part6; break;

            default: info.Type = EquipPartType.none; break;
            }

            //新增
            //info.Name = EB.Dot.String("name", data, info.Name);名字改由读表获得

            string attrName = EB.Dot.String("attrs.main.name", data, null);
            int    attrId   = EB.Dot.Integer("attrs.main.attrId", data, 0);

            float value;

            Hotfix_LT.Data.EquipmentAttribute m_data = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetEquipAttrInfo(attrId);
            if (info.EquipLevel >= 15)
            {
                value = m_data.finalValue;
            }
            else
            {
                value  = EB.Dot.Single("attrs.main.value", data, 0);
                value += m_data.addValue * info.EquipLevel;
            }
            info.MainAttributes = new EquipmentAttr(attrName, value);

            ArrayList attrList = Hotfix_LT.EBCore.Dot.Array("attrs.ex", data, null);

            info.ExAttributes = new List <EquipmentAttr>();
            if (attrList != null)
            {
                for (var i = 0; i < attrList.Count; i++)
                {
                    object obj = attrList[i];

                    if (obj != null)
                    {
                        Hashtable Data = obj as Hashtable;
                        if (Data != null)
                        {
                            string attrName_ex = EB.Dot.String("name", Data, null);
                            float  value_ex    = EB.Dot.Single("value", Data, 0);
                            int    attrId_ex   = EB.Dot.Integer("attrId", Data, 0);
                            int    level_ex    = EB.Dot.Integer("level", Data, 0);
                            Hotfix_LT.Data.EquipmentAttribute ex_data = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetEquipAttrInfo(attrId_ex);
                            value_ex += ex_data.addValue * level_ex;
                            EquipmentAttr data_ex = new EquipmentAttr(attrName_ex, value_ex);
                            info.ExAttributes.Add(data_ex);
                        }
                    }
                }
            }
            info.Exp = EB.Dot.Integer("currentExp", data, 0);
            return(info);
        }
Ejemplo n.º 21
0
        public DetailedEquipmentInfo GetEquipmentInfoByEID(Hashtable data)
        {
            DetailedEquipmentInfo info = PreseDetailedEquipmentInfor(data);

            return(info);
        }
Ejemplo n.º 22
0
 public override void OnCancelButtonClick()
 {
     EquipmentInfo = null;
     base.OnCancelButtonClick();
 }
Ejemplo n.º 23
0
        public void Show()
        {
            Pdata = LTPartnerEquipMainController.CurrentPartnerData;
            int eid = Pdata.GetEquipmentsInfo((int)LTPartnerEquipDataManager.Instance.CurType - 1).Eid;

            if (LTPartnerEquipMainController.instance.CurrentEquipmentViewState == LTPartnerEquipMainController.EquipmentViewState.PresetEditView)
            {
                eid = LTPartnerEquipmentInfoController.instance.Eids[(int)LTPartnerEquipDataManager.Instance.CurType - 1];
            }

            data = LTPartnerEquipDataManager.Instance.GetEquipmentInfoByEID(eid);

            if (data == null)
            {
                EB.Debug.LogError("LTEquipmentSecondInfo.Show data is null");
                return;
            }

            DataItem.Fill(data);
            NameLabel.applyGradient  = true;
            NameLabel.gradientTop    = LT.Hotfix.Utility.ColorUtility.QualityToGradientTopColor(data.QualityLevel);
            NameLabel.gradientBottom = LT.Hotfix.Utility.ColorUtility.QualityToGradientBottomColor(data.QualityLevel);
            NameLabel.text           = NameLabel.transform.GetChild(0).GetComponent <UILabel>().text = data.Name;
            string MainStr = AttrTypeTrans(data.MainAttributes.Name);

            MainAttr.GetChild(0).GetComponent <UILabel>().text = "[fff348]" + MainStr;
            MainAttr.GetChild(1).GetComponent <UILabel>().text = AttrTypeValue(data.MainAttributes);
            int ExIndex = data.ExAttributes.Count - 1;

            for (int i = 0; i < 4; i++)
            {
                if (i > ExIndex)
                {
                    ExAttr[i].gameObject.CustomSetActive(false);
                }
                else
                {
                    string ExNameStr = AttrTypeTrans(data.ExAttributes[i].Name);
                    ExAttr[i].GetChild(0).GetComponent <UILabel>().text = ExNameStr;
                    ExAttr[i].GetChild(1).GetComponent <UILabel>().text = AttrTypeValue(data.ExAttributes[i]);// string.Format("+{0}", (data.ExAttributes[i].Value > 1) ? data.ExAttributes[i].Value.ToString("f0") : ((data.ExAttributes[i].Value * 100.0f).ToString("f0") + "%"));
                    ExAttr[i].gameObject.CustomSetActive(true);
                }
            }
            LockIcon.spriteName = data.isLock ? "Equipment_Icon_Suoding" : "Equipment_Icon_Jiesuo";

            List <SuitAttrsSuitTypeAndCount> SuitList = Pdata.EquipmentTotleAttr.SuitList;
            int Count = 0;

            for (int i = 0; i < SuitList.Count; i++)
            {
                if (data.SuitType == SuitList[i].SuitType)
                {
                    Count = SuitList[i].count;
                }
            }

            int suitNeed = 6;

            if (data.FirstSuitAttr != null)
            {
                suitNeed           = 2;
                Effect_4Label.text = string.Format(EB.Localizer.GetString("ID_codefont_in_LTEquipmentFirstInfo_1924"), LTPartnerEquipConfig.HasEffectStrDic[Count >= suitNeed], data.FirstSuitAttr);
            }
            else if (data.SecondSuitAttr != null)
            {
                suitNeed           = 4;
                Effect_4Label.text = string.Format(EB.Localizer.GetString("ID_codefont_in_LTEquipmentFirstInfo_2136"), LTPartnerEquipConfig.HasEffectStrDic[Count >= suitNeed], data.SecondSuitAttr);
            }

            if (Count >= suitNeed)
            {
                Effect_4Label.effectStyle = UILabel.Effect.Outline8;
                Effect_4Label.transform.GetChild(1).GetComponent <UISprite>().color = new Color(0.74f, 1f, 0.85f);
            }
            else
            {
                Effect_4Label.effectStyle = UILabel.Effect.None;
                Effect_4Label.transform.GetChild(1).GetComponent <UISprite>().color = new Color(0.75f, 0.75f, 0.75f);
            }

            Effect_2Label.gameObject.CustomSetActive(false);
            mDMono.transform.GetComponent <UIWidget>().height = 445 + 88 * data.ExAttributes.Count + ((Effect_2Label.gameObject.activeSelf) ? Effect_2Label.height : 0) + ((Effect_4Label.gameObject.activeSelf) ? Effect_4Label.height : 0);
        }
Ejemplo n.º 24
0
        public void SetData(bool isEquipped, KeyValuePair <string, EquipmentPresetModel> kvp)
        {
            KVP = kvp;
            SetName(kvp.Key);
            SetEquipped(isEquipped);
            SetHighlight(isEquipped);

            var attr = new HeroEquipmentTotleAttr();

            for (int i = 0; i < kvp.Value.eids.Length; i++)
            {
                int eid = kvp.Value.eids[i];

                if (eid != 0)
                {
                    DetailedEquipmentInfo info = LTPartnerEquipDataManager.Instance.GetEquipmentInfoByEID(eid);

                    if (info == null)
                    {
                        continue;
                    }

                    attr.AddSuitInfo(info);
                }
            }

            SuitAttrsSuitTypeAndCount data = null;
            int twoPieceSuitCount          = 0;

            for (int i = 0; i < attr.SuitList.Count; i++)
            {
                if (data == null)
                {
                    data = attr.SuitList[i];
                }
                else if (attr.SuitList[i].count > data.count)
                {
                    data = attr.SuitList[i];
                }

                if (data.count >= 2)
                {
                    twoPieceSuitCount += 1;
                }
            }

            var suitTypeInfo = data != null?Data.EconemyTemplateManager.Instance.GetSuitTypeInfoByEcidSuitType(data.SuitType) : null;

            if (data != null && data.count >= 4 && suitTypeInfo != null && suitTypeInfo.SuitAttr4 != 0)
            {
                SetIcon(suitTypeInfo.SuitIcon);
            }
            else if (twoPieceSuitCount == 1 && data != null && data.count >= 2 && suitTypeInfo != null && suitTypeInfo.SuitAttr2 != 0)
            {
                SetIcon(suitTypeInfo.SuitIcon);
            }
            else
            {
                SetIcon("Equipment_Icon_Taozhuang");
            }
        }