Ejemplo n.º 1
0
 public void OnClickUpgrade()
 {
     string[] args = templateNow.ItemCost.Split(',');
     if (args.Length >= 2)
     {
         int curCount = GameItemUtil.GetInventoryItemNum(args[0]);
         int.TryParse(args[1], out var needCount);
         if (curCount >= needCount)
         {
             LTPartnerDataManager.Instance.UpgradeArtifact(data.HeroId, data.ArtifactLevel + 1, (b) =>
             {
                 if (b)
                 {
                     DetailBehaviour.OnDisable();
                     DetailBehaviour.PlayAnim();
                     SetMenuData(null);
                     // Messenger.Raise(EventName.ArtifactRefresh);
                     ArtifactEquipmentTemplate artifactEquipmentTemplate = CharacterTemplateManager.Instance.GetArtifactEquipmentByLevel(infoId, data.ArtifactLevel, true);
                     if (!string.IsNullOrEmpty(artifactEquipmentTemplate.desc))
                     {
                         GlobalMenuManager.Instance.Open("LTArtifactLevelUpUIHud", infoId);
                     }
                 }
             });
         }
         else
         {
             MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_ERROR_INSUFFICIENT_ITEMS"));
         }
     }
 }
Ejemplo n.º 2
0
        public void SetAttr(ArtifactEquipmentTemplate temp)
        {
            SetSkill(temp.skillId);

            string attr = temp.AttributeAdd;

            string[] split = attr.Split(';');
            if (split.Length > 0)
            {
                AttrOneName.text  = split[0].Split(',')[0];
                ValueOneName.text = split[0].Split(',')[1];
            }

            if (split.Length > 1)
            {
                AttrTwoName.text  = split[1].Split(',')[0];
                ValueTwoName.text = split[1].Split(',')[1];
            }

            if (split.Length > 2)
            {
                AttrThreeName.text  = split[2].Split(',')[0];
                ValueThreeName.text = split[2].Split(',')[1];
            }
        }
Ejemplo n.º 3
0
        public override void SetMenuData(object param)
        {
            base.SetMenuData(param);

            infoId          = (int?)param ?? infoId;
            data            = LTPartnerDataManager.Instance.GetPartnerByInfoId(infoId);
            templateNow     = CharacterTemplateManager.Instance.GetArtifactEquipmentByLevel(infoId, data.ArtifactLevel, true);
            templateNext    = CharacterTemplateManager.Instance.GetArtifactEquipmentByLevel(infoId, data.ArtifactLevel + 1);
            Icon.spriteName = templateNow.iconId;
            Shadow.gameObject.CustomSetActive(data.ArtifactLevel < 0);
            Shadow.GetComponent <DynamicUISprite>().spriteName = templateNow.iconId;
            ArtifactName.text = templateNow.name;
            SetShowItem(templateNext);
            DetailBehaviour.Init(infoId);
            if (data.ArtifactLevel == CharacterTemplateManager.Instance.GetArtifactEquipmentMaxLevel(infoId))
            {
                button.gameObject.CustomSetActive(false);
                MaxTip.gameObject.CustomSetActive(true);
            }
            else
            {
                button.gameObject.CustomSetActive(true);
                MaxTip.gameObject.CustomSetActive(false);
            }
        }
Ejemplo n.º 4
0
        public void Init(int infoId)
        {
            data         = LTPartnerDataManager.Instance.GetPartnerByInfoId(infoId);
            templateNow  = CharacterTemplateManager.Instance.GetArtifactEquipmentByLevel(infoId, data.ArtifactLevel, true);
            templateNext = CharacterTemplateManager.Instance.GetArtifactEquipmentByLevel(infoId, data.ArtifactLevel + 1);
            templateList = CharacterTemplateManager.Instance.GetArtifactEquipmentHaveDesc(infoId);
            SetSkillUpLevel(templateList);
            SetAttr(templateNow, templateNext);

            string levelText = data.ArtifactLevel > 0 ? $"+{data.ArtifactLevel}" : string.Empty;

            ArtifactLevel.gameObject.SetActive(data.ArtifactLevel > 0);
            ArtifactLevel.text = levelText;
            LTUIUtil.SetText(ArtifactName, $"{templateNow.name}{levelText}");
        }
