local UIWeaponIllustratedLevelTip = UIViewClass() ---------------------------------------------- 系统函数 ---------------------------------------------------------- function UIWeaponIllustratedLevelTip:OnOpened() UIUtils.SetLabelText(self.lab_Title, Const_IDS["IDS_Handbook_MW_MWScore"]) for i = 1, DataSheetManager.HeroPictorialScore:GetDataCount() do local scoreCfg = DataSheetManager.MWPictorialScore: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 UIWeaponIllustratedLevelTip:OnButtonClicked(comp) if comp == self.Bottom or comp == self.close then self:CloseView() end end function UIWeaponIllustratedLevelTip:OnCellInit(scrollRect, index, cellTable, data) if scrollRect == self.LoopScroll_TipsNew then local isUnlock = MDL.WeaponLibrary.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, MDL.WeaponLibrary.GetScoreAttrByLevel(data.levelID, data.attrType)) end cellTable.UIState:SetState(isUnlock and 0 or 1) end end ------------------------------------------------------------------------------------------------------------------- return UIWeaponIllustratedLevelTip