local UIRankPromoteSuccess = UIViewClass() function UIRankPromoteSuccess:OnOpened(context) UIUtils.SetLabelText(self.UITemplatePopUpZero.txt_Title, Const_IDS.IDS_MagicWeapon_SmallStar) self:ShowViewData() end function UIRankPromoteSuccess:OnButtonClicked(comp) if comp == self.UITemplatePopUpZero.Bottom then self:CloseView() end end function UIRankPromoteSuccess:ShowViewData() local currentNobilityID = MDL.Nobility.GetNobilityID() local lastNobilityConfig = DataSheetManager.Nobility:GetDataByRankID(currentNobilityID - 1) local currentNobilityConfig = DataSheetManager.Nobility:GetDataByRankID(currentNobilityID) UIUtils.SetImageByAssetBundle(self.img_RankBefore, lastNobilityConfig.BigIcon) UIUtils.SetLabel(self.txt_LevelBefore, string.FormatByIdsId(Const_IDS.IDS_HeroLevelShow, UTL.Item.GetNobilityByTeamLevel(lastNobilityConfig.TeamLevelMax))) UIUtils.SetImageByAssetBundle(self.img_RankAfter, currentNobilityConfig.BigIcon) UIUtils.SetLabel(self.txt_LevelAfter, string.FormatByIdsId(Const_IDS.IDS_HeroLevelShow, UTL.Item.GetNobilityByTeamLevel(MDL.HeroSelect.GetTeamLevel()))) for i, v in ipairs(MDL.Nobility.GetAttribute(3)) do if self.group_Attrs[i] then UIUtils.SetLabel(self.group_Attrs[i].txt_Attr, UIUtils.GetLocalizedTxt(Const_IDS[DataSheetManager.AttrData:GetDataByID(v.AttrType).Name])) UIUtils.SetLabel(self.group_Attrs[i].txt_Number, "+"..v.AttrNum) end end end return UIRankPromoteSuccess