public void Fill(Hotfix_LT.Data.SkillTemplate awaken, Hotfix_LT.Data.SkillTemplate pre, LTPartnerData data) { mDMono.transform.GetComponent <UIPanel>().sortingOrder = mDMono.transform.parent.parent.GetComponent <UIPanel>().sortingOrder + 1; mDMono.transform.GetComponent <UIPanel>().depth = mDMono.transform.parent.parent.GetComponent <UIPanel>().depth + 150; awakenSkill = awaken; preSkill = pre; if (data.HeroStat.active_skill == preSkill.ID) { skilllevel = data.ActiveSkillLevel; } else if (data.HeroStat.passive_skill == preSkill.ID) { skilllevel = data.PassiveSkillLevel; } else if (data.HeroStat.common_skill == preSkill.ID) { skilllevel = data.CommonSkillLevel; } SetSkillType(awaken.Type); SkillIcon.spriteName = awaken.Icon; SkillLevel.text = skilllevel.ToString(); SkillName.text = awaken.Name; SetSkillTargetLabel(awaken.SelectTargetType); preSkilllabel.text = preSkilllabel.transform.GetChild(0).GetComponent <UILabel>().text = EB.Localizer.GetString("ID_PARTER_AWAKEN_BEFORE"); awakenSkilllabel.text = awakenSkilllabel.transform.GetChild(0).GetComponent <UILabel>().text = EB.Localizer.GetString("ID_PARTER_AWAKEN_LATER"); string cooldownStr = (pre.MaxCooldown > 0) ? (pre.MaxCooldown + EB.Localizer.GetString("ID_uifont_in_CombatHudV4_TurnFont_4")) : EB.Localizer.GetString("ID_SKILL_COOLDOWN_NOT"); SkillCooldownLabel.text = string.Format("{0}{1}", EB.Localizer.GetString("ID_SKILL_COOLDOWN"), cooldownStr); PreSkillDes.text = SkillDescTransverter.ChangeDescription(pre.Description, skilllevel, pre.ID); AwakenSkillDes.text = SkillDescTransverter.ChangeDescription(awaken.Description, skilllevel, awaken.ID); mDMono.gameObject.transform.localPosition = new Vector3(-1112, (BgSprite.height - 726) / 2, 0); }
private void GetSkillData() { string input; if (!DataLookupsCache.Instance.SearchDataByID <string>("tooltip.target", out input)) { m_SkillData = null; return; } string[] result = input.Split(','); int id = 0; if (result.Length > 1) { if (!int.TryParse(result[1], out skillLevel)) { skillLevel = 1; } } if (!int.TryParse(result[0], out id)) { m_SkillData = null; return; } m_SkillData = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(id); }
public void SetNextSkill(int skill_id) { NextSkillID = skill_id; if (skill_id == -1) { NextSkillIcon.spriteName = ""; NextSkillIcon.gameObject.CustomSetActive(false); return; } Hotfix_LT.Data.SkillTemplate tpl = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(skill_id); if (tpl != null) { NextSkillIcon.spriteName = tpl.Icon; if (NextSkillTipsHud.activeSelf) { int skillLevel = characterData.SkillDataList[NextSkillID].Level; NextSkillItem.Fill(NextSkillID, skillLevel); } NextSkillIcon.gameObject.CustomSetActive(true); } else { EB.Debug.LogError("SetNextBossSkill skill_id error for skill_id={0}", skill_id); NextSkillIcon.spriteName = ""; NextSkillIcon.gameObject.CustomSetActive(false); } }
public override void Init(LTInstanceNode nodeData) { base.Init(nodeData); skillId = nodeData.RoleData.CampaignData.SkillId; Hotfix_LT.Data.SkillTemplate skillTpl = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(skillId); if (skillTpl != null) { skillSprite.spriteName = skillTpl.Icon; } }
public void Init(LTShowItemData data) { HideUI(); curData = data; item.LTItemData = data; EquipContent.CustomSetActive(false); NormalContent.CustomSetActive(true); if (data.type == LTShowItemType.TYPE_SCROLL) { Hotfix_LT.Data.SkillTemplate skillTpl = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(int.Parse(data.id)); DescLab.text = skillTpl.Description; int magicPoint = BalanceResourceUtil.GetResValue("mana"); MagicPointLab.text = skillTpl.SPCost.ToString(); MagicObj.CustomSetActive(true); DescLab.gameObject.CustomSetActive(true); } else { string id = data.id; if (data.type == LTShowItemType.TYPE_RES) { id = BalanceResourceUtil.GetResID(data.id).ToString(); } Hotfix_LT.Data.EconemyItemTemplate itemTpl = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetItem(id); MagicObj.CustomSetActive(false); if (itemTpl != null) { DescLab.gameObject.CustomSetActive(true); if (itemTpl is Hotfix_LT.Data.EquipmentItemTemplate) { NormalContent.CustomSetActive(false); EquipContent.CustomSetActive(true); InitEquipContent(itemTpl as Hotfix_LT.Data.EquipmentItemTemplate); } else { DescLab.text = itemTpl.Desc; } } else { DescLab.gameObject.CustomSetActive(false); } } ShowUI(); }
/// <summary> /// 设置显示信息 /// </summary> private void SetInfo() { //属性相关 PartnerName.text = curpartnerData.HeroInfo.name; PartnerGradeSprite.spriteName = "Ty_Strive_Icon_" + ((PartnerGrade)curpartnerData.HeroInfo.role_grade).ToString(); SetPartnerStar(0); string colorStr = "[42fe79]"; LifeNameLabel.text = LifeNameLabel.transform.GetChild(0).GetComponent <UILabel>().text = EB.Localizer.GetString("ID_ATTR_HP"); LifeNumLabel.text = LifeNumLabel.transform.GetChild(0).GetComponent <UILabel>().text = ((int)BeforeAttriData.m_MaxHP).ToString() + colorStr + " + " + ((int)RaiseAttriData.m_MaxHP).ToString(); AttackNameLabel.text = AttackNameLabel.transform.GetChild(0).GetComponent <UILabel>().text = EB.Localizer.GetString("ID_ATTR_ATK"); AttackNumLabel.text = AttackNumLabel.transform.GetChild(0).GetComponent <UILabel>().text = ((int)BeforeAttriData.m_ATK).ToString() + colorStr + " + " + ((int)RaiseAttriData.m_ATK).ToString("0"); SpeedNameLabel.text = SpeedNameLabel.transform.GetChild(0).GetComponent <UILabel>().text = EB.Localizer.GetString("ID_ATTR_Speed"); SpeedNumLabel.text = SpeedNumLabel.transform.GetChild(0).GetComponent <UILabel>().text = ((int)BeforeAttriData.m_Speed).ToString() + colorStr + " + " + ((int)RaiseAttriData.m_Speed).ToString("0"); DefNameLabel.text = DefNameLabel.transform.GetChild(0).GetComponent <UILabel>().text = EB.Localizer.GetString("ID_ATTR_DEF"); DefNumLabel.text = DefNumLabel.transform.GetChild(0).GetComponent <UILabel>().text = ((int)BeforeAttriData.m_DEF).ToString() + colorStr + " + " + ((int)RaiseAttriData.m_DEF).ToString("0"); //技能相关 if (curTemplate.awakeType == 1) { if (curTemplate.beforeSkill == curpartnerData.HeroStat.active_skill) { skillLevel = curpartnerData.ActiveSkillLevel; } else if (curTemplate.beforeSkill == curpartnerData.HeroStat.common_skill) { skillLevel = curpartnerData.CommonSkillLevel; } else if (curTemplate.beforeSkill == curpartnerData.HeroStat.passive_skill) { skillLevel = curpartnerData.PassiveSkillLevel; } normalskillLevel.text = normalskillLevel.transform.GetChild(0).GetComponent <UILabel>().text = skillLevel.ToString(); awakenSkillLevel.text = awakenSkillLevel.transform.GetChild(0).GetComponent <UILabel>().text = skillLevel.ToString(); SkillAddLabel.text = SkillAddLabel.transform.GetChild(0).GetComponent <UILabel>().text = string.Format(EB.Localizer.GetString("ID_PARTNER_AWAKEN_SKILLADD"), "[ffffff]", ""); Hotfix_LT.Data.SkillTemplate normalskill = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(curTemplate.beforeSkill); Hotfix_LT.Data.SkillTemplate awakeskill = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(curTemplate.laterSkill); NormalSkillIcon.spriteName = normalskill.Icon; NormalSkillName.text = normalskill.Name; //NormalSkillBtn.OnClickAction = new System.Action(SetNormalSkillClick); AwakeSkillIcon.spriteName = awakeskill.Icon; AwakeSkillName.text = awakeskill.Name; } else { //AwakenSkillBtn.OnClickAction = new System.Action(SetAwakeSkillClick); //属性提升 AttriAddLabel.text = string.Format(EB.Localizer.GetString("ID_PARTNER_AWAKEN_ATTRIADD"), "[ffffff]", Hotfix_LT.Data.CharacterTemplateManager.Instance.GetAwakenExtraAttri(curTemplate)); } //皮肤获取提示 SkinGetTip.text = EB.Localizer.GetString("ID_PARTNER_GETSKIN_TIP"); }
private string GetContext(Hotfix_LT.Data.SkillTemplate skillData, int skillLevel) { if (skillData == null) { return(""); } if (!string.IsNullOrEmpty(skillData.Description)) { return(SkillDescTransverter.ChangeDescription(skillData.Description, skillLevel, skillData.ID)); } return(""); }
private void InitEquipSuitDesc(int index, int suitSkillID) { string str1 = index == 1 ?EB.Localizer.GetString("ID_TWO_SUIT") : index == 2 ? EB.Localizer.GetString("ID_FOUR_SUIT") : ""; Hotfix_LT.Data.SkillTemplate suitAttr = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(suitSkillID); if (suitAttr != null) { SuitAttrDescLab.text = string.Format("{0}: {1}", str1, suitAttr.Description); } else { SuitAttrDescLab.text = string.Empty; } }
private void SetSkillTipInfo(LTChallengeInstanceBagData data) { ScrollTipsGO.gameObject.CustomSetActive(false); if (!string.IsNullOrEmpty(data.Id)) { Hotfix_LT.Data.SkillTemplate skillTpl = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(int.Parse(data.Id)); SkillTipsItem.LTItemData = new LTShowItemData(data.Id, data.Num, data.Type); SkillNameLabel.text = skillTpl.Name; CostMagicLabel.text = skillTpl.SPCost.ToString(); DescLabel.text = skillTpl.Description; ScrollTipsGO.ResetToBeginning(); ScrollTipsGO.PlayForward(); ScrollTipsGO.gameObject.CustomSetActive(true); } }
public void Show() { CurrentHPPipe.gameObject.SetActive(true); NextHPPipe.gameObject.SetActive(true); LerpHPPipe.gameObject.SetActive(true); HeadHud.SetActive(true); ChestObj.SetActive(SceneLogic.BattleType == eBattleType.AllianceCampaignBattle); HpObj.SetActive(SceneLogic.BattleType != eBattleType.AllianceCampaignBattle); HurtLabel.gameObject.SetActive(SceneLogic.BattleType == eBattleType.AllianceCampaignBattle); // string characterId = Hotfix_LT.Data.CharacterTemplateManager.Instance.TemplateidToCharacteridEX(characterData.TplId.ToString()); Hotfix_LT.Data.HeroInfoTemplate infoTpl = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(characterId, characterData.Skin); LTUIUtil.SetText(NameLabel, infoTpl.name); Icon.spriteName = infoTpl.icon; Indicator.transform.parent.gameObject.SetActive(false); foreach (var skill in characterData.SkillDataList) { //BossSkillItem item = GameUtils.InstantiateEx<BossSkillItem>(BSItem, SkillGrid.transform, skill.Value.Index.ToString()); GameObject go = GameObject.Instantiate(BSItem.mDMono.gameObject) as GameObject; go.name = skill.Value.Index.ToString(); go.transform.SetParent(SkillGrid.transform, false); if (false == go.activeSelf) { go.gameObject.SetActive(true); } BossSkillItem item = go.GetMonoILRComponent <BossSkillItem>(); Hotfix_LT.Data.SkillTemplate tplData = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(skill.Value.ID); item.Fill(tplData, skill.Value.Level); if (tplData.Type == Hotfix_LT.Data.eSkillType.INDICATOR) { Indicator.transform.parent.gameObject.SetActive(true); Indicator.text = "0"; } } SkillGrid.Reposition(); BuffGrid.Reposition(); if (characterData.SkillDataList.Count >= 5) { SkillGrid.GetComponent <UIWidget>().enabled = true; } }
public void OnUseSkillBtnClick() { if (CurrentSelected.ShowItem.LTItemData.count <= 0) { MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_codefont_in_LTCombatScrollBag_3071")); return; } Hotfix_LT.Data.SkillTemplate skillTpl = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(int.Parse(CurrentSelected.ShowItem.LTItemData.id)); if (skillTpl.SPCost > Hotfix_LT.Combat.CombatSyncData.Instance.GetMyTeamData().SPoint) { MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_codefont_in_LTCombatScrollBag_3374")); return; } LTCombatHudController.Instance.CombatSkillCtrl.OnSelectScrollEvent(int.Parse(CurrentSelected.ShowItem.LTItemData.id)); OnClose(); }
private int GetAttackTargetActionIDUseAI(int skillid, Hotfix_LT.Combat.Combatant converage) { Hotfix_LT.Data.SkillTemplate skill_tpl = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(skillid); switch (skill_tpl.SelectTargetType) { case Hotfix_LT.Data.eSkillSelectTargetType.ENEMY_TEMPLATE: { if (converage != null) { return(converage.Data.IngameId); } else { List <Hotfix_LT.Combat.CombatCharacterSyncData> enemyList = Hotfix_LT.Combat.CombatSyncData.Instance.GetCharacterList(1 - CombatLogic.Instance.LocalPlayerTeamIndex); return(FindMinHpOne(enemyList)); } } case Hotfix_LT.Data.eSkillSelectTargetType.ENEMY_ALL: case Hotfix_LT.Data.eSkillSelectTargetType.ENEMY_RANDOM: case Hotfix_LT.Data.eSkillSelectTargetType.FRIEND_ALL: case Hotfix_LT.Data.eSkillSelectTargetType.FRIEND_RANDOM: case Hotfix_LT.Data.eSkillSelectTargetType.SELF: { return(-1); }; case Hotfix_LT.Data.eSkillSelectTargetType.FRIEND_TEMPLATE: { List <Hotfix_LT.Combat.CombatCharacterSyncData> friendList = Hotfix_LT.Combat.CombatSyncData.Instance.GetCharacterList(CombatLogic.Instance.LocalPlayerTeamIndex); return(FindMinHpOne(friendList)); }; case Hotfix_LT.Data.eSkillSelectTargetType.All_NOT_SELF: { List <Hotfix_LT.Combat.CombatCharacterSyncData> friendList = Hotfix_LT.Combat.CombatSyncData.Instance.GetCharacterList(CombatLogic.Instance.LocalPlayerTeamIndex); return(FindMinHpOne(friendList, Hotfix_LT.Combat.CombatSyncData.Instance.ActionId)); } default: EB.Debug.LogError("skillSelectTargetType error for skillid={0} gskillSelectTargetType={1},characterData={2}", skillid, skill_tpl.SelectTargetType, CharacterData.ToString()); return(-2); } }
public void Init(int skillid, int level) { Container.transform.localPosition = (SceneLogic.BattleType == eBattleType.ChallengeCampaign || SceneLogic.BattleType == eBattleType.AlienMazeBattle) ? TipInChallengePos : TipNormalPos; Container.GetComponent <UIPanel>().depth += 1; ShowUI(false); if (curSkillID != 0 && curSkillID == skillid && Container.gameObject.activeSelf) { return; } curSkillID = skillid; Hotfix_LT.Data.SkillTemplate skillTpl = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(skillid); LTUIUtil.SetText(SkillNameLabel, skillTpl.Name); SkillDescLabel.text = SkillDescTransverter.ChangeDescription(skillTpl.Description, level, skillTpl.ID); SetSkillTargetLabel(skillTpl.SelectTargetType); string cooldownStr = (skillTpl.MaxCooldown > 0) ? (skillTpl.MaxCooldown + EB.Localizer.GetString("ID_uifont_in_CombatHudV4_TurnFont_4")) : EB.Localizer.GetString("ID_SKILL_COOLDOWN_NOT"); SkillCooldownLabel.text = string.Format("{0}{1}", EB.Localizer.GetString("ID_SKILL_COOLDOWN"), cooldownStr); mBG.height = SkillDescLabel.height + bgHeight; ShowUI(true); }
public void Fill(Hotfix_LT.Data.SkillTemplate tplData, int skillLevel) { if (tplData.Type == Hotfix_LT.Data.eSkillType.ACTIVE) { LTUIUtil.SetText(TypeTips, EB.Localizer.GetString("ID_codefont_in_UISkillDescContorller_4070")); TypeTipsBG.color = LT.Hotfix.Utility.ColorUtility.RedColor; } else if (tplData.Type == Hotfix_LT.Data.eSkillType.NORMAL) { LTUIUtil.SetText(TypeTips, EB.Localizer.GetString("ID_codefont_in_UISkillDescContorller_4440")); TypeTipsBG.color = LT.Hotfix.Utility.ColorUtility.PurpleColor; } else if (tplData.Type == Hotfix_LT.Data.eSkillType.PASSIVE) { LTUIUtil.SetText(TypeTips, EB.Localizer.GetString("ID_codefont_in_UISkillDescContorller_4751")); TypeTipsBG.color = LT.Hotfix.Utility.ColorUtility.BlueColor; } Icon.spriteName = tplData.Icon; LTUIUtil.SetText(Name, tplData.Name); LTUIUtil.SetText(Desc, SkillDescTransverter.ChangeDescription(tplData.Description, skillLevel, tplData.ID)); }
private void SetSkillUI() { Hotfix_LT.Data.SkillTemplate commonSkillTem = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(heroStat.common_skill); if (commonSkillTem != null) { CommonSkillBreakNameLabel.transform.parent.gameObject.CustomSetActive(true); CommonSkillBreakSprite.spriteName = commonSkillTem.Icon; CommonSkillBreakNameLabel.text = commonSkillTem.Name; } else { CommonSkillBreakNameLabel.transform.parent.gameObject.CustomSetActive(false); } Hotfix_LT.Data.SkillTemplate passiveSkillTem = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(heroStat.passive_skill); if (passiveSkillTem != null) { PassiveSkillBreakNameLabel.transform.parent.gameObject.CustomSetActive(true); PassiveSkillBreakSprite.spriteName = passiveSkillTem.Icon; PassiveSkillBreakNameLabel.text = passiveSkillTem.Name; } else { PassiveSkillBreakNameLabel.transform.parent.gameObject.CustomSetActive(false); } Hotfix_LT.Data.SkillTemplate activeSkillTem = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(heroStat.active_skill); if (activeSkillTem != null) { ActiveSkillBreakNameLabel.transform.parent.gameObject.CustomSetActive(true); ActiveSkillBreakSprite.spriteName = activeSkillTem.Icon; ActiveSkillBreakNameLabel.text = activeSkillTem.Name; } else { ActiveSkillBreakNameLabel.transform.parent.gameObject.CustomSetActive(false); } }
public override void SetMenuData(object param) { base.SetMenuData(param); Data = param as StoreItemData; Item.LTItemData = new LTShowItemData(Data.id, Data.num, Data.type, false); HaveLabel.text = EB.Localizer.GetString("ID_codefont_in_LTStoreBuyController_544") + Data.have; m_Discount_Label.text = LTChargeManager.GetDiscountText(Data.discount); m_Discount_Label.gameObject.CustomSetActive(Data.discount > 0 && Data.discount < 1); m_Cost_Label.text = m_Cost_Label.transform.GetChild(0).GetComponent <UILabel>().text = Data.cost.ToString(); int resBalance = BalanceResourceUtil.GetResValue(Data.cost_id); if (resBalance < Data.cost) { m_Cost_Label.color = LT.Hotfix.Utility.ColorUtility.RedColor; } else { m_Cost_Label.color = LT.Hotfix.Utility.ColorUtility.WhiteColor; } m_Cost_Sprite.spriteName = BalanceResourceUtil.GetResSpriteName(Data.cost_id); string desc = string.Empty; if (Data.store_type == "challenge") { Hotfix_LT.Data.SkillTemplate skillTpl = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(int.Parse(Data.id)); desc = skillTpl.Description; } else { var item = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetItem(Data.id); desc = item.Desc; } Info.text = desc; }
public void Fill(int skillId, int skillLevel) { Hotfix_LT.Data.SkillTemplate tplData = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(skillId); Fill(tplData, skillLevel); }
public void Show(Hotfix_LT.Data.SuitTypeInfo type, Vector2 Pos) { MainIcon.spriteName = type.SuitIcon; //装备角标LTPartnerEquipConfig.SuitIconDic[type.SuitType]; UpdateDrop(type.DropDatas); NameLabel.text = NameLabel.transform.GetChild(0).GetComponent <UILabel>().text = string.Format(EB.Localizer.GetString("ID_codefont_in_LTEquipmentSuitInfoItem_3047"), type.TypeName); List <SuitAttrsSuitTypeAndCount> SuitList = LTPartnerEquipDataManager.Instance.CurrentPartnerData.EquipmentTotleAttr.SuitList; int Count = 0; for (int i = 0; i < SuitList.Count; i++) { if (type.SuitType == SuitList[i].SuitType) { Count = SuitList[i].count; } } string str = null; int suitNeed = 6; if (type.SuitAttr2 != 0) { Hotfix_LT.Data.SkillTemplate suitAttr = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(type.SuitAttr2);//套装2 str = suitAttr.Description; suitNeed = 2; SuitAttr2Label.text = string.Format(EB.Localizer.GetString("ID_codefont_in_LTEquipmentFirstInfo_1924"), LTPartnerEquipConfig.HasEffectStrDic[Count >= suitNeed], str); } else if (type.SuitAttr4 != 0) { Hotfix_LT.Data.SkillTemplate suitAttr = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(type.SuitAttr4);//套装4 str = suitAttr.Description; suitNeed = 4; SuitAttr2Label.text = string.Format(EB.Localizer.GetString("ID_codefont_in_LTEquipmentFirstInfo_2136"), LTPartnerEquipConfig.HasEffectStrDic[Count >= suitNeed], str); } if (Count >= suitNeed) { SuitAttr2Label.effectStyle = UILabel.Effect.Outline8; SuitAttr2Label.transform.GetChild(1).GetComponent <UISprite>().color = new Color(0.74f, 1f, 0.85f); } else { SuitAttr2Label.effectStyle = UILabel.Effect.None; SuitAttr2Label.transform.GetChild(1).GetComponent <UISprite>().color = new Color(0.75f, 0.75f, 0.75f); } /*Hotfix_LT.Data.SuitAttribute suitAttr = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetSuitAttrByID(type.SuitAttr2);//套装2 * string str = string.Format(EB.Localizer.GetString("ID_codefont_in_LTSuitSourceInfoController_2338"), suitAttr.desc, (int)(suitAttr.value * 100f)); * Hotfix_LT.Data.SkillTemplate suitAttr2 = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(type.SuitAttr4);//套装4 * string str2 = suitAttr2.Description; * * bool hasSuit2_Effect = Count >= 2;//未做判断//BCFFD8 * SuitAttr2Label.text =string.Format(EB.Localizer.GetString("ID_codefont_in_LTEquipmentFirstInfo_1924"), LTPartnerEquipConfig.HasEffectStrDic[hasSuit2_Effect], str); * * if (hasSuit2_Effect) * { * SuitAttr2Label.effectStyle = UILabel.Effect.Outline8; * SuitAttr2Label.transform.GetChild(1).GetComponent<UISprite>().color = new Color(0.74f,1f,0.85f); * } * else * { * SuitAttr2Label.effectStyle = UILabel.Effect.None ; * SuitAttr2Label.transform.GetChild(1).GetComponent<UISprite>().color = new Color(0.75f, 0.75f, 0.75f); * } * bool hasSuit4_Effect = Count >= 4;//C0C0C0 * SuitAttr4Label.text =string.Format(EB.Localizer.GetString("ID_codefont_in_LTEquipmentFirstInfo_2136"), LTPartnerEquipConfig.HasEffectStrDic[hasSuit4_Effect], str2); * * if (hasSuit4_Effect) * { * SuitAttr4Label.effectStyle = UILabel.Effect.Outline8; * SuitAttr4Label.transform.GetChild(1).GetComponent<UISprite>().color = new Color(0.74f, 1f, 0.85f); * } * else * { * SuitAttr4Label.effectStyle = UILabel.Effect.None; * SuitAttr4Label.transform.GetChild(1).GetComponent<UISprite>().color = new Color(0.75f, 0.75f, 0.75f); * }*/ SuitAttr4Label.gameObject.SetActive(false); //删除了一个套装的效果,不知道会不会改回来1094 mDMono.gameObject.CustomSetActive(true); BGSprite.height = 334 + Mathf.Clamp(type.DropDatas.Count, 1, 3) * 242 + ((SuitAttr2Label.gameObject.activeSelf)?SuitAttr2Label.height:0) + ((SuitAttr4Label.gameObject.activeSelf)?SuitAttr4Label.height:0); //SetAnchor(Pos); }
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(); }
/// <summary> /// 技能图标 /// </summary> /// <param name="commonSkill"></param> /// <param name="commonSkillLevel"></param> /// <param name="activeSkill"></param> /// <param name="activeSkillLevel"></param> /// <param name="passiveSkill"></param> /// <param name="passiveSkillLevel"></param> /// <param name="infoId">用于读取觉醒技能替换信息</param> /// <param name="awakenLevel">是否觉醒</param>> private void SetSkillInfo(int commonSkill, int commonSkillLevel, int activeSkill, int activeSkillLevel, int passiveSkill, int passiveSkillLevel, int infoId, int awakenLevel) { SkillSetTool.SkillFrameStateSet(CommonFrame, false); SkillSetTool.SkillFrameStateSet(PassiveFrame, false); SkillSetTool.SkillFrameStateSet(ActiveFrame, false); if (awakenLevel > 0) { Hotfix_LT.Data.HeroAwakeInfoTemplate template = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroAwakeInfoByInfoID(infoId); if (template.beforeSkill == commonSkill) { commonSkill = template.laterSkill; SkillSetTool.SkillFrameStateSet(CommonFrame, true); } if (template.beforeSkill == activeSkill) { activeSkill = template.laterSkill; SkillSetTool.SkillFrameStateSet(ActiveFrame, true); } if (template.beforeSkill == passiveSkill) { passiveSkill = template.laterSkill; SkillSetTool.SkillFrameStateSet(PassiveFrame, true); } } commonSkillId = commonSkill; activateSkillId = activeSkill; passiveSkillId = passiveSkill; Hotfix_LT.Data.SkillTemplate commonSkillTem = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(commonSkill); if (commonSkillTem != null) { CommonSkillBreakNameLabel.transform.parent.gameObject.CustomSetActive(true); CommonSkillBreakSprite.spriteName = commonSkillTem.Icon; CommonSkillBreakNameLabel.text = commonSkillTem.Name; CommonSkillLevel.text = commonSkillLevel.ToString(); } else { CommonSkillBreakNameLabel.transform.parent.gameObject.CustomSetActive(false); } Hotfix_LT.Data.SkillTemplate passiveSkillTem = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(passiveSkill); if (passiveSkillTem != null) { PassiveSkillBreakNameLabel.transform.parent.gameObject.CustomSetActive(true); PassiveSkillBreakSprite.spriteName = passiveSkillTem.Icon; PassiveSkillBreakNameLabel.text = passiveSkillTem.Name; PassiveSkillLevel.text = passiveSkillLevel.ToString(); } else { PassiveSkillBreakNameLabel.transform.parent.gameObject.CustomSetActive(false); } Hotfix_LT.Data.SkillTemplate activeSkillTem = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(activeSkill); if (activeSkillTem != null) { ActiveSkillBreakNameLabel.transform.parent.gameObject.CustomSetActive(true); ActiveSkillBreakSprite.spriteName = activeSkillTem.Icon; ActiveSkillBreakNameLabel.text = activeSkillTem.Name; ActiveSkillLevel.text = activeSkillLevel.ToString(); } else { ActiveSkillBreakNameLabel.transform.parent.gameObject.CustomSetActive(false); } }
public override void Fill(Hotfix_LT.Data.SuitTypeInfo itemData) { data = itemData; mDMono.gameObject.SetActive(data != null); //, Bg未实现 ChooseObj.SetActive(data.SuitType == LTPartnerEquipDataManager.Instance.CurSuitType); if (itemData.SuitType != -1) { Icon.spriteName = itemData.SuitIcon;//装备角标 LTPartnerEquipConfig.SuitIconDic[data.SuitType]; Icon.gameObject.SetActive(true); AllSuitObj.SetActive(false); if (itemData.SuitAttr2 != 0) { Hotfix_LT.Data.SkillTemplate suitAttr = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(itemData.SuitAttr2);//套装2 SuitAttrLabel.text = string.Format(EB.Localizer.GetString("ID_codefont_in_LTEquipmentSuitInfoItem_1348"), suitAttr.Description); } else if (itemData.SuitAttr4 != 0) { Hotfix_LT.Data.SkillTemplate suitAttr = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(itemData.SuitAttr4);//套装4 SuitAttrLabel.text = string.Format(EB.Localizer.GetString("ID_codefont_in_LTEquipmentSuitInfoItem_1621"), suitAttr.Description); } //Hotfix_LT.Data.SuitAttribute suitAttr = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetSuitAttrByID(data.SuitAttr2);//套装2 //string str = string.Format("{0} +{1}%", suitAttr.desc, (int)(suitAttr.value * 100f)); //Hotfix_LT.Data.SkillTemplate suitAttr2 = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(data.SuitAttr4);//套装4 //string str2 = suitAttr2.Description; //SuitAttrLabel.text = string.Format(EB.Localizer.GetString("ID_codefont_in_LTEquipmentSuitInfoItem_2088"), str, str2); } else { SuitAttrLabel.text = string.Format(EB.Localizer.GetString("ID_codefont_in_LTEquipmentSuitInfoItem_2204")); Icon.gameObject.SetActive(false); AllSuitObj.SetActive(true); } int count = 0; if (LTPartnerEquipMainController.instance.CurrentEquipmentViewState == LTPartnerEquipMainController.EquipmentViewState.SynthesisView) { count = (LTPartnerEquipDataManager.Instance.EquipSynSuitTypeAndCountDic.ContainsKey(data.SuitType)) ? LTPartnerEquipDataManager.Instance.EquipSynSuitTypeAndCountDic[data.SuitType] : 0; } else if (LTPartnerEquipMainController.instance.CurrentEquipmentViewState == LTPartnerEquipMainController.EquipmentViewState.PresetEditView) { count = (LTPartnerEquipDataManager.Instance.SuitTypeAndCountDic.ContainsKey(data.SuitType)) ? LTPartnerEquipDataManager.Instance.SuitTypeAndCountDic[data.SuitType] : 0; } else { count = (LTPartnerEquipDataManager.Instance.SuitTypeAndCountDicWithoutEquiped.ContainsKey(data.SuitType)) ? LTPartnerEquipDataManager.Instance.SuitTypeAndCountDicWithoutEquiped[data.SuitType] : 0;//未实现 } CountLabel.text = string.Format("{0}", count); if (count == 0) { Bg.gameObject.SetActive(true); CountLabel.gameObject.SetActive(false); mDMono.transform.GetComponent <BoxCollider>().enabled = false; } else { Bg.gameObject.SetActive(false); CountLabel.gameObject.SetActive(true); mDMono.transform.GetComponent <BoxCollider>().enabled = true; } NameLabel.text = NameLabel.transform.GetChild(0).GetComponent <UILabel>().text = string.Format(EB.Localizer.GetString("ID_codefont_in_LTEquipmentSuitInfoItem_3047"), data.TypeName); }
/// <summary> /// 设置技能可选择的目标信息 /// </summary> /// <param name="skill_id"></param> /// <param name="type"></param> private void SetTargetingInfo(int skill_id, int type) { //int target_team = -1; //int max_targets = 1; _selectSkillID = skill_id; _selectSkillType = type; List <int> target_indexes = new List <int>(); Hotfix_LT.Data.SkillTemplate skill_tpl = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(skill_id); Hotfix_LT.Data.eSkillSelectTargetType selectTargetType = skill_tpl.SelectTargetType; if (selectTargetType == Hotfix_LT.Data.eSkillSelectTargetType.ENEMY_TEMPLATE || selectTargetType == Hotfix_LT.Data.eSkillSelectTargetType.ENEMY_ALL || selectTargetType == Hotfix_LT.Data.eSkillSelectTargetType.ENEMY_RANDOM) { _targetTeam = 1 - CombatLogic.Instance.LocalPlayerTeamIndex; LTCombatEventReceiver.Instance.ForEach(combatant => { if (combatant.Index == null) { return; } if (combatant.Index.TeamIndex == _targetTeam && (!combatant.IsDead() || skill_tpl.CanSelectDeath) && combatant.CanSelect()) { combatant.SetRestrainFlag(CharacterData.Attr); target_indexes.Add(combatant.Index.IndexOnTeam); } else { combatant.HideRestrainFlag(); } }); } else if (selectTargetType == Hotfix_LT.Data.eSkillSelectTargetType.FRIEND_TEMPLATE || selectTargetType == Hotfix_LT.Data.eSkillSelectTargetType.FRIEND_ALL || selectTargetType == Hotfix_LT.Data.eSkillSelectTargetType.FRIEND_RANDOM) { _targetTeam = CombatLogic.Instance.LocalPlayerTeamIndex; LTCombatEventReceiver.Instance.ForEach(combatant => { if (combatant.Index.TeamIndex == _targetTeam && (!combatant.IsDead() || skill_tpl.CanSelectDeath) && combatant.CanSelect()) { combatant.SetGainFlag(); target_indexes.Add(combatant.Index.IndexOnTeam); } else { combatant.HideRestrainFlag(); } }); } else if (selectTargetType == Hotfix_LT.Data.eSkillSelectTargetType.SELF) { _targetTeam = CombatLogic.Instance.LocalPlayerTeamIndex; LTCombatEventReceiver.Instance.ForEach(combatant => { if (combatant.Index.TeamIndex == _targetTeam && combatant.Index.IndexOnTeam == CharacterData.IndexOnTeam && (!combatant.IsDead() || skill_tpl.CanSelectDeath) && combatant.CanSelect()) { combatant.SetGainFlag(); target_indexes.Add(combatant.Index.IndexOnTeam); } else { combatant.HideRestrainFlag(); } }); } else if (selectTargetType == Hotfix_LT.Data.eSkillSelectTargetType.All_NOT_SELF) { _targetTeam = CombatLogic.Instance.LocalPlayerTeamIndex; LTCombatEventReceiver.Instance.ForEach(combatant => { if (combatant.Data.IngameId != CharacterData.IngameId && (!combatant.IsDead() || skill_tpl.CanSelectDeath) && combatant.CanSelect()) { if (combatant.Index.TeamIndex == _targetTeam) { combatant.SetGainFlag(); } else { combatant.SetRestrainFlag(CharacterData.Attr); } target_indexes.Add(combatant.Index.IndexOnTeam); } else { combatant.HideRestrainFlag(); } }); } else { EB.Debug.LogError("skillSelectType error for skillid={0}", skill_id); } CombatTargetSelectController.Instance.SetTargetingInfo(CharacterData.Index, _targetTeam, 1, target_indexes); }