Ejemplo n.º 5
0
 public void SetShowItem(ArtifactEquipmentTemplate temp)
 {
     string[] args = temp.ItemCost.Split(',');
     if (args.Length >= 2)
     {
         int curCount = GameItemUtil.GetInventoryItemNum(args[0]);
         int.TryParse(args[1], out var needCount);
         ShowItem.LTItemData = new LTShowItemData(args[0], needCount, LTShowItemType.TYPE_GAMINVENTORY);
         string color = curCount < needCount
             ? LT.Hotfix.Utility.ColorUtility.RedColorHexadecimal
             : LT.Hotfix.Utility.ColorUtility.GreenColorHexadecimal;
         ShowItemCount.text = string.Format(LT.Hotfix.Utility.ColorUtility.ColorStringFormat + "/{2}", color,
                                            curCount, needCount);
     }
 }
Ejemplo n.º 6
0
        public override void SetMenuData(object param)
        {
            base.SetMenuData(param);
            //TODO 传入伙伴Id数据
            infoId = (int)param;
            DetailBehaviour.Init(infoId);
            LTPartnerData             data = LTPartnerDataManager.Instance.GetPartnerByInfoId(infoId);
            ArtifactEquipmentTemplate artifactEquipmentTemplate = CharacterTemplateManager.Instance.GetArtifactEquipmentByLevel(infoId, data.ArtifactLevel, true);
            UILabel  levelLabel = Template.GetComponent <UILabel>();
            UILabel  descLabel  = Template.GetComponent <UILabel>("Desc");
            UISprite sprite     = Template.GetComponent <UISprite>("Sprite");

            levelLabel.text = $"[44fe7c]+{artifactEquipmentTemplate.enhancementLevel}";
            descLabel.text  = $"[44fe7c]{artifactEquipmentTemplate.desc}";
            sprite.color    = Color.yellow;
        }
Ejemplo n.º 7
0
        public void SetArtifact(int infoId)
        {
            this.infoId = infoId;
            data        = LTPartnerDataManager.Instance.GetPartnerByInfoId(infoId);
            template    = CharacterTemplateManager.Instance.GetArtifactEquipmentByLevel(infoId, data.ArtifactLevel);

            LockObj.gameObject.SetActive(template == null);
            redPoint.SetActive(LTPartnerDataManager.Instance.IsCanArtifact(data));
            LevelLabel.gameObject.SetActive(false);

            if (template != null)
            {
                icon.spriteName = template.iconId;
                shadow.GetComponent <DynamicUISprite>().spriteName = template.iconId;
                if (data.ArtifactLevel > 0)
                {
                    LevelLabel.gameObject.SetActive(true);
                    LevelLabel.text = "+" + data.ArtifactLevel;
                }
            }
            icon.gameObject.SetActive(template != null);
            shadow.CustomSetActive(template != null && data.ArtifactLevel < 0);
        }
Ejemplo n.º 8
0
        public void SetShowItem(ArtifactEquipmentTemplate temp)
        {
            if (temp == null)
            {
                ShowItem.mDMono.gameObject.CustomSetActive(false);
                redPoint.gameObject.SetActive(false);
                return;
            }
            ShowItem.mDMono.gameObject.CustomSetActive(true);

            string[] args = temp.ItemCost.Split(',');
            if (args.Length >= 2)
            {
                int curCount = GameItemUtil.GetInventoryItemNum(args[0]);
                int.TryParse(args[1], out var needCount);
                ShowItem.LTItemData = new LTShowItemData(args[0], needCount, LTShowItemType.TYPE_GAMINVENTORY);
                string color = curCount < needCount
                    ? LT.Hotfix.Utility.ColorUtility.RedColorHexadecimal
                    : LT.Hotfix.Utility.ColorUtility.GreenColorHexadecimal;
                ShowItemCount.text = string.Format(LT.Hotfix.Utility.ColorUtility.ColorStringFormat + "/{2}", color,
                                                   curCount, needCount);
                redPoint.gameObject.SetActive(curCount >= needCount);
            }
        }
