require("Base/BasePanel") BattleFailPopup = Inherit(BasePanel) local this = BattleFailPopup local m_battlePanel local m_showRecord = true local m_backPanel local orginLayer local fightType --初始化组件(用于子类重写) function BattleFailPopup:InitComponent() orginLayer = 0 this.btnClose = Util.GetGameObject(self.gameObject, "Lose") end --绑定事件(用于子类重写) function BattleFailPopup:BindEvent() Util.AddClick(this.btnClose, function () this.ClosePanelRefreshData() if m_battlePanel then m_battlePanel:ClosePanel() end self:ClosePanel() if m_backPanel then UIManager.OpenPanel(m_backPanel) end -- this.ClosePanelRefreshData() end) Util.AddClick(Util.GetGameObject(this.btnClose, "tip/zhaomu"), function () FightManager.curIsInFightArea = 0 this:LoseJump(1001) this.ClosePanelRefreshData() end) Util.AddClick(Util.GetGameObject(this.btnClose, "tip/chengyuan"), function () FightManager.curIsInFightArea = 0 this:LoseJump(22001) this.ClosePanelRefreshData() end) Util.AddClick(Util.GetGameObject(this.btnClose, "record"), function () UIManager.OpenPanel(UIName.DamageResultPanel, 0) --this.ClosePanelRefreshData() end) end --添加事件监听(用于子类重写) function BattleFailPopup:AddListener() end --移除事件监听(用于子类重写) function BattleFailPopup:RemoveListener() end function BattleFailPopup:OnSortingOrderChange() Util.AddParticleSortLayer(this.btnClose, self.sortingOrder - orginLayer) orginLayer = self.sortingOrder end --界面打开时调用(用于子类重写) function BattleFailPopup:OnOpen(battlePanel, showRecord, backPanel,_fightType) if battlePanel then m_battlePanel = battlePanel end m_showRecord = true -- 默认显示 if showRecord == false then m_showRecord = showRecord end m_backPanel = nil if backPanel then m_backPanel = backPanel end if _fightType then fightType = _fightType end FightPointPassManager.FightBattleEnd() Util.GetGameObject(this.btnClose, "record"):SetActive(m_showRecord) Util.GetGameObject(this.btnClose,"tip"):SetActive(not fightType ==12)--副本内无法点击招募 end function this:LoseJump(id) if not MapManager.Mapping then if JumpManager.CheckJump(id) then if m_battlePanel then m_battlePanel:ClosePanel() end self:ClosePanel() JumpManager.GoJumpWithoutTip(id) end else PopupTipPanel.ShowTip(Language[10250]) end end function this.ClosePanelRefreshData() if fightType then if fightType == 8 then--远征 local GetCurNodeInfo = ExpeditionManager.curAttackNodeInfo if GetCurNodeInfo.type == ExpeditionNodeType.Greed then--贪婪节点 Game.GlobalEvent:DispatchEvent(GameEvent.Expedition.RefreshMainPanel)--刷新界面 PopupTipPanel.ShowTip( Language[12194]) else MsgPanel.ShowTwo(Language[11540], function() end, function() NetManager.EndConfirmExpeditionBattleRequest(GetCurNodeInfo.sortId, function (msg) end) end,Language[10719],Language[12201]) Game.GlobalEvent:DispatchEvent(GameEvent.Expedition.RefreshMainPanel)--刷新界面 end elseif fightType == 10 then--车迟 --车迟抢夺cd计时 GuildCarDelayManager.SetCdTime(GuildCarDelayProType.Loot) end end end --界面关闭时调用(用于子类重写) function BattleFailPopup:OnClose() Game.GlobalEvent:DispatchEvent(GameEvent.Map.MaskState,0) end --界面销毁时调用(用于子类重写) function BattleFailPopup:OnDestroy() end return BattleFailPopup