--[[ 神兽技能信息预览弹窗 ]]-- local UIGodBeastTalentSkillTips = UIViewClass() function UIGodBeastTalentSkillTips:OnOpened(context) local godBeastID = context.godBeastID self.config = DataSheetManager.GodBeastData:GetDataByID(godBeastID) -- 设置神兽技能图标、名称、描述 --部分主将技能解释超框改滑动 如太史慈 CTL.GodBeast.SetSkillInfo(self.group_Square.img_Talent, self.txt_TalentName, self.txt_TalentDes, godBeastID) 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 for idx = 1, self.config.TalentCount do self.loop_TalentSkill:AddData(idx, 0) end end function UIGodBeastTalentSkillTips:OnCellInit(scrollRect, index, cellTable, data) local godBeastID = self.config.ID local curLearnCount = MDL.GodBeast.GetTalentPointProgress(godBeastID, data) local isActive = curLearnCount > 0 local firstTalentPointData = DataSheetManager.GodBeastTalent:GetDataByID_LevelID_PointId(self.config.ID, data, 1) UIUtils.SetLabelText(cellTable.txt_Skill, Const_IDS[firstTalentPointData.GodBeast_TalentType]) cellTable.local_State:SetState(isActive and 2 or 0) for idx, col in ipairs(cellTable.info_Arr) do local talentPointData = DataSheetManager.GodBeastTalent:GetDataByID_LevelID_PointId(self.config.ID, data, idx) if curLearnCount >= idx then UIUtils.SetActive(col.gameObject, true) col.state_Info:SetState(2) -- 天赋点描述 UIUtils.SetLabel(col.txt_Info, UTL.String.FormatCombineTextByID(talentPointData.Desc_3)) else UIUtils.SetActive(col.gameObject, false) end end end function UIGodBeastTalentSkillTips:OnButtonClicked(comp) if comp == self.btn_Back then self:CloseView() end end return UIGodBeastTalentSkillTips