local UIWorldBossTeamEnter = UIViewClass() local CLOSE_TIME = DataSheetManager.ConstData:GetDataByID("WorldBossInviteTeamMateCancelCountdown").IntValue function UIWorldBossTeamEnter:OnOpened(context) self.toggle_Check.isOn = false local bossConfig = DataSheetManager.WorldBoss:GetDataByID(context.BossCfgID) self.bossType = bossConfig.BossType UIUtils.SetImageByAssetBundle(self.img_BossHead, bossConfig.Icon) self.txt_Level.text = UTL.Item.GetNobilityByTeamLevel(bossConfig.ShowLevel) -- 爵位转换 self.cdTimer:ResetAndBeginCustomTimer(false, CLOSE_TIME, 0, UIUtils.GetLocalizedTxt(Const_IDS.IDS_WorldBoss_InviteTeamMate_Countdown), 1) local line = context.VirtualLine local activityName if self.bossType == LuaConst.WorldBossType.WorldBoss then activityName = UIUtils.GetLocalizedTxt(Const_IDS.IDS_ActivityName_WorldBoss) elseif self.bossType == LuaConst.WorldBossType.WarZoneWorldBoss then activityName = UIUtils.GetLocalizedTxt(Const_IDS.IDS_ActivityName_WarZoneBoss) end -- 成员名, 玩法, 等级, boss名, 线路号 local content = string.FormatByIdsId(Const_IDS.IDS_WorldBoss_InviteTeamMate_Tip, context.CallerName, activityName, bossConfig.ShowLevel, UIUtils.GetLocalizedTxt(Const_IDS[bossConfig.WordBossName]), line) self.txt_Main.text = content self:StartRepeatFunc(self.OnUpdateFun, CLOSE_TIME) UIUtils.SetLabelText(self.UICommonPopUp.txt_Title, Const_IDS.IDS_WorldBoss_InviteTeamMate_Title) end function UIWorldBossTeamEnter:OnUpdateFun(deltaTime, timeSinceUpdate) self:CloseView() end function UIWorldBossTeamEnter:OnButtonClicked(comp) if comp == self.btn_Goto then if self.bossType == LuaConst.WorldBossType.WorldBoss then CTL.WorldBoss.TryToEnterWorldBoss(self.context.BossCfgID, self.context.GRoomID, "", MDL.WorldBoss.EnterType.Call) elseif self.bossType == LuaConst.WorldBossType.WarZoneWorldBoss then CTL.CountryWorldBoss.TryToEnterWorldBoss(self.context.BossCfgID, self.context.GRoomID, "", MDL.WorldBoss.EnterType.Call) end elseif comp == self.btn_Cancel or comp == self.UICommonPopUp.btn_Close then self:CloseView() end end function UIWorldBossTeamEnter:OnValueChanged(comp, state) if comp == self.toggle_Check then CTL.WorldBoss.SetNoticeInHour(state) end end return UIWorldBossTeamEnter