qinglong commit
parent
4fd97151a5
commit
f62a007edb
|
@ -76,15 +76,18 @@ function MissionDailyPanel:OnOpen(popupType,...)
|
|||
end
|
||||
if not index then
|
||||
index = 1
|
||||
type = 0
|
||||
if RedPointManager.GetRedPointMissionDaily() then
|
||||
index = 1
|
||||
type = 0
|
||||
elseif QinglongSerectTreasureManager.GetQinglongSerectTreasureRedPot() then
|
||||
elseif ActivityGiftManager.GetActivityOpenStatus(ActivityTypeDef.TreasureOfSomeBody) then
|
||||
if QinglongSerectTreasureManager.GetQinglongSerectTreasureRedPot() then
|
||||
index = 2
|
||||
type = 1
|
||||
elseif QinglongSerectTreasureManager.GetSerectTreasureTrailRedPot() then
|
||||
index = 3
|
||||
type = 1
|
||||
end
|
||||
elseif TaskManager.GetAchievementState() then
|
||||
index = 4
|
||||
type = 0
|
||||
|
@ -93,12 +96,9 @@ function MissionDailyPanel:OnOpen(popupType,...)
|
|||
for i=1,#contentPrefabs do
|
||||
contentPrefabs[i].gameObject:SetActive(false)
|
||||
end
|
||||
LogGreen("index:"..index.." type:"..type)
|
||||
if index ~=1 and type == 0 then
|
||||
if ActivityGiftManager.GetActivityOpenStatus(ActivityTypeDef.TreasureOfSomeBody) then
|
||||
index = 4
|
||||
else
|
||||
index = 2
|
||||
end
|
||||
end
|
||||
contentPrefabs[index].gameObject:SetActive(true)
|
||||
contentScripts[index].view:OnShow(this,...)--1、传入自己 2、传入不定参
|
||||
|
|
|
@ -60,19 +60,20 @@ function this:AddListener()
|
|||
Game.GlobalEvent:AddEvent(GameEvent.TreasureOfHeaven.BuyQinglongSerectLevelSuccess, this.refresh)
|
||||
Game.GlobalEvent:AddEvent(GameEvent.TreasureOfHeaven.RechargeQinglongSerectSuccess, this.refresh)
|
||||
Game.GlobalEvent:AddEvent(GameEvent.Activity.OnActivityOpenOrClose,this.CloseFunction)
|
||||
Game.GlobalEvent:AddEvent(GameEvent.MoneyPay.OnPayResultSuccess, this.refresh)
|
||||
end
|
||||
|
||||
function this:RemoveListener()
|
||||
Game.GlobalEvent:RemoveEvent(GameEvent.TreasureOfHeaven.BuyQinglongSerectLevelSuccess)
|
||||
Game.GlobalEvent:RemoveEvent(GameEvent.TreasureOfHeaven.RechargeQinglongSerectSuccess)
|
||||
Game.GlobalEvent:RemoveEvent(GameEvent.Activity.OnActivityOpenOrClose)
|
||||
Game.GlobalEvent:RemoveEvent(GameEvent.MoneyPay.OnPayResultSuccess)
|
||||
end
|
||||
this.Closefunction = function()
|
||||
Timer.New(function()
|
||||
if not ActivityGiftManager.GetActivityOpenStatus(ActivityTypeDef.TreasureOfSomeBody) then
|
||||
PopupTipPanel.ShowTip(Language[12320])
|
||||
parent:ClosePanel()
|
||||
|
||||
return
|
||||
else
|
||||
this.refresh()
|
||||
|
@ -82,7 +83,10 @@ end
|
|||
function this:OnShow(_parent,...)
|
||||
parent=_parent
|
||||
sortingOrder = _parent.sortingOrder
|
||||
|
||||
if not ActivityGiftManager.GetActivityOpenStatus(ActivityTypeDef.TreasureOfSomeBody) then
|
||||
parent:ClosePanel()
|
||||
return
|
||||
end
|
||||
this.tips.text = Language[12350]
|
||||
local startTime,endTime,endTimeScale = QinglongSerectTreasureManager.GetTimeStartToEnd()
|
||||
this.time.text = Language[10546]..startTime.."-"..endTime
|
||||
|
@ -108,6 +112,7 @@ function this:OnDestroy()
|
|||
end
|
||||
|
||||
this.refresh = function()
|
||||
QinglongSerectTreasureManager.UpdateTreasureState2()
|
||||
this:topBar()
|
||||
this:showTaskList()
|
||||
CheckRedPointStatus(RedPointType.QinglongSerectTreasure)
|
||||
|
|
|
@ -67,12 +67,14 @@ function this:AddListener()
|
|||
Game.GlobalEvent:AddEvent(GameEvent.TreasureOfHeaven.RechargeQinglongSerectSuccess, this.refresh,curType)
|
||||
Game.GlobalEvent:AddEvent(GameEvent.TreasureOfHeaven.TaskRefresh, this.refresh,curType)
|
||||
Game.GlobalEvent:AddEvent(GameEvent.Activity.OnActivityOpenOrClose,this.CloseFunction)
|
||||
Game.GlobalEvent:AddEvent(GameEvent.MoneyPay.OnPayResultSuccess, this.refresh)
|
||||
end
|
||||
|
||||
function this:RemoveListener()
|
||||
Game.GlobalEvent:RemoveEvent(GameEvent.TreasureOfHeaven.RechargeQinglongSerectSuccess,this.refresh,curType)
|
||||
Game.GlobalEvent:RemoveEvent(GameEvent.TreasureOfHeaven.TaskRefresh, this.refresh,curType)
|
||||
Game.GlobalEvent:RemoveEvent(GameEvent.Activity.OnActivityOpenOrClose,this.Closefunction)
|
||||
Game.GlobalEvent:RemoveEvent(GameEvent.TreasureOfHeaven.RechargeQinglongSerectSuccess)
|
||||
Game.GlobalEvent:RemoveEvent(GameEvent.TreasureOfHeaven.TaskRefresh)
|
||||
Game.GlobalEvent:RemoveEvent(GameEvent.Activity.OnActivityOpenOrClosen)
|
||||
Game.GlobalEvent:RemoveEvent(GameEvent.MoneyPay.OnPayResultSuccess)
|
||||
end
|
||||
|
||||
this.Closefunction = function()
|
||||
|
@ -91,6 +93,10 @@ end
|
|||
function this:OnShow(_parent,...)
|
||||
parent=_parent
|
||||
sortingOrder = _parent.sortingOrder
|
||||
if not ActivityGiftManager.GetActivityOpenStatus(ActivityTypeDef.TreasureOfSomeBody) then
|
||||
parent:ClosePanel()
|
||||
return
|
||||
end
|
||||
this.refresh(curType)
|
||||
end
|
||||
|
||||
|
@ -142,7 +148,9 @@ function this:OnDestroy()
|
|||
self.timer = nil
|
||||
end
|
||||
end
|
||||
|
||||
function this.refresh(type)
|
||||
QinglongSerectTreasureManager.UpdateTreasureState2()
|
||||
this:SetTopBar()
|
||||
this:SetSelect()
|
||||
this:ShowTime(type)
|
||||
|
|
|
@ -92,7 +92,7 @@ function this.UpdateTreasureState2()
|
|||
local activityId = ActivityGiftManager.GetActivityIdByType(ActivityTypeDef.TreasureOfSomeBody)
|
||||
if this.rewardData[activityId] then
|
||||
for k,v in pairs(this.rewardData[activityId]) do
|
||||
if level < k or (level > k and this.GetTreasureState() < 1 and v.type == 1) then
|
||||
if level < k or (level >= k and this.GetTreasureState() < 1 and v.type == 1) then
|
||||
v.state = -2
|
||||
elseif v.state == -2 then
|
||||
v.state = 0
|
||||
|
@ -165,8 +165,13 @@ function this.SetLevel(_level)
|
|||
end
|
||||
|
||||
function this.GetLevel()
|
||||
if this.level > 50 then
|
||||
this.level = 50
|
||||
if not ActivityGiftManager.GetActivityOpenStatus(ActivityTypeDef.TreasureOfSomeBody) then
|
||||
return 0
|
||||
end
|
||||
local activityId = ActivityGiftManager.GetActivityIdByType(ActivityTypeDef.TreasureOfSomeBody)
|
||||
local level = this.rewardData[activityId][LengthOfTable(this.rewardData[activityId])-1].level
|
||||
if this.level > level then
|
||||
this.level = level
|
||||
end
|
||||
return this.level
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue