local UIRecycleFragmentLevelUpSuccess = UIViewClass() -------------------- function UIRecycleFragmentLevelUpSuccess:OnOpened(context) self:RegistSystemEvent(EventID.RecycleFragment_RFLevelUpSuccess, self.InitPanel) UIUtils.SetLabelText(self.UITemplatePopUpZero.txt_Title, Const_IDS.IDS_RFLevelUpWindow_Title) self:InitPanel() CTL.Sound.PlayGameSound("UI_breakthrough_03") end function UIRecycleFragmentLevelUpSuccess:OnButtonClicked(comp) if comp == self.UITemplatePopUpZero.Bottom then self:CloseView() end end -------------------- function UIRecycleFragmentLevelUpSuccess:InitPanel() local curLevel = MDL.Reborn.GetRecycleFragmentLevel() UIUtils.SetLabel(self.txt_OldStar, string.FormatByIdsId(Const_IDS.IDS_HeroLevelShow, curLevel - 1)) UIUtils.SetLabel(self.txt_NewStar, string.FormatByIdsId(Const_IDS.IDS_HeroLevelShow, curLevel)) -- 关闭其他UI UIUtils.SetActive(self.group_OnlySkill.gameObject, false) UIUtils.SetActive(self.group_SkillWithAttr.gameObject, false) UIUtils.SetActive(self.img_FetterBg, false) -- 属性展示 local curLevelData = DataSheetManager.RecycleFragmentLevel:GetDataByRecycleFragmentLevel(curLevel) for i, item in ipairs(self.group_AttrInfo) do local attrData = curLevelData.Attr_Table[i] if attrData then UIUtils.SetActive(item.gameObject, true) UTL.Attr.SetAttrItemByCompName(item, attrData.AttrType, 0, true, true, 0) UIUtils.SetActive(item.txt_Attr_Before, false) -- 单独设置一下数值 UIUtils.SetLabel(item.txt_Attr, string.format("+%s%%", attrData.AttrNum * 100)) else UIUtils.SetActive(item.gameObject, false) end end end return UIRecycleFragmentLevelUpSuccess