local UIDivineWeaponBreakInfoView = UIViewClass() local SkillIconPath = ConstAssetPathConfig.SkillImagePath local LockTextColor = "888b97" function UIDivineWeaponBreakInfoView:OnOpened(context) UIUtils.SetLabelText(self.Lab_Top, Const_IDS.IDS_HeroStarDetail) self.weaponId = context.weaponId local heroInfo = MDL.HeroSelect.GetHeroInfo(self.weaponId) if heroInfo and heroInfo.isMagicWeaponActive then self.appearanceID = heroInfo.curAttrWeaponAppearanceId self.starLevel = heroInfo.magicWeaponLevel or 0 UIUtils.SetActive(self.group_Appearance.gameObject, self.appearanceID ~= self.weaponId) if self.appearanceID ~= self.weaponId then local defaultWeaponTalent = DataSheetManager.MagicWeaponData:GetDataByMagicWeaponID(self.weaponId).MagicWeaponTalent local appearanceData = DataSheetManager.WeaponAppearance:GetDataByID(self.appearanceID) local difference = appearanceData.MagicWeaponTalent - defaultWeaponTalent if difference > 0 then UIUtils.SetLabel(self.Lab_Appearance, string.FormatByIdsId(Const_IDS.IDS_Appearance_UI_TuPoJiaCheng, UTL.Color.FormatQualityText(UIUtils.GetLocalizedTxt(Const_IDS[appearanceData.AppearanceName]), appearanceData.MagicWeaponQuality))) else UIUtils.SetActive(self.group_Appearance.gameObject, false) end end else self.starLevel = 0 self.appearanceID = self.weaponId end local showNumLimit = DataSheetManager.MagicWeaponStar:GetDataByMagicWeaponID_Star(self.appearanceID, self.starLevel).PreDevelopEffectNum for i, v in DataSheetManager.MagicWeaponStar:GetDataByMagicWeaponID_Star(self.appearanceID) do if v.Star ~= 0 then self.loop_DetailInfo:AddData(v, 2) end if i > showNumLimit then return end end end function UIDivineWeaponBreakInfoView:OnButtonClicked(comp) if comp == self.BtnClose or comp == self.btn_Bottom then self:CloseView() end end function UIDivineWeaponBreakInfoView:OnCellInit(scrollRect, index, cellTable, data) local isUnlock = self.starLevel >= data.Star local titleText = string.FormatByIdsId(Const_IDS.IDS_HeroStarLevel, data.Star) UIUtils.SetLabel(cellTable.txt_CellTitle, isUnlock and titleText or UTL.Color.FormatTextByColor(LockTextColor, titleText)) UIUtils.SetActive(cellTable.group_Skill.gameObject, false) UIUtils.SetActive(cellTable.group_Attr.gameObject, false) if data.StarType == LuaConst.UIBreakStarType.Skill then UIUtils.SetActive(cellTable.group_Skill.gameObject, true) local starData = DataSheetManager.MagicWeaponStar:GetDataByMagicWeaponID_Star(self.appearanceID, data.Star) local skillText = UTL.String.FormatCombineTextByID(starData.SkillDevelopDes) if isUnlock then skillText = UTL.Color.FormatWhiteColor(skillText) skillText = UTL.Color.ReplaceGreenTextInSpecificChar(skillText, "00EC00", "(", ")") else skillText = UTL.Color.FormatTextByColor(LockTextColor, skillText) end UIUtils.SetLabel(cellTable.txt_SkillInfo, skillText) local weaponData = DataSheetManager.MagicWeaponData:GetDataByMagicWeaponID(self.weaponId) local skillData = DataSheetManager.SkillData:GetDataByID(weaponData.ActivationMusouSkillID)--不需要通过entity获取,因为这是战斗外的 UIUtils.SetImageByAssetBundle(cellTable.img_Skill, string.format(SkillIconPath, skillData.Icon)) elseif data.StarType == LuaConst.UIBreakStarType.Attrs then UIUtils.SetActive(cellTable.group_Attr.gameObject, true) if isUnlock then local attrText = CTL.DivineWeapon.GetDivineWeaponBreakAttrTextList(self.appearanceID, data.Star, UTL.Color.Green) for k,v in ipairs(cellTable.group_Attr) do UIUtils.SetLabel(v, UTL.Color.FormatWhiteColor(attrText[k])) end else local attrText = CTL.DivineWeapon.GetDivineWeaponBreakAttrTextList(self.appearanceID, data.Star, LockTextColor) for k,v in ipairs(cellTable.group_Attr) do UIUtils.SetLabel(v, UTL.Color.FormatTextByColor(LockTextColor, attrText[k])) end end elseif data.StarType == LuaConst.UIBreakStarType.Both then UIUtils.SetActive(cellTable.group_Attr.gameObject, true) UIUtils.SetActive(cellTable.group_Skill.gameObject, true) local starData = DataSheetManager.MagicWeaponStar:GetDataByMagicWeaponID_Star(self.appearanceID, data.Star) local skillText = UTL.String.FormatCombineTextByID(starData.SkillDevelopDes) local attrText = { } if isUnlock then skillText = UTL.Color.FormatWhiteColor(skillText) skillText = UTL.Color.ReplaceGreenTextInSpecificChar(skillText, "00EC00", "(", ")") attrText = CTL.DivineWeapon.GetDivineWeaponBreakAttrTextList(self.appearanceID, data.Star, UTL.Color.Green) for k,v in ipairs(cellTable.group_Attr) do UIUtils.SetLabel(v, UTL.Color.FormatWhiteColor(attrText[k])) end else skillText = UTL.Color.FormatTextByColor(LockTextColor, skillText) attrText = CTL.DivineWeapon.GetDivineWeaponBreakAttrTextList(self.appearanceID, data.Star, LockTextColor) for k,v in ipairs(cellTable.group_Attr) do UIUtils.SetLabel(v, UTL.Color.FormatTextByColor(LockTextColor, attrText[k])) end end UIUtils.SetLabel(cellTable.txt_SkillInfo, skillText) local weaponData = DataSheetManager.MagicWeaponData:GetDataByMagicWeaponID(self.weaponId) local skillData = DataSheetManager.SkillData:GetDataByID(weaponData.ActivationMusouSkillID)--不需要通过entity获取,因为这是战斗外的 UIUtils.SetImageByAssetBundle(cellTable.img_Skill, string.format(SkillIconPath, skillData.Icon)) end UIUtils.SetActive(cellTable.img_Locked, not isUnlock) UIUtils.SetActive(cellTable.img_SkillLocked, not isUnlock) end return UIDivineWeaponBreakInfoView