local UIHeroSkillTips = require("View/Common/UIHeroSkillTips") local UIHeroSkillTipsPreview = UIViewClass(UIHeroSkillTips) local SkillIconPath = ConstAssetPathConfig.SkillImagePath function UIHeroSkillTipsPreview:RefreshSkillInfo(skillId) local data = DataSheetManager.SkillTipsData:GetDataByID(skillId) UIUtils.SetLabelText(self.txt_TalentName, Const_IDS[data.Name]) UIUtils.SetLabel(self.txt_TalentDes, UTL.String.FormatCombineTextByID(self.skillTips[1])) if self.txt_TalentDes.preferredHeight > 400 then UIUtils.SetParent(self.txt_TalentDes, self.Content) UIUtils.SetActive(self.scroll_Txt, true) else UIUtils.SetParent(self.txt_TalentDes, self.group_Info) UIUtils.SetActive(self.scroll_Txt, false) end if self.isAwaken then UIUtils.SetImageByAssetBundle(self.img_Talent, CTL.HeroAwaken.GetAwakenDisplaySkillIcon(self.heroId, skillId)) else UIUtils.SetImageByAssetBundle(self.img_Talent, string.format(SkillIconPath, data.SkillIcon)) end self.state_DesLock:SetState(1) UIUtils.SetActive(self.group_Level, true) if self.context.isMax then self.currentSkillLevel = #self.skillTips UIUtils.SetLabelText(self.txt_LevelUpHint, Const_IDS["IDS_HeroSkill_UnlockHint_FairFight"]) else self.currentSkillLevel = 1 UIUtils.SetLabelText(self.txt_LevelUpHint, Const_IDS["IDS_NotOpen"]) end self:DisableLockUI() --从第二条开始的技能描述 for i = 2, #self.skillTips do self.loop_TalentSkill:AddData({desc = self.skillTips[i],level = i}, 0) end --滚动当前技能居中显示 self.loop_TalentSkill:MoveIndex(self.currentSkillLevel -2) 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[data.SkillFuncType]) else UIUtils.SetActive(v.gameObject, false) end end end function UIHeroSkillTipsPreview:DisableLockUI() local isLock = false UIUtils.SetLabel(self.txt_Lv, self.currentSkillLevel) UIUtils.SetActive(self.group_Locked, isLock) UIUtils.SetActive(self.group_LockCondition, isLock) UIUtils.SetActive(self.group_LevelUpHint, not isLock) UIUtils.SetActive(self.group_Level, not isLock) end return UIHeroSkillTipsPreview