--[[ 宠物符文突破属性预览界面 ]]-- local UIPetRuneBreakDetail = UIViewClass() local LOCK_TEXT_COLOR = "888b97" local EMPTY_BLANK = " " function UIPetRuneBreakDetail:OnOpened(context) UIUtils.SetLabel(self.Lab_Top, UIUtils.GetLocalizedTxt(Const_IDS.IDS_PetRune1)) for i, v in DataSheetManager.PetRuneStar:GetEnumerator() do if v.PointType == 2 then self.loop_DetailInfo:AddData(v, 1) end end end function UIPetRuneBreakDetail:OnBackButtonPressed() self:OnButtonClicked(self.BtnClose) end function UIPetRuneBreakDetail:OnButtonClicked(comp) if comp == self.BtnClose or comp == self.btn_Bottom then self:CloseView() end end function UIPetRuneBreakDetail:OnCellInit(scrollRect, index, cellTable, data) UIUtils.SetLabel(cellTable.txt_CellTitle, string.FormatByIdsId(Const_IDS.IDS_Pet_RuneLevelActive, data.ID)) local isLock = self.context.Level < data.ID local result = {} for i, v in ipairs(data.Attr_Table) do if v.IsBasic == true then if isLock then table.insert(result, UTL.Attr.GetAttrText(v.AttrType, v.AttrNum, LOCK_TEXT_COLOR)) else table.insert(result, UTL.Attr.GetAttrText(v.AttrType, v.AttrNum, UTL.Color.Green)) end end end if CTL.Pet.CompareRuneNum(data.ID, data.ID - 1) then table.insert(result, UIUtils.GetLocalizedTxt(Const_IDS.IDS_PetRune3)) end UIUtils.SetLabel(cellTable.txt_CellInfo, isLock and UTL.Color.FormatTextByColor(LOCK_TEXT_COLOR, table.concat(result, EMPTY_BLANK)) or table.concat(result, EMPTY_BLANK)) UIUtils.SetActive(cellTable.img_Locked, isLock) end return UIPetRuneBreakDetail