local UIHonorSignetAttrTips = UIViewClass() function UIHonorSignetAttrTips:OnOpened(context) local attrList local signetNum local x, y = context.comp:GetPosition() self.group_Tips:SetPosition(x, y) if context.isSelf then local dict = MDL.HonorSignet.GetActiveIdDict() attrList = CTL.HonorSignet.CalculateAllAttr(dict, true) signetNum = table.getDictCount(dict) else local list = context.list attrList = CTL.HonorSignet.CalculateAllAttr(list) signetNum = #list end if attrList and #attrList > 0 then for i, v in ipairs(attrList) do self.loop_Attr:AddData(v, 0) end end self.state_Attr:SetState(self.loop_Attr.Count > 0 and 0 or 1) self.txt_Unlock.text = UIUtils.GetLocalizedTxt(Const_IDS.IDS_HonorSignet_Hint_1) .. signetNum .. "/" .. DataSheetManager.AchievementHonorSignet:GetDataCount() end function UIHonorSignetAttrTips:OnBackButtonPressed() self:OnButtonClicked(self.btn_Close) end function UIHonorSignetAttrTips:OnButtonClicked(comp) if comp == self.btn_Close then self:CloseView() elseif comp == self.btn_Bg then self:CloseView() end end function UIHonorSignetAttrTips:OnCellInit(scrollRect, index, cellTable, data) UTL.Attr.SetAttrItemByCompName(cellTable, data.AttrType, data.AttrNum, true, true) end return UIHonorSignetAttrTips