【巅峰赛】尝试修改

dev_chengFeng
zhangqiang 2021-04-02 15:47:07 +08:00
parent 7bea1cf11a
commit c45d20f9da
1 changed files with 6 additions and 3 deletions

View File

@ -59,14 +59,14 @@ function ATM_MainMatchView:BindEvent()
end end
--添加事件监听(用于子类重写) --添加事件监听(用于子类重写)
function ATM_MainMatchView:AddListener() function ATM_MainMatchView:AddListener()
Game.GlobalEvent:AddEvent(GameEvent.TopMatch.OnTopMatchDataUpdate, this.OnOpen, this) Game.GlobalEvent:AddEvent(GameEvent.TopMatch.OnTopMatchDataUpdate, this.OnOpenData)
Game.GlobalEvent:AddEvent(GameEvent.ATM_RankView.OnOpenBattle, this.battleDetailBtnClick) Game.GlobalEvent:AddEvent(GameEvent.ATM_RankView.OnOpenBattle, this.battleDetailBtnClick)
end end
--移除事件监听(用于子类重写) --移除事件监听(用于子类重写)
function ATM_MainMatchView:RemoveListener() function ATM_MainMatchView:RemoveListener()
Game.GlobalEvent:RemoveEvent(GameEvent.TopMatch.OnTopMatchDataUpdate, this.OnOpen, this) Game.GlobalEvent:RemoveEvent(GameEvent.TopMatch.OnTopMatchDataUpdate, this.OnOpenData)
Game.GlobalEvent:RemoveEvent(GameEvent.ATM_RankView.OnOpenBattle, this.battleDetailBtnClick) Game.GlobalEvent:RemoveEvent(GameEvent.ATM_RankView.OnOpenBattle, this.battleDetailBtnClick)
end end
@ -75,7 +75,10 @@ function ATM_MainMatchView:OnOpen(...)
local isActive = ArenaTopMatchManager.IsTopMatchActive() local isActive = ArenaTopMatchManager.IsTopMatchActive()
this.StateChange(isActive) this.StateChange(isActive)
end end
function this.OnOpenData()
local isActive = ArenaTopMatchManager.IsTopMatchActive()
this.StateChange(isActive)
end
-- 状态切换 -- 状态切换
local isJoin = nil local isJoin = nil
local isOver = nil local isOver = nil