结束修改
parent
fac4b21c6b
commit
c62a293740
|
@ -43,12 +43,16 @@ end
|
|||
|
||||
--添加事件监听(用于子类重写)
|
||||
function ActivityMainPanel:AddListener()
|
||||
Game.GlobalEvent:AddEvent(GameEvent.Activity.OnActivityOpenOrClose, this.OnShow)
|
||||
Game.GlobalEvent:AddEvent(GameEvent.Activity.OnActivityOpenOrClose, function()
|
||||
this:OnOpen(this.activityType,_CurPageIndex)
|
||||
end)
|
||||
end
|
||||
|
||||
--移除事件监听(用于子类重写)
|
||||
function ActivityMainPanel:RemoveListener()
|
||||
Game.GlobalEvent:RemoveEvent(GameEvent.Activity.OnActivityOpenOrClose, this.OnShow)
|
||||
Game.GlobalEvent:RemoveEvent(GameEvent.Activity.OnActivityOpenOrClose, function()
|
||||
this:OnOpen(this.activityType,_CurPageIndex)
|
||||
end)
|
||||
end
|
||||
|
||||
function ActivityMainPanel:CheckActOpen(_index)
|
||||
|
@ -88,27 +92,14 @@ end
|
|||
|
||||
--界面打开时调用(用于子类重写)
|
||||
function ActivityMainPanel:OnOpen(_activityType,_index)
|
||||
LogGreen("this.activityType:"..tostring(this.activityType).." _index:"..tostring(_index))
|
||||
this.activityType = _activityType
|
||||
DynamicActivityManager.curActivityType = this.activityType
|
||||
tabs = DynamicActivityManager.GetActivityTableDataByPageInde(this.activityType)
|
||||
-- _CurPageIndex = 0
|
||||
-- if _index and _index > 0 then
|
||||
-- self:CheckActOpen(_index)
|
||||
-- end
|
||||
-- for index = 1, #tabs do
|
||||
-- if _CurPageIndex < 1 then
|
||||
-- self:CheckActOpen(index)
|
||||
-- else
|
||||
-- break
|
||||
-- end
|
||||
-- end
|
||||
_CurPageIndex = _index or 0
|
||||
end
|
||||
|
||||
-- 打开,重新打开时回调
|
||||
function ActivityMainPanel:OnShow()
|
||||
if _CurPageIndex and _CurPageIndex > 0 then
|
||||
self:CheckActOpen(_CurPageIndex)
|
||||
_CurPageIndex = 0
|
||||
LogGreen("_index:"..tostring(_index))
|
||||
if _index and _index > 0 then
|
||||
self:CheckActOpen(_index)
|
||||
end
|
||||
for index = 1, #tabs do
|
||||
if _CurPageIndex < 1 then
|
||||
|
@ -117,7 +108,7 @@ function ActivityMainPanel:OnShow()
|
|||
break
|
||||
end
|
||||
end
|
||||
if _CurPageIndex == 0 then
|
||||
if _CurPageIndex < 1 then
|
||||
DynamicActivityManager.RemoveUIList()
|
||||
if #DynamicActivityManager.OpenUIList > 0 then
|
||||
JumpManager.GoJump(DynamicActivityManager.OpenUIList[#DynamicActivityManager.OpenUIList],function()
|
||||
|
@ -127,6 +118,11 @@ function ActivityMainPanel:OnShow()
|
|||
this:ClosePanel()
|
||||
end
|
||||
end
|
||||
LogGreen("_CurPageIndex:".._CurPageIndex)
|
||||
end
|
||||
|
||||
-- 打开,重新打开时回调
|
||||
function ActivityMainPanel:OnShow()
|
||||
orginLayer = self.sortingOrder
|
||||
if _CurPageIndex and (_CurPageIndex > #tabs or _CurPageIndex < 1) then
|
||||
_CurPageIndex = #tabs
|
||||
|
|
Loading…
Reference in New Issue