local UIWarHorseInfoView = UIViewClass() function UIWarHorseInfoView:OnOpened(context) local horseId = context.HorseID local activeInfo = MDL.WarHorse.GetInfoByID(horseId) local starLevel = activeInfo and activeInfo.HorseInfo.starLevel or 0 local horseStarConfig = DataSheetManager.HorseStar:GetDataByHorseID_Star(horseId,starLevel) for i = 1, horseStarConfig.PreDevelopEffectNum do local starConfig = DataSheetManager.HorseStar:GetDataByHorseID_Star(horseId,i - 1) if starLevel > starConfig.Star then self.InfoView:AddData(starConfig, 0) else self.InfoView:AddData(starConfig, 1) end end end function UIWarHorseInfoView:OnCellInit(scrollRect, index, cellTable, data) cellTable.txt_Title.text = string.FormatByIdsId(Const_IDS.IDS_Horse_Star_2,index + 1) UIUtils.SetLabel(cellTable.txt_attrName, UTL.String.FormatCombineTextByID(data.StarText)) end function UIWarHorseInfoView:OnBackButtonPressed() self:OnButtonClicked(self.btn_Close) end function UIWarHorseInfoView:OnButtonClicked(comp) if comp == self.btn_Close then self:CloseView() end end return UIWarHorseInfoView