local UIHeroTeamBuff = UIViewClass() function UIHeroTeamBuff:OnOpened() UIUtils.SetLabelText(self.UITemplatePopUpZero.txt_Title, Const_IDS.IDS_NewHeroTeamBuff_Hint1) local lineUpIds = MDL.Player.GetHeroLinUpIds() local formationIndex = CTL.AssistanceFight.GetTeamBuffFormationIndex() local mainHeroId, subHeroId = lineUpIds[formationIndex * 2 - 1], lineUpIds[formationIndex * 2] local qualityLevel = CTL.AssistanceFight.CalculateFormationBuffLevel(mainHeroId, subHeroId) local mainHero = DataSheetManager.HeroNum:GetDataByID(mainHeroId) local subHero = DataSheetManager.HeroNum:GetDataByID(subHeroId) UTL.Color.SetQualityImageByType(self.group_HeroHead1.bg_HeroHead, mainHero.HeroQuality, UTL.Color.QualityType.Square) UTL.Item.SetHeroIconByHeroId(self.group_HeroHead1.img_HeroHead, mainHeroId, MDL.HeroAwaken.GetIsHeroAwaken(mainHeroId)) UIUtils.SetLabelText(self.txt_HeroName1, Const_IDS[mainHero.NameIDS]) UTL.Color.SetQualityImageByType(self.group_HeroHead2.bg_HeroHead, subHero.HeroQuality, UTL.Color.QualityType.Square) UTL.Item.SetHeroIconByHeroId(self.group_HeroHead2.img_HeroHead, subHeroId, MDL.HeroAwaken.GetIsHeroAwaken(subHeroId)) UIUtils.SetLabelText(self.txt_HeroName2, Const_IDS[subHero.NameIDS]) local tIDS, dIDS, nIDS = CTL.AssistanceFight.GetBuffTitleAndDes(qualityLevel) UIUtils.SetLabel(self.txt_Effect, UIUtils.GetLocalizedTxt(Const_IDS["IDS_Formation_Team" .. formationIndex]) .. dIDS) UIUtils.SetLabel(self.txt_Tip, UIUtils.GetLocalizedTxt(Const_IDS[nIDS])) CTL.AssistanceFight.SetActiveFormationIcon(self.group_TeamBuff1.img_TeamBuff, mainHero.Kingdom) for i, v in ipairs (self.group_TeamBuff1.group_Light) do UIUtils.SetActive(self.group_TeamBuff1.group_Light[i], qualityLevel >= i) end end function UIHeroTeamBuff:OnClosed() CTL.AssistanceFight.ShowTeamworkBuff() end function UIHeroTeamBuff:OnButtonClicked(comp) if comp == self.UITemplatePopUpZero.Bottom then self:CloseView() end end return UIHeroTeamBuff