--[[ 神兽图鉴主页面放大镜 ]]-- local UIGodBeastIllustratedLevelTip = UIViewClass() --常量 local TITLE_IDS_ID = "IDS_Handbook_GodBeast_GodBeastScore" ---------------------------------------------- 系统函数 ---------------------------------------------------------- function UIGodBeastIllustratedLevelTip:OnOpened(context) UIUtils.SetLabelText(self.lab_Title, Const_IDS[TITLE_IDS_ID]) self.targetModule = MDL.GodBeastLibrary self.pictorialScoreExcel = DataSheetManager.GodBeastPictorialScore self:Init() end function UIGodBeastIllustratedLevelTip:Init() for i = 1, self.pictorialScoreExcel:GetDataCount() do local scoreCfg = self.pictorialScoreExcel:GetDataByLevelID(i) self.LoopScroll_TipsNew:AddData({title = string.FormatByIdsId(Const_IDS[scoreCfg.Title], i, scoreCfg.NeedScore), levelID = i}, 0) for _, v in ipairs (scoreCfg.Attr_Table) do self.LoopScroll_TipsNew:AddData({attrType = v.AttrType, levelID = i}, 1) end end end function UIGodBeastIllustratedLevelTip:OnButtonClicked(comp) if comp == self.Bottom or comp == self.close then self:CloseView() end end function UIGodBeastIllustratedLevelTip:OnCellInit(scrollRect, index, cellTable, data) if scrollRect == self.LoopScroll_TipsNew then local isUnlock = self.targetModule.GetLibraryLevelAndScore() >= data.levelID if data.title then UIUtils.SetLabel(cellTable.lab_Title, data.title) else local attrData = DataSheetManager.AttrData:GetDataByID(data.attrType) UTL.Item.SetAtlasSprite(cellTable.img_Icon,"UI_Common", attrData.Icon) UIUtils.SetLabelText(cellTable.lab_Name, Const_IDS[attrData.Name]) UIUtils.SetLabel(cellTable.txt_Present, self.targetModule.GetScoreAttrByLevel(data.levelID, data.attrType)) end cellTable.UIState:SetState(isUnlock and 0 or 1) end end return UIGodBeastIllustratedLevelTip