local UIWorldBossHelpRemind = UIViewClass() local MAX_NUM = 99 local EffPath = ConstAssetPathConfig.EffPath1 function UIWorldBossHelpRemind:OnOpened(context) self.obj_StateSocial:SetState(1) self:RegistSystemEvent(EventID.UI_WorldBoss_RefreshHelpRemind, self.OnRefresh) self:RegistSystemEvent(EventID.UI_WorldBoss_CloseHelpRemind, self.CloseView) local time = self:UpdateInfo() self:StartRepeatFunc(self.OnUpdateFun, time) self.eff_Title:PlayUIEffect(EffPath, -1) end function UIWorldBossHelpRemind:OnRefresh() self:StopRepeatFunc(self.OnUpdateFun) local time = self:UpdateInfo() self:StartRepeatFunc(self.OnUpdateFun, time) end function UIWorldBossHelpRemind:OnUpdateFun(deltaTime, timeSinceUpdate) self:StopRepeatFunc(self.OnUpdateFun) self:IgnoreAll() end function UIWorldBossHelpRemind:IgnoreAll() MDL.WorldBoss.ClearAllSeekHelp() self:CloseView() end function UIWorldBossHelpRemind:UpdateInfo() local seekHelpList = MDL.WorldBoss.GetSeekHelpList() local info = seekHelpList[1] UIUtils.SetLabel(self.txt_EnemyName, info.playerName) self.bossConfig = DataSheetManager.WorldBoss:GetDataByID(info.bossCfgId) self.bossType = self.bossConfig.BossType if self.bossType == LuaConst.WorldBossType.WorldBoss then UIUtils.SetLabelText(self.txt_Activity, Const_IDS.IDS_ActivityName_WorldBoss) elseif self.bossType == LuaConst.WorldBossType.WarZoneWorldBoss then UIUtils.SetLabelText(self.txt_Activity, Const_IDS.IDS_ActivityName_WarZoneBoss) end CTL.Character.SetPortraitAndFrame(self.UIHeroHeadTempate, info.portraitId, info.frameId) local offset = info.closeTime - UTL.Time.GetServerTimestamp() local num = #seekHelpList if num > 1 then UIUtils.SetActive(self.img_Number, true) UIUtils.SetLabel(self.txt_Number, math.min(num, MAX_NUM)) self.txt_Confirm:ResetAndBeginCustomTimer(false, offset, 0, UIUtils.GetLocalizedTxt(Const_IDS.IDS_WarChannel_CheckBtn), 1) else UIUtils.SetActive(self.img_Number, false) self.txt_Confirm:ResetAndBeginCustomTimer(false, offset, 0, UIUtils.GetLocalizedTxt(Const_IDS.IDS_WorldBoss_Go), 1) end return offset end function UIWorldBossHelpRemind:OnButtonClicked(comp) if comp == self.btn_Confirm then local seekHelpList = MDL.WorldBoss.GetSeekHelpList() if #seekHelpList > 1 then -- 打开动态列表 UIManager.OpenView(Const_UI_Lua.UIEnum.UIDynamicMessages) else --只有一个,直接前往 local data = seekHelpList[1] MDL.WorldBoss.SendGotoHelpMsg(data.bossCfgId, data.GRoomID, data.acid) end self:CloseView() elseif comp == self.btn_Close then --点击关闭,告知下服务器埋点 MDL.WorldBoss.C2GRecordWorldBossHelpClose() self:IgnoreAll() end end function UIWorldBossHelpRemind:OnClosed() CTL.WorldBoss.ShowHelpRemind(false) self.context.parentView:OnSubViewClosed(self.context.dynamicType) end return UIWorldBossHelpRemind