--[[ 神兽突破属性预览界面 ]]-- local UIGodBeastBreakDetail = UIViewClass() local LOCK_TEXT_COLOR = "888b97" local EMPTY_BLANK = " " function UIGodBeastBreakDetail:OnOpened(context) UIUtils.SetLabel(self.Lab_Top, UIUtils.GetLocalizedTxt(Const_IDS.IDS_Godbeast_FateWheel)) self.developInfo = MDL.GodBeast.GetGodBeastInfoByID(context.ID) for i, v in DataSheetManager.GodBeastStar:GetDataByID_Star(context.ID) do if v.StarAttr > 0 and v.Star <= self.developInfo.starLevel + 3 then self.loop_DetailInfo:AddData(v, 1) end end end function UIGodBeastBreakDetail:OnBackButtonPressed() self:OnButtonClicked(self.BtnClose) end function UIGodBeastBreakDetail:OnButtonClicked(comp) if comp == self.BtnClose or comp == self.btn_Bottom then self:CloseView() end end function UIGodBeastBreakDetail:OnCellInit(scrollRect, index, cellTable, data) local attrData = DataSheetManager.GodBeastStarAttr:GetDataByID(data.StarAttr) -- 增加属性 local isLock = self.developInfo.starLevel < data.Star + 1 local result = {} for i, v in ipairs(attrData.Attr_Table) do 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 --天赋点 table.insert(result, string.FormatByIdsId(Const_IDS.IDS_Godbeast_Talent12, data.SkillPoint)) 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) -- 命轮几重 UIUtils.SetLabel(cellTable.txt_CellTitle, string.FormatByIdsId(Const_IDS.IDS_Godbeast_FateWheelLevel1, data.Star + 1)) end return UIGodBeastBreakDetail