local UIBossChallengeBuff = UIViewClass() function UIBossChallengeBuff:OnOpened(context) self:Init(context) end function UIBossChallengeBuff:Init(context) self.bossLevelId = context.bossLevelId local bossId = DataSheetManager.BossChallengeLevel:GetDataByID(self.bossLevelId).BossID local bossData = DataSheetManager.BossChallengeData:GetDataByID(bossId) UIUtils.SetLabelText(self.UICommonPopUp.txt_Title, Const_IDS[bossData.BossChallengeName]) self:RefreshBuff() self:RefreshCommandHero() end function UIBossChallengeBuff:RefreshBuff() local buffTable = self:GetBuffTable() for i, v in ipairs(self.group_Buffs) do local buffData = DataSheetManager.BuffData:GetDataByBuffID(buffTable[i]) local iconPath = buffData.BuffIcon UIUtils.SetImageByAssetBundle(v.img_Buff, iconPath) v.txt_BuffInfo.text = UTL.String.FormatCombineTextByID(buffData.BuffDescribe) end end function UIBossChallengeBuff:GetBuffTable() return DataSheetManager.BossChallengeLevel:GetDataByID(self.bossLevelId).BuffID end function UIBossChallengeBuff:RefreshCommandHero() local commandHeroList = self:GetCommandHeroList() for i, v in ipairs(commandHeroList) do if MDL.HideGolden.IsShowGoldenByID(LuaConst.ShowGoldenType.Hero, v) then local data = DataSheetManager.HeroNum:GetDataByID(v) self.group_CommandHero:AddData(data, 0) end end end function UIBossChallengeBuff:GetCommandHeroList() return CTL.BossChallenge.GetCommandHeroList(self.bossLevelId) end function UIBossChallengeBuff:OnBackButtonPressed() self:OnButtonClicked(self.UICommonPopUp.btn_Close) end function UIBossChallengeBuff:OnButtonClicked(comp) if comp == self.UICommonPopUp.btn_Close or self.Bottom then self:CloseView() end end function UIBossChallengeBuff:OnCellInit(scrollRect, index, cellTable, data) UTL.Item.SetHeroIconByHeroId(cellTable.img_HeroHead, data.ID) end return UIBossChallengeBuff