Ejemplo n.º 9
0
        public void SetAttr(ArtifactEquipmentTemplate temp, ArtifactEquipmentTemplate next)
        {
            SetSkill(temp.skillId);
            fxLists = new List <Transform>();
            double ValueOne   = 0;
            double ValueTwo   = 0;
            double ValueThree = 0;
            double ValueFour  = 0;
            string attr       = temp.AttributeAdd;

            string[] split = attr.Split(';');
            if (split.Length > 0)
            {
                string name = split[0].Split(',')[0];
                LTUIUtil.SetText(AttrOneName, AttrTypeTrans(name));
                SpriteOneName.spriteName = AttrTypeSprite(name);
                ValueOne          = Convert.ToDouble(split[0].Split(',')[1]);
                ValueOneName.text = StringFormat(ValueOne);

                fxLists.Add(SpriteOneName.transform.FindEx("Fx", false));
            }

            if (split.Length > 1)
            {
                string name = split[1].Split(',')[0];
                LTUIUtil.SetText(AttrTwoName, AttrTypeTrans(name));
                SpriteTwoName.spriteName = AttrTypeSprite(name);
                ValueTwo          = Convert.ToDouble(split[1].Split(',')[1]);
                ValueTwoName.text = StringFormat(ValueTwo);

                fxLists.Add(SpriteTwoName.transform.FindEx("Fx", false));
            }

            if (split.Length > 2)
            {
                string name = split[2].Split(',')[0];
                LTUIUtil.SetText(AttrThreeName, AttrTypeTrans(name));
                SpriteThreeName.spriteName = AttrTypeSprite(name);
                ValueThree          = Convert.ToDouble(split[2].Split(',')[1]);
                ValueThreeName.text = StringFormat(ValueThree);

                fxLists.Add(SpriteThreeName.transform.FindEx("Fx", false));
            }
            SpriteFourName.transform.parent.gameObject.CustomSetActive(split.Length > 3);
            if (split.Length > 3)
            {
                string name = split[3].Split(',')[0];
                LTUIUtil.SetText(AttrFourName, AttrTypeTrans(name));
                SpriteFourName.spriteName = AttrTypeSprite(name);
                ValueFour          = Convert.ToDouble(split[3].Split(',')[1]);
                ValueFourName.text = StringFormat(ValueFour);

                fxLists.Add(SpriteFourName.transform.FindEx("Fx", false));
            }

            if (next != null && CanStrength)
            {
                string[] splitNext = next.AttributeAdd.Split(';');
                if (splitNext.Length > 0)
                {
                    AddOneName.text = ADDStringFormat(Convert.ToDouble(splitNext[0].Split(',')[1]) - ValueOne);
                }

                if (splitNext.Length > 1)
                {
                    AddTwoName.text = ADDStringFormat(Convert.ToDouble(splitNext[1].Split(',')[1]) - ValueTwo);
                }

                if (splitNext.Length > 2)
                {
                    AddThreeName.text = ADDStringFormat(Convert.ToDouble(splitNext[2].Split(',')[1]) - ValueThree);
                }

                if (splitNext.Length > 3)
                {
                    AddFourName.text = ADDStringFormat(Convert.ToDouble(splitNext[3].Split(',')[1]) - ValueFour);
                }
            }

            icon.spriteName = temp.iconId;
            shadow.GetComponent <DynamicUISprite>().spriteName = temp.iconId;
            shadow.gameObject.CustomSetActive(data.ArtifactLevel < 0);
        }