开服狂欢不可完成奖励修改,日常任务弹活动关闭异常
parent
e5b42a0840
commit
b7cd64f977
|
@ -144,7 +144,7 @@ this.UpdateCarbonContent = function(...)
|
||||||
Util.GetGameObject(go, "redPoint").gameObject:SetActive(false)
|
Util.GetGameObject(go, "redPoint").gameObject:SetActive(false)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
Util.SetGray(go,not state)
|
Util.SetGray(go, not state)
|
||||||
Util.AddOnceClick(go ,function()
|
Util.AddOnceClick(go ,function()
|
||||||
if state then
|
if state then
|
||||||
UIManager.OpenPanel(UIName.XuanYuanMirrorPanelList,k)
|
UIManager.OpenPanel(UIName.XuanYuanMirrorPanelList,k)
|
||||||
|
|
|
@ -59,21 +59,24 @@ end
|
||||||
function this:AddListener()
|
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)
|
Game.GlobalEvent:AddEvent(GameEvent.MoneyPay.OnPayResultSuccess, this.refresh)
|
||||||
end
|
end
|
||||||
|
|
||||||
function this:RemoveListener()
|
function this:RemoveListener()
|
||||||
Game.GlobalEvent:RemoveEvent(GameEvent.TreasureOfHeaven.BuyQinglongSerectLevelSuccess, this.refresh)
|
Game.GlobalEvent:RemoveEvent(GameEvent.TreasureOfHeaven.BuyQinglongSerectLevelSuccess, this.refresh)
|
||||||
Game.GlobalEvent:RemoveEvent(GameEvent.TreasureOfHeaven.RechargeQinglongSerectSuccess, this.refresh)
|
Game.GlobalEvent:RemoveEvent(GameEvent.TreasureOfHeaven.RechargeQinglongSerectSuccess, this.refresh)
|
||||||
Game.GlobalEvent:RemoveEvent(GameEvent.Activity.OnActivityOpenOrClose,this.CloseFunction)
|
Game.GlobalEvent:RemoveEvent(GameEvent.Activity.OnActivityOpenOrClose,this.Closefunction)
|
||||||
Game.GlobalEvent:RemoveEvent(GameEvent.MoneyPay.OnPayResultSuccess, this.refresh)
|
Game.GlobalEvent:RemoveEvent(GameEvent.MoneyPay.OnPayResultSuccess, this.refresh)
|
||||||
end
|
end
|
||||||
this.Closefunction = function()
|
this.Closefunction = function()
|
||||||
Timer.New(function()
|
Timer.New(function()
|
||||||
if not ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.TreasureOfSomeBody) then
|
if not ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.TreasureOfSomeBody) then
|
||||||
|
LogBlue("1111111")
|
||||||
PopupTipPanel.ShowTip(Language[12320])
|
PopupTipPanel.ShowTip(Language[12320])
|
||||||
parent:ClosePanel()
|
if parent then
|
||||||
|
parent:ClosePanel()
|
||||||
|
end
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
this.refresh()
|
this.refresh()
|
||||||
|
@ -83,7 +86,7 @@ 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
|
if not ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.TreasureOfSomeBody) then
|
||||||
parent:ClosePanel()
|
parent:ClosePanel()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
@ -121,7 +124,7 @@ end
|
||||||
--topBar按钮状态
|
--topBar按钮状态
|
||||||
function this:topBar()
|
function this:topBar()
|
||||||
--设置礼包购买按钮状态
|
--设置礼包购买按钮状态
|
||||||
treasureState = QinglongSerectTreasureManager.GetTreasureState()--秘宝礼包状态 0:可购买 1:已购买
|
treasureState = QinglongSerectTreasureManager.GetTreasureState()--秘宝礼包状态 false:可购买 true:已购买
|
||||||
curScore = QinglongSerectTreasureManager.GetScore()
|
curScore = QinglongSerectTreasureManager.GetScore()
|
||||||
local lv = QinglongSerectTreasureManager.GetLevel()
|
local lv = QinglongSerectTreasureManager.GetLevel()
|
||||||
this.lv.text = lv
|
this.lv.text = lv
|
||||||
|
@ -151,17 +154,17 @@ function this:topBar()
|
||||||
this.buyBtn:GetComponent("Button").enabled = false
|
this.buyBtn:GetComponent("Button").enabled = false
|
||||||
this.buyBtnText.text = Language[12351]
|
this.buyBtnText.text = Language[12351]
|
||||||
end
|
end
|
||||||
this.jiesuoBtn:GetComponent("Button").enabled = (treasureState == 0)
|
this.jiesuoBtn:GetComponent("Button").enabled = (not treasureState)
|
||||||
this.jiesuoBtnText.text = ((treasureState == 0) and Language[12352] or Language[12353])
|
this.jiesuoBtnText.text = ((not treasureState) and Language[12352] or Language[12353])
|
||||||
Util.AddOnceClick(this.jiesuoBtn,function()
|
Util.AddOnceClick(this.jiesuoBtn,function()
|
||||||
UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.HeavenUnlockExtraRewardPanel,2)
|
UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.HeavenUnlockExtraRewardPanel,2)
|
||||||
end)
|
end)
|
||||||
local times = PrivilegeManager.GetPrivilegeRemainValue(1007)
|
local times = PrivilegeManager.GetPrivilegeRemainValue(1007)
|
||||||
this.box :GetComponent("Image").enabled = (treasureState == 0)
|
this.box :GetComponent("Image").enabled = (not treasureState)
|
||||||
this.extra:GetComponent("Button").enabled = ((not (treasureState == 0)) and (times > 0))
|
this.extra:GetComponent("Button").enabled = ((treasureState) and (times > 0))
|
||||||
this.canOpenExtra.gameObject:SetActive((not (treasureState == 0)) and (times > 0))
|
this.canOpenExtra.gameObject:SetActive((treasureState) and (times > 0))
|
||||||
this.openExtra:GetComponent("Animator").enabled = false
|
this.openExtra:GetComponent("Animator").enabled = false
|
||||||
this.openExtra.gameObject:SetActive((not (treasureState == 0)) and (times <= 0))
|
this.openExtra.gameObject:SetActive((treasureState) and (times <= 0))
|
||||||
Util.GetGameObject(this.openExtra,"MeiKaiQi"):SetActive(false)
|
Util.GetGameObject(this.openExtra,"MeiKaiQi"):SetActive(false)
|
||||||
Util.GetGameObject(this.openExtra,"KaiQi"):SetActive(true)
|
Util.GetGameObject(this.openExtra,"KaiQi"):SetActive(true)
|
||||||
Util.AddOnceClick(this.extra,function()
|
Util.AddOnceClick(this.extra,function()
|
||||||
|
@ -191,25 +194,35 @@ function this:showTaskList()
|
||||||
this.ScrollView:SetData(rewardData,function(index, rewardItem)
|
this.ScrollView:SetData(rewardData,function(index, rewardItem)
|
||||||
this:SingleTask(rewardItem, rewardData[index])
|
this:SingleTask(rewardItem, rewardData[index])
|
||||||
end)
|
end)
|
||||||
|
local index = 0
|
||||||
-- --定位打开界面时位置
|
if QinglongSerectTreasureManager.GetLevel() == 1 then
|
||||||
-- local t = 0
|
index = 1
|
||||||
-- if treasureState == 0 then
|
else
|
||||||
-- for i = 1, #rewardStateData do
|
for k,v in ipairs(rewardData) do
|
||||||
-- if rewardStateData[i].state == 0 then
|
if v.state == 1 and treasureState then
|
||||||
-- t = i
|
index = k
|
||||||
-- break
|
break
|
||||||
-- end
|
elseif v.state == 0 and treasureState then
|
||||||
-- end
|
index = k
|
||||||
-- elseif treasureState == 1 then
|
break
|
||||||
-- for i = 1, #rewardStateData do
|
elseif v.state == 0 and (not treasureState) and (k < 35) then
|
||||||
-- if rewardStateData[i].state == 1 or rewardStateData[i].state == 0 then
|
index = k
|
||||||
-- t = i
|
break
|
||||||
-- breakPopupTipPanel
|
elseif v.state == 0 and (not treasureState) and (k >= 35) then
|
||||||
-- end
|
index = 35
|
||||||
-- end
|
break
|
||||||
-- end
|
end
|
||||||
--this.ScrollView:SetIndex(t-2)
|
end
|
||||||
|
if index == 0 then
|
||||||
|
for i = #rewardData , 1 , -1 do
|
||||||
|
if (rewardData[i].state == -1) or (rewardData[i].state == 1 and not treasureState) then
|
||||||
|
index = i
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
this.ScrollView:SetIndex(index)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -239,7 +252,7 @@ function this:SingleTask(rewardItem, rewardSingleData)
|
||||||
else
|
else
|
||||||
itemsList[rewardItem][i].gameObject.transform:SetParent(box2.transform)
|
itemsList[rewardItem][i].gameObject.transform:SetParent(box2.transform)
|
||||||
end
|
end
|
||||||
itemsList[rewardItem][i].gameObject:GetComponent("RectTransform").localPosition = Vector3.zero
|
itemsList[rewardItem][i].gameObject:GetComponent("RectTransform").localPosition = Vector3.zero
|
||||||
itemsList[rewardItem][i].gameObject:SetActive(true)
|
itemsList[rewardItem][i].gameObject:SetActive(true)
|
||||||
itemsList[rewardItem][i]:OnOpen(false, rewardSingleData.Reward[i].item, 0.8, false)
|
itemsList[rewardItem][i]:OnOpen(false, rewardSingleData.Reward[i].item, 0.8, false)
|
||||||
else
|
else
|
||||||
|
@ -267,7 +280,7 @@ function this:InitButtonState(rewardItem, rewardSingleData)
|
||||||
--当前任务领取情况
|
--当前任务领取情况
|
||||||
local state = rewardSingleData.state
|
local state = rewardSingleData.state
|
||||||
Util.GetGameObject(get.gameObject, "Image"):SetActive(state == -1)
|
Util.GetGameObject(get.gameObject, "Image"):SetActive(state == -1)
|
||||||
redPoint:SetActive(state == 0 or (state == 1 and treasureState > 0))
|
redPoint:SetActive(state == 0 or (state == 1 and treasureState))
|
||||||
get.sprite = Util.LoadSprite(type[state].sprite)
|
get.sprite = Util.LoadSprite(type[state].sprite)
|
||||||
get.enabled = true
|
get.enabled = true
|
||||||
text.text = type[state].text
|
text.text = type[state].text
|
||||||
|
@ -286,20 +299,20 @@ end
|
||||||
function this:OnBtnDealClicked(rewardItem,rewardSingleData)
|
function this:OnBtnDealClicked(rewardItem,rewardSingleData)
|
||||||
if rewardSingleData.state ~= -2 then--分数达到要求
|
if rewardSingleData.state ~= -2 then--分数达到要求
|
||||||
if (rewardSingleData.state == 0) or--任务未领取
|
if (rewardSingleData.state == 0) or--任务未领取
|
||||||
(rewardSingleData.state == 1 and treasureState > 0) then--任务未领取+礼包已购买
|
(rewardSingleData.state == 1 and treasureState) then--任务未领取+礼包已购买
|
||||||
local id = ActivityGiftManager.GetActivityIdByType(ActivityTypeDef.TreasureOfSomeBody)
|
local id = ActivityGiftManager.GetActivityIdByType(ActivityTypeDef.TreasureOfSomeBody)
|
||||||
LogBlue("activityId:"..id)
|
LogBlue("activityId:"..id)
|
||||||
NetManager.GetActivityRewardRequest(rewardSingleData.level,id,function(msg)
|
NetManager.GetActivityRewardRequest(rewardSingleData.level,id,function(msg)
|
||||||
UIManager.OpenPanel(UIName.RewardItemPopup,msg,1)
|
UIManager.OpenPanel(UIName.RewardItemPopup,msg,1)
|
||||||
--需要刷新界面
|
--需要刷新界面
|
||||||
if treasureState == 0 then--判断是否已经购买了礼包
|
if not treasureState then--判断是否已经购买了礼包
|
||||||
QinglongSerectTreasureManager.SetSingleRewardState(rewardSingleData.level,1)
|
QinglongSerectTreasureManager.SetSingleRewardState(rewardSingleData.level,1)
|
||||||
else
|
else
|
||||||
QinglongSerectTreasureManager.SetSingleRewardState(rewardSingleData.level,-1)
|
QinglongSerectTreasureManager.SetSingleRewardState(rewardSingleData.level,-1)
|
||||||
end
|
end
|
||||||
this.refresh()--刷新界面
|
this.refresh()--刷新界面
|
||||||
end)
|
end)
|
||||||
elseif rewardSingleData.state == 1 and treasureState == 0 then----任务已领取+礼包未购买(弹出购买界面)
|
elseif rewardSingleData.state == 1 and (not treasureState) then----任务已领取+礼包未购买(弹出购买界面)
|
||||||
UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.HeavenUnlockExtraRewardPanel,2)
|
UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.HeavenUnlockExtraRewardPanel,2)
|
||||||
end
|
end
|
||||||
else--分数未达到要求
|
else--分数未达到要求
|
||||||
|
@ -316,9 +329,9 @@ function this:ShowTime(endtime)
|
||||||
this.remainTime.text = Language[12321]..TimeToDHMS(timeDown)
|
this.remainTime.text = Language[12321]..TimeToDHMS(timeDown)
|
||||||
self.timer = Timer.New(function()
|
self.timer = Timer.New(function()
|
||||||
if timeDown < 1 then
|
if timeDown < 1 then
|
||||||
|
this.remainTime.text = Language[12321]..TimeToDHMS(0)
|
||||||
self.timer:Stop()
|
self.timer:Stop()
|
||||||
self.timer = nil
|
self.timer = nil
|
||||||
this.Closefunction()
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
timeDown = timeDown - 1
|
timeDown = timeDown - 1
|
||||||
|
|
|
@ -75,7 +75,6 @@ function this:RemoveListener()
|
||||||
Game.GlobalEvent:RemoveEvent(GameEvent.TreasureOfHeaven.RechargeQinglongSerectSuccess, this.refresh,curType)
|
Game.GlobalEvent:RemoveEvent(GameEvent.TreasureOfHeaven.RechargeQinglongSerectSuccess, this.refresh,curType)
|
||||||
Game.GlobalEvent:RemoveEvent(GameEvent.TreasureOfHeaven.TaskRefresh, this.RefreshTime)
|
Game.GlobalEvent:RemoveEvent(GameEvent.TreasureOfHeaven.TaskRefresh, this.RefreshTime)
|
||||||
Game.GlobalEvent:RemoveEvent(GameEvent.Activity.OnActivityOpenOrClosen,this.CloseFunction)
|
Game.GlobalEvent:RemoveEvent(GameEvent.Activity.OnActivityOpenOrClosen,this.CloseFunction)
|
||||||
|
|
||||||
Game.GlobalEvent:RemoveEvent(GameEvent.MoneyPay.OnPayResultSuccess, this.refresh,curType)
|
Game.GlobalEvent:RemoveEvent(GameEvent.MoneyPay.OnPayResultSuccess, this.refresh,curType)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -85,14 +84,17 @@ function this.RefreshTime()
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
this.Closefunction = function()
|
this.CloseFunction = function()
|
||||||
Timer.New(function()
|
Timer.New(function()
|
||||||
if not ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.TreasureOfSomeBody) then
|
if not ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.TreasureOfSomeBody) then
|
||||||
|
LogBlue("22222222222")
|
||||||
PopupTipPanel.ShowTip(Language[12320])
|
PopupTipPanel.ShowTip(Language[12320])
|
||||||
parent:ClosePanel()
|
if parent then
|
||||||
|
parent:ClosePanel()
|
||||||
|
end
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
this.refresh(curType)
|
this.RefreshTime()
|
||||||
end
|
end
|
||||||
end,1):Start()
|
end,1):Start()
|
||||||
end
|
end
|
||||||
|
@ -100,7 +102,7 @@ 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
|
if not ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.TreasureOfSomeBody) then
|
||||||
parent:ClosePanel()
|
parent:ClosePanel()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
@ -110,17 +112,17 @@ end
|
||||||
--topBar按钮状态
|
--topBar按钮状态
|
||||||
function this:SetTopBar()
|
function this:SetTopBar()
|
||||||
treasureState = QinglongSerectTreasureManager.GetTreasureState()--秘宝礼包状态 0:可购买 1:已购买
|
treasureState = QinglongSerectTreasureManager.GetTreasureState()--秘宝礼包状态 0:可购买 1:已购买
|
||||||
this.jiesuoBtn:GetComponent("Button").enabled = (treasureState == 0)
|
this.jiesuoBtn:GetComponent("Button").enabled = (not treasureState)
|
||||||
this.jiesuoBtnText.text = ((treasureState == 0) and Language[12352] or Language[12353])
|
this.jiesuoBtnText.text = ((not treasureState) and Language[12352] or Language[12353])
|
||||||
Util.AddOnceClick(this.jiesuoBtn,function()
|
Util.AddOnceClick(this.jiesuoBtn,function()
|
||||||
UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.HeavenUnlockExtraRewardPanel,2)
|
UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.HeavenUnlockExtraRewardPanel,2)
|
||||||
end)
|
end)
|
||||||
local times = PrivilegeManager.GetPrivilegeRemainValue(1007)
|
local times = PrivilegeManager.GetPrivilegeRemainValue(1007)
|
||||||
this.box:GetComponent("Image").enabled = (treasureState == 0)
|
this.box:GetComponent("Image").enabled = (not treasureState)
|
||||||
this.extra:GetComponent("Button").enabled = ((not (treasureState == 0)) and (times > 0))
|
this.extra:GetComponent("Button").enabled = (treasureState and (times > 0))
|
||||||
this.canOpenExtra.gameObject:SetActive((not (treasureState == 0)) and (times > 0))
|
this.canOpenExtra.gameObject:SetActive(treasureState and (times > 0))
|
||||||
this.openExtra:GetComponent("Animator").enabled = false
|
this.openExtra:GetComponent("Animator").enabled = false
|
||||||
this.openExtra.gameObject:SetActive((not (treasureState == 0)) and (times <= 0))
|
this.openExtra.gameObject:SetActive(treasureState and (times <= 0))
|
||||||
Util.GetGameObject(this.openExtra,"MeiKaiQi"):SetActive(false)
|
Util.GetGameObject(this.openExtra,"MeiKaiQi"):SetActive(false)
|
||||||
Util.GetGameObject(this.openExtra,"KaiQi"):SetActive(true)
|
Util.GetGameObject(this.openExtra,"KaiQi"):SetActive(true)
|
||||||
Util.AddOnceClick(this.extra,function()
|
Util.AddOnceClick(this.extra,function()
|
||||||
|
@ -201,7 +203,7 @@ local type={
|
||||||
}
|
}
|
||||||
--单个任务
|
--单个任务
|
||||||
function this:SingleTask(go, rewardSingleData)
|
function this:SingleTask(go, rewardSingleData)
|
||||||
local activityRewardGo = go
|
local activityRewardGo = go
|
||||||
activityRewardGo:SetActive(true)
|
activityRewardGo:SetActive(true)
|
||||||
local sConFigData = rewardSingleData
|
local sConFigData = rewardSingleData
|
||||||
local strs = string.split(sConFigData.show)
|
local strs = string.split(sConFigData.show)
|
||||||
|
@ -247,14 +249,13 @@ function this:ShowTime(curType)
|
||||||
this.remainTime.text = Language[12321]..TimeToDHMS(timeDown)
|
this.remainTime.text = Language[12321]..TimeToDHMS(timeDown)
|
||||||
self.timer = Timer.New(function()
|
self.timer = Timer.New(function()
|
||||||
if timeDown < 1 then
|
if timeDown < 1 then
|
||||||
|
this.remainTime.text = Language[12321]..TimeToDHMS(0)
|
||||||
self.timer:Stop()
|
self.timer:Stop()
|
||||||
self.timer = nil
|
self.timer = nil
|
||||||
this.RefreshTime()
|
this.RefreshTime()
|
||||||
if ActivityGiftManager.GetTaskEndTime(ActivityTypeDef.TreasureOfSomeBody) - GetTimeStamp() < 1 then
|
return
|
||||||
this.Closefunction()
|
|
||||||
end
|
|
||||||
return
|
|
||||||
end
|
end
|
||||||
|
|
||||||
timeDown = timeDown - 1
|
timeDown = timeDown - 1
|
||||||
this.remainTime.text = Language[12321]..TimeToDHMS(timeDown)
|
this.remainTime.text = Language[12321]..TimeToDHMS(timeDown)
|
||||||
end, 1, -1, true)
|
end, 1, -1, true)
|
||||||
|
|
|
@ -8,6 +8,8 @@ this.scoreId = 0
|
||||||
this.score = 0
|
this.score = 0
|
||||||
this.traiWeekTime = 0
|
this.traiWeekTime = 0
|
||||||
this.level = 0
|
this.level = 0
|
||||||
|
this.hadBuyTreasure = false
|
||||||
|
|
||||||
function this.Initialize()
|
function this.Initialize()
|
||||||
this.InitializeData()
|
this.InitializeData()
|
||||||
end
|
end
|
||||||
|
@ -92,7 +94,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 (not this.GetTreasureState()) 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
|
||||||
|
@ -130,8 +132,7 @@ function this.GetTimeShow(data)
|
||||||
end
|
end
|
||||||
|
|
||||||
function this.GetTreasureState()
|
function this.GetTreasureState()
|
||||||
this.TreasrueState = OperatingManager.GetGoodsBuyTime(GoodsTypeDef.FindBaby,5001)
|
return this.hadBuyTreasure
|
||||||
return this.TreasrueState
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function this.GetScore()
|
function this.GetScore()
|
||||||
|
@ -169,7 +170,9 @@ end
|
||||||
function this.SetLevel(_level)
|
function this.SetLevel(_level)
|
||||||
this.level = _level
|
this.level = _level
|
||||||
end
|
end
|
||||||
|
function this.SetTreasureBuyStatus(hadBuy)
|
||||||
|
this.hadBuyTreasure = (hadBuy == 1)
|
||||||
|
end
|
||||||
function this.GetLevel()
|
function this.GetLevel()
|
||||||
if not ActivityGiftManager.GetActivityOpenStatus(ActivityTypeDef.TreasureOfSomeBody) then
|
if not ActivityGiftManager.GetActivityOpenStatus(ActivityTypeDef.TreasureOfSomeBody) then
|
||||||
return 0
|
return 0
|
||||||
|
@ -210,7 +213,7 @@ function this.GetQinglongSerectTreasureRedPot()
|
||||||
local activityId = ActivityGiftManager.GetActivityIdByType(ActivityTypeDef.TreasureOfSomeBody)
|
local activityId = ActivityGiftManager.GetActivityIdByType(ActivityTypeDef.TreasureOfSomeBody)
|
||||||
for i, v in pairs(this.rewardData[activityId]) do
|
for i, v in pairs(this.rewardData[activityId]) do
|
||||||
if i ~= 0 then
|
if i ~= 0 then
|
||||||
if v.state == 0 or (v.state == 1 and state > 0) then
|
if v.state == 0 or (v.state == 1 and state) then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -457,16 +457,27 @@ function this.SingleItemDataShow(go, data)
|
||||||
--Util.GetGameObject(go, "current/redPoint"):SetActive(curServerTask.state == 1)
|
--Util.GetGameObject(go, "current/redPoint"):SetActive(curServerTask.state == 1)
|
||||||
Util.GetGameObject(go, "current/finished"):SetActive(curServerTask.state == 2)
|
Util.GetGameObject(go, "current/finished"):SetActive(curServerTask.state == 2)
|
||||||
Util.GetGameObject(go, "current/buyBtn"):SetActive(false)
|
Util.GetGameObject(go, "current/buyBtn"):SetActive(false)
|
||||||
jumpBtn:SetActive(curServerTask.state == 0)
|
|
||||||
Util.GetGameObject(go, "current/progress"):SetActive(not curServerTask.state == 2)
|
Util.GetGameObject(go, "current/progress"):SetActive(not curServerTask.state == 2)
|
||||||
Util.AddOnceClick(dealBtn, function()
|
Util.AddOnceClick(dealBtn, function()
|
||||||
NetManager.TakeMissionRewardRequest(TaskTypeDef.SevenDayCarnival, curServerTask.missionId, function(respond)
|
NetManager.TakeMissionRewardRequest(TaskTypeDef.SevenDayCarnival, curServerTask.missionId, function(respond)
|
||||||
UIManager.OpenPanel(UIName.RewardItemPopup, respond.drop, 1)
|
UIManager.OpenPanel(UIName.RewardItemPopup, respond.drop, 1)
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
Util.AddOnceClick(jumpBtn, function()
|
-- 判断是否需要跳转
|
||||||
JumpManager.GoJump(data.Jump[1])
|
if curServerTask.state == 0 then
|
||||||
end)
|
jumpBtn:SetActive(true)
|
||||||
|
local isJump = data.Jump and data.Jump[1] and data.Jump[1] ~= 0
|
||||||
|
local btnText = Util.GetGameObject(jumpBtn, "Text"):GetComponent("Text")
|
||||||
|
btnText.text = isJump and Language[10023] or Language[10366]
|
||||||
|
Util.SetGray(jumpBtn, not isJump)
|
||||||
|
Util.AddOnceClick(jumpBtn, function()
|
||||||
|
if isJump then
|
||||||
|
JumpManager.GoJump(data.Jump[1])
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
else
|
||||||
|
jumpBtn:SetActive(false)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
--界面关闭时调用(用于子类重写)
|
--界面关闭时调用(用于子类重写)
|
||||||
function SevenDayCarnivalPanelV2:OnClose()
|
function SevenDayCarnivalPanelV2:OnClose()
|
||||||
|
|
Loading…
Reference in New Issue