local UIGuildBossSummaryReward = UIViewClass() local CountDown = 10 function UIGuildBossSummaryReward:OnOpened(context) if #context.myGuildRewards.rewards > 0 then for i, v in ipairs(context.myGuildRewards.rewards) do self.scroll_RewardBottom:AddData(v, 0) end self.lab_GuildEmpty.text = nil else UIUtils.SetLabelText(self.lab_GuildEmpty, Const_IDS.IDS_GuildBoss_GuildNoDamage) end if #context.myRewardItems > 0 then for i, v in ipairs(context.myRewardItems) do self.scroll_RewardTop:AddData(v, 0) end self.lab_Empty.text = nil UIUtils.SetLabelText(self.lab_Mail, Const_IDS.IDS_GuildWar_RewardIntro2) self.lab_Mail.text = nil UIUtils.SetActive(self.lab, false) else UIUtils.SetLabelText(self.lab, Const_IDS.IDS_DrawCard_Title_Congratulations) UIUtils.SetLabelText(self.lab_Empty, Const_IDS.IDS_GuildBoss_NoRewardDesc) end self.lab_Tips.text = string.FormatByIdsId(Const_IDS.IDS_GuildBoss_RollLootingDesc, context.myDiceNum) local str = UIUtils.GetLocalizedTxt(Const_IDS.IDS_GuildBoss_AutoCloseTime) self.labLocal_Timer:ResetAndBeginCustomTimer(false, CountDown, 0, str) self:StartRepeatFunc(self.OnUpdateFun, CountDown) CTL.Sound.PlayGameSound("UI_failed_v1") self.TitleSwitch:SetState(0) end function UIGuildBossSummaryReward:OnClosed() MDL.GuildBoss.ReturnWaitSceneReq() end function UIGuildBossSummaryReward:OnUpdateFun() self:CloseView() end function UIGuildBossSummaryReward:OnBackButtonPressed() self:OnButtonClicked(self.event_Bottom) end function UIGuildBossSummaryReward:OnButtonClicked(comp) if comp == self.event_Bottom then self:CloseView() end end function UIGuildBossSummaryReward:OnCellInit(scrollRect, index, cellTable, data) if self.scroll_RewardBottom == scrollRect then UTL.Item.SetItemCell(cellTable.item, data.rewards.ItemId, data.rewards.ItemCount) self:ShowRewardTag(data.poolType, cellTable) else UTL.Item.SetItemCell(cellTable.item, data.ItemId, data.ItemCount) end end function UIGuildBossSummaryReward:ShowRewardTag(rewardTag, item) if rewardTag == MDL.GuildBoss.RewardTag.PuTong then item.obj_State:SetState(0) elseif rewardTag == MDL.GuildBoss.RewardTag.ZhenPin then item.obj_State:SetState(1) elseif rewardTag == MDL.GuildBoss.RewardTag.JiPin then item.obj_State:SetState(2) end end function UIGuildBossSummaryReward:OnCellClicked(scrollRect, index, cellTable, target, data) if self.scroll_RewardBottom == scrollRect then UTL.ItemTips.ShowCommonTipsById(data.rewards.ItemId) else UTL.ItemTips.ShowCommonTipsById(data.ItemId) end end return UIGuildBossSummaryReward