local UIHorseSoulSkillInfo = UIViewClass() function UIHorseSoulSkillInfo:OnOpened(context) local horseSoulSuitID = context.suitID self.horseSoulSkillLevel = context.skillLevel local firstLevelData = DataSheetManager.HorseSoulSuitData:GetDataByHorseSoulSuitID_HorseSoulSkillLevel(horseSoulSuitID, 1) self.txt_SkillDesc.text = UTL.String.FormatCombineTextByID(firstLevelData.HorseSoulSkillDes) local newData = DataSheetManager.HorseSoulSuitData:GetDataByHorseSoulSuitID_HorseSoulSkillLevel(horseSoulSuitID, self.horseSoulSkillLevel) UIUtils.SetImageByAssetBundle(self.img_SoulSkill, newData.HorseSoulSkillIcon) UIUtils.SetLabelText(self.txt_TalentName, Const_IDS[newData.HorseSoulSkillName]) self.txt_Level.text = string.FormatByIdsId(Const_IDS.IDS_BreakThrough_Lv, self.horseSoulSkillLevel) for i = 2, newData.SeeLevel do local data = DataSheetManager.HorseSoulSuitData:GetDataByHorseSoulSuitID_HorseSoulSkillLevel(horseSoulSuitID, i) self.loop_SoulSkillLevel:AddData(data, 0) end local isInvalid = context.isInvalid UIUtils.SetActive(self.group_NoEffect, isInvalid) UIUtils.SetActive(self.group_Notice, isInvalid) end function UIHorseSoulSkillInfo:OnButtonClicked(comp) if comp == self.btn_Close then self:CloseView() end end function UIHorseSoulSkillInfo:OnBackButtonPressed() self:OnButtonClicked(self.btn_Close) end function UIHorseSoulSkillInfo:OnCellInit(scrollRect, index, cellTable, data) cellTable.txt_Level.text = string.FormatByIdsId(Const_IDS.IDS_BreakThrough_Lv, data.HorseSoulSkillLevel) cellTable.txt_SkillInfo.text = UTL.String.FormatCombineTextByID(data.HorseSoulSkillDes) if self.horseSoulSkillLevel < data.HorseSoulSkillLevel then cellTable.state_Skill:SetState(0) local str = nil if data.HorseSoulSkillPictorialLevel > 0 then str = string.FormatByIdsId(Const_IDS.IDS_HorseSoul_SkillHint2, data.HorseSoulSkillPictorialLevel) end local quality = data.Soul_Table[1] and data.Soul_Table[1].SoulQuality or LuaConst.QualityColor.Gold if quality > 0 then local qualityText = UIUtils.GetLocalizedTxt(Const_IDS[DataSheetManager.QualityColor:GetDataByID(quality).ColorText]) if str == nil then str = string.FormatByIdsId(Const_IDS.IDS_HorseSoul_SkillHint3, data.Soul_Table[1].SoulNum, qualityText) else if data.Soul_Table[1] then str = str.. UIUtils.GetLocalizedTxt(Const_IDS.IDS_HorseSoul_SkillHint4) .. string.FormatByIdsId(Const_IDS.IDS_HorseSoul_SkillHint3, data.Soul_Table[1].SoulNum, qualityText) else str = str.. UIUtils.GetLocalizedTxt(Const_IDS.IDS_HorseSoul_SkillHint4) .. string.FormatByIdsId(Const_IDS.IDS_HorseSoul_SkillHint5, data.SoulStar_Table[1].NeedSoulNum, UIUtils.GetLocalizedTxt(Const_IDS["IDS_Number_Written_"..data.SoulStar_Table[1].NeedSoulStar])) end end end UIUtils.SetActive(cellTable.txt_Lock, true) cellTable.txt_Lock.text = str else UIUtils.SetActive(cellTable.txt_Lock, false) cellTable.state_Skill:SetState(1) end end return UIHorseSoulSkillInfo