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