Esempio n. 1
0
 public override void Fill(EquipmentSortType type)
 {
     _type = type;
     mDMono.gameObject.SetActive(true);
     _chooseObj.SetActive(_type == LTPartnerEquipDataManager.Instance.CurSortType);
     _labName.text = EquipmentUtility.AttrTypeTrans(_type.ToString(), false);
 }
Esempio n. 2
0
        public void To(Data.PromotionTemplate info, Data.PromotionAttributeLevelTemplate attrInfo)
        {
            Reset();

            string attrName     = attrInfo.name;
            int    attrId       = attrInfo.id;
            bool   isPercentNum = attrInfo.attrValue.ToString().Contains(".");
            int    nextId       = Data.CharacterTemplateManager.Instance.GetNextPromotionId(info.id);
            string formatStr;

            if (PageId == 1)
            {
                formatStr = isPercentNum ? "{0}/{1}%" : "{0}/{1}";
            }
            else
            {
                formatStr = isPercentNum ? "{0}/{1}%({2})" : "{0}/{1}({2})";
            }
            Data.PromotionTemplate nextInfo = Data.CharacterTemplateManager.Instance.GetPromotionInfo(nextId);
            int    currentAttrLevel         = LTPromotionManager.Instance.GetCurrentAttrLevel(attrId);
            float  attrValue   = isPercentNum ? attrInfo.attrValue * 100 : attrInfo.attrValue;
            string deltaFormat = nextInfo == null ? "Max" : isPercentNum ? "+{0}%" : "+{0}";
            string deltaStr    = string.Format(deltaFormat, nextInfo == null ? "" : ((nextInfo.attributeLevelUpperLimit - info.attributeLevelUpperLimit) * attrValue).ToString());

            _labName.text = EquipmentUtility.AttrTypeTrans(attrName, false);
            int trainingAfterAttrLevel;

            if (!LTPromotionManager.Instance.GetTrainingAfterAttrLevel(attrId, out trainingAfterAttrLevel))
            {
                trainingAfterAttrLevel = currentAttrLevel;
            }
            PlayProgressfx(trainingAfterAttrLevel * attrValue - currentAttrLevel * attrValue > 0, false);
            DOTween.To(val =>
            {
                float targetValue   = info.attributeLevelUpperLimit * attrValue;
                string sign         = isPercentNum ? "%" : string.Empty;
                string currentValue = LT.Hotfix.Utility.ColorUtility.FormatColorByGreen(val, targetValue, sign, isPercentNum ? 1 : 0);
                _labProgress.text   = EB.StringUtil.Format(formatStr, currentValue, targetValue.ToString(isPercentNum ? "0.0" : "0"), deltaStr);
            }, currentAttrLevel * attrValue, trainingAfterAttrLevel * attrValue, dynamicEffectDuration);
            DOTween.To(val =>
            {
                _uiProgressBar.value = val;
                SetProgressBarForeground(val > 0.99f);
            }, currentAttrLevel / (float)info.attributeLevelUpperLimit, trainingAfterAttrLevel / (float)info.attributeLevelUpperLimit, dynamicEffectDuration).OnComplete(() =>
            {
                ShowIncrement(currentAttrLevel * attrValue, trainingAfterAttrLevel * attrValue, isPercentNum);
            });
        }
Esempio n. 3
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);
                }
            }
        }
Esempio n. 4
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";
        }