local UIWorldBossSettlement = UIViewClass() function UIWorldBossSettlement:OnOpened(context) UIUtils.SetActive(self.group_Reward, not context.isAssistant) UIUtils.SetActive(self.group_Des, context.isAssistant) UIUtils.SetLabelText(self.UITemplatePopUpZero.txt_Title, Const_IDS.IDS_WorldBoss_Result_KillBoss) -- 标题 if context.isAssistant then -- 我是协助者,这个界面展示助战结果提示文字 local name = context.assistantName local ranking = context.assistantRanking UIUtils.SetActive(self.lab_Des, name ~= nil) if name then UIUtils.SetLabel(self.lab_Des, string.FormatByIdsId(Const_IDS.IDS_WorldBoss_XieZhuShiLiTanChuang_1, UTL.Color.FormatGreenColor(name))) -- 恭喜您成功协助势力成员XX击败首领 end UIUtils.SetActive(self.lab_Des1, ranking ~= nil) if ranking and ranking > 0 then UIUtils.SetLabel(self.lab_Des1, string.FormatByIdsId(Const_IDS.IDS_WorldBoss_XieZhuTanChuang_2, UTL.Color.FormatGreenColor(ranking))) -- 在本场战斗中获得第XX名 end else -- 我是参与boss战的玩家,这个界面显示战斗奖励 local reward = context.Reward for _,vo in ipairs(reward) do self.LevelRewardScroll01:AddData(vo,0) end local extraReward = context.ExtraReward if extraReward and #extraReward > 0 then UIUtils.SetActive(self.group_Info02.gameObject,true) for _,vo in ipairs(extraReward) do self.LevelRewardScroll02:AddData(vo,0) end else UIUtils.SetActive(self.group_Info02.gameObject,false) end end local LeaveTimeNum = DataSheetManager.ConstData:GetDataByID("WorldBossQuitRoom").IntValue self:StartRepeatFunc(self.OnUpdateFun, LeaveTimeNum) CTL.Sound.PlayGameSound("UI_buildarmy") end function UIWorldBossSettlement:OnUpdateFun(deltaTime, timeSinceUpdate) MDL.Level.SendRoleLeaveFuben() end function UIWorldBossSettlement:OnCellInit(scrollRect, index, cellTable, data) UTL.Item.SetItemCell(cellTable.item, data.ItemId, data.ItemCount) end function UIWorldBossSettlement:OnCellSelect(scrollRect, index, cellTable, data) UTL.ItemTips.ShowCommonTipsById(data.ItemId) end function UIWorldBossSettlement:OnButtonClicked(comp) if comp == self.UITemplatePopUpZero.Bottom then self:CloseView() MDL.Level.SendRoleLeaveFuben() end end return UIWorldBossSettlement