local UIDivineWeaponSkillTips = UIViewClass() function UIDivineWeaponSkillTips:OnOpened(context) local divineWeaponId = context.divineWeaponId self.state_Icon:SetState(1) self.txt_Lv = self.group_Circle.txt_Lv self.group_Level = self.group_Circle.group_Level self.img_Talent = self.group_Circle.img_Talent self.group_Locked = self.group_Circle.group_Locked self:RefreshTalentInfo(divineWeaponId) end function UIDivineWeaponSkillTips:RefreshTalentInfo(divineWeaponId) local heroInfo = MDL.HeroSelect.GetHeroInfo(divineWeaponId) local isUnlock = heroInfo and heroInfo.isMagicWeaponActive or false self.starLevel = isUnlock and heroInfo.magicWeaponLevel or 0 local magicWeaponStar = DataSheetManager.MagicWeaponStar:GetDataByMagicWeaponID_Star(self.context.appearanceId, self.starLevel) if not magicWeaponStar then magicWeaponStar = DataSheetManager.MagicWeaponStar:GetDataByMagicWeaponID_Star(divineWeaponId, self.starLevel) end local skillId = magicWeaponStar.MusouSkillID self.skillLevel = magicWeaponStar.MusouLevel local skillPath = ConstAssetPathConfig.skillPath..DataSheetManager.SkillData:GetDataByID(skillId).Icon..".png" UIUtils.SetImageByAssetBundle(self.img_Talent, skillPath) local skillTipData = DataSheetManager.SkillTipsData:GetDataByID(skillId) UIUtils.SetLabel(self.txt_TalentName, string.format(UIUtils.GetLocalizedTxt(Const_IDS.IDS_BreakThrough_SkillName), UIUtils.GetLocalizedTxt(Const_IDS[skillTipData.Name]))) UIUtils.SetLabel(self.txt_TalentDes, UTL.String.FormatCombineTextByID(skillTipData.TipsFunc)) self.state_DesLock:SetState( isUnlock and 1 or 0) UIUtils.SetActive(self.group_LockCondition.gameObject, not isUnlock) UIUtils.SetActive(self.group_Level.gameObject, isUnlock) UIUtils.SetActive(self.group_LevelUpHint.gameObject, isUnlock) if isUnlock then UIUtils.SetLabel(self.txt_Lv, magicWeaponStar.MusouLevel) if CTL.DivineWeapon.IsMaxMusouLevel(divineWeaponId) then UIUtils.SetLabelText(self.txt_LevelUpHint, Const_IDS.IDS_HeroSkill_UnlockHint3) else UIUtils.SetLabel(self.txt_LevelUpHint, string.FormatByIdsId(Const_IDS.IDS_HeroSkill_UnlockHint2, UTL.Attr.GetHeroBreakTargetLevelBySkillId(divineWeaponId, skillId))) end else UIUtils.SetLabel(self.txt_LockInfo, string.FormatByIdsId(Const_IDS.IDS_BreakThrough_TipsDes3)) end for i, v in ipairs(self.group_Type) do if i == 1 then UIUtils.SetActive(v.gameObject, true) UIUtils.SetLabelText(v.txt_Type, Const_IDS.IDS_BreakThrough_WuShuang) UIUtils.SetImageByAssetBundle(v.img_Bg, ConstAssetPathConfig.Path41) else UIUtils.SetActive(v.gameObject, false) end end for i, v in DataSheetManager.MagicWeaponStar:GetDataByMagicWeaponID_Star(divineWeaponId) do if v.StarType == LuaConst.UIBreakStarType.Both then self.loop_TalentSkill:AddData(v, 0) end end end function UIDivineWeaponSkillTips:OnButtonClicked(comp) if comp == self.btn_Back then self:CloseView() end end function UIDivineWeaponSkillTips:OnCellInit(scrollRect, index, cellTable, data) local skillTipData = DataSheetManager.SkillTipsData:GetDataByID(data.MusouSkillID) UIUtils.SetLabel(cellTable.txt_Level, string.format(UIUtils.GetLocalizedTxt(Const_IDS.IDS_BreakThrough_Level), data.MusouLevel)) UIUtils.SetLabel(cellTable.txt_Talent, UTL.String.FormatCombineTextByID(skillTipData.TipsFunc)) local isUnlock = self.skillLevel >= data.MusouLevel local isInLevel = self.skillLevel == data.MusouLevel if isUnlock then if isInLevel then cellTable.state_Talent:SetState(2) else cellTable.state_Talent:SetState(1) end else cellTable.state_Talent:SetState(0) end end return UIDivineWeaponSkillTips