local UIHonorSignetDetailsTips = UIViewClass() --[[ context = { list, --装备印记数组 index, --打开的位于数组的索引位置 timeList, --他人激活时间 } ]]-- function UIHonorSignetDetailsTips:OnOpened(context) self.list = context.list self.index = context.index self.timeList = context.timeList self:RefreshSignetInfo() local notSingle = #self.list > 1 UIUtils.SetActive(self.btn_ArrowR, notSingle) UIUtils.SetActive(self.btn_ArrowL, notSingle) end function UIHonorSignetDetailsTips:RefreshSignetInfo() local data = DataSheetManager.AchievementHonorSignet:GetDataByID(self.list[self.index]) UIUtils.SetImageByAssetBundle(self.img_Icon, data.HonorSignetIcon) local quality = data.HonorSignetQuality self.txt_Name.text = UTL.Color.FormatQualityText(UIUtils.GetLocalizedTxt(Const_IDS[data.HonorSignetTitle]), quality) if self.timeList then self.txt_ActiveTime.text = os.date(UTL.Time.FormatDateEnum.YMDHM, self.timeList[self.index]) else local activeInfo = MDL.HonorSignet.GetActiveInfo(data.ID) if activeInfo then self.txt_ActiveTime.text = os.date(UTL.Time.FormatDateEnum.YMDHM, MDL.HonorSignet.GetActiveInfo(data.ID)) else logging.error(LTAG.ERROR, "没有在自己的荣誉印记激活信息中找到Id:", data.ID, "的印记信息,请检查!!!") end end self.loop_Attr:ReloadAll(data.Attr_Table) self.loop_Prerequisites:ReloadAll(data.PreAchievement_Table) end function UIHonorSignetDetailsTips:OnBackButtonPressed() self:OnButtonClicked(self.btn_Close) end function UIHonorSignetDetailsTips:OnButtonClicked(comp) if comp == self.btn_Close then self:CloseView() elseif comp == self.btn_ArrowR then self.index = self.index + 1 if self.index > #self.list then self.index = 1 end self:RefreshSignetInfo() elseif comp == self.btn_ArrowL then self.index = self.index - 1 if self.index <= 0 then self.index = #self.list end self:RefreshSignetInfo() end end function UIHonorSignetDetailsTips:OnCellInit(scrollRect, index, cellTable, data) if scrollRect == self.loop_Attr then UTL.Attr.SetAttrItemByCompName(cellTable, data.AttrType, data.AttrNum, true, true) elseif scrollRect == self.loop_Prerequisites then local id = data.PreAchievementID local achievementData = MDL.Achievement.GetAchievementItemByID(id) local itemName, itemDes = CTL.Achievement.GetAchievementTitleAndDesc(achievementData) cellTable.txt_AchievementName.text = itemName cellTable.state_Achieved:SetState((CTL.Achievement.IsAchievementCompleted(id) or self.timeList) and 1 or 0) end end function UIHonorSignetDetailsTips:OnCellClicked(scrollRect, index, cellTable, target, data) if scrollRect == self.loop_Prerequisites then if target == cellTable.btn_Achievement then UIManager.OpenAndPushAll(Const_UI_Lua.UIEnum.UIAchievementBase, {achievementId = data.PreAchievementID}) end end end return UIHonorSignetDetailsTips