parent
cd30e96c7d
commit
ec7e8a6a17
|
@ -34,11 +34,13 @@ function this:InitComponent(gameObject)
|
||||||
this.remainTimeObj:SetActive(false)
|
this.remainTimeObj:SetActive(false)
|
||||||
this.remainTime = Util.GetGameObject(this.gameObject, "bg/topBar/remainTime/Text"):GetComponent("Text")
|
this.remainTime = Util.GetGameObject(this.gameObject, "bg/topBar/remainTime/Text"):GetComponent("Text")
|
||||||
this.box = Util.GetGameObject(this.gameObject, "topBar/box")
|
this.box = Util.GetGameObject(this.gameObject, "topBar/box")
|
||||||
|
this.box.gameObject:SetActive(false)
|
||||||
this.extra = Util.GetGameObject(this.gameObject, "topBar/extraBox")
|
this.extra = Util.GetGameObject(this.gameObject, "topBar/extraBox")
|
||||||
this.canOpenExtra = Util.GetGameObject(this.gameObject, "topBar/UI_Effect_BaoXiang_KeKaiQi")
|
this.canOpenExtra = Util.GetGameObject(this.gameObject, "topBar/UI_Effect_BaoXiang_KeKaiQi")
|
||||||
this.canOpenExtra.gameObject:SetActive(false)
|
this.canOpenExtra.gameObject:SetActive(false)
|
||||||
this.openExtra = Util.GetGameObject(this.gameObject, "topBar/UI_Effect_BaoXiang_KaiQi")
|
this.openExtra = Util.GetGameObject(this.gameObject, "topBar/UI_Effect_BaoXiang_KaiQi")
|
||||||
this.openExtra.gameObject:SetActive(false)
|
this.openExtra.gameObject:SetActive(false)
|
||||||
|
this.extra.gameObject:SetActive(false)
|
||||||
this.btn_qmfl = Util.GetGameObject(this.gameObject, "topBar/btn_qmfl")
|
this.btn_qmfl = Util.GetGameObject(this.gameObject, "topBar/btn_qmfl")
|
||||||
this.btn_qmfl:GetComponent("Image").sprite = this.spLoader:LoadSprite("GM_qmfl_botton_zh")
|
this.btn_qmfl:GetComponent("Image").sprite = this.spLoader:LoadSprite("GM_qmfl_botton_zh")
|
||||||
this.treasureList = Util.GetGameObject(this.gameObject, "bg/pageContent/treasureList")
|
this.treasureList = Util.GetGameObject(this.gameObject, "bg/pageContent/treasureList")
|
||||||
|
@ -67,6 +69,7 @@ function this:BindEvent()
|
||||||
UIManager.OpenPanel(UIName.QuanMinFLPanel, curId)
|
UIManager.OpenPanel(UIName.QuanMinFLPanel, curId)
|
||||||
end)
|
end)
|
||||||
end
|
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)
|
||||||
|
@ -80,6 +83,7 @@ function this:RemoveListener()
|
||||||
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()
|
||||||
isPlayAnim = true
|
isPlayAnim = true
|
||||||
Timer.New(function()
|
Timer.New(function()
|
||||||
|
@ -103,7 +107,8 @@ function this:OnShow(_parent,...)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
curId = ActivityGiftManager.GetActivityIdByType(ActivityTypeDef.TreasureOfSomeBody)
|
curId = ActivityGiftManager.GetActivityIdByType(ActivityTypeDef.TreasureOfSomeBody)
|
||||||
this.btn_qmfl:SetActive(ActivityGiftManager.GetActivityInfoByType(10502)~=nil and ActivityGiftManager.CheckIsHaveHaveQMFL(ActivityTypeDef.TreasureOfSomeBody,curId))
|
this.btn_qmfl:SetActive(ActivityGiftManager.GetActivityInfoByType(10502) ~= nil and
|
||||||
|
ActivityGiftManager.CheckIsHaveHaveQMFL(ActivityTypeDef.TreasureOfSomeBody, curId))
|
||||||
local startTime, endTime, endTimeScale = QinglongSerectTreasureManager.GetTimeStartToEnd()
|
local startTime, endTime, endTimeScale = QinglongSerectTreasureManager.GetTimeStartToEnd()
|
||||||
-- this.timeTxt.text = "活动时间:"
|
-- this.timeTxt.text = "活动时间:"
|
||||||
-- this.time.text = startTime.."-"..endTime
|
-- this.time.text = startTime.."-"..endTime
|
||||||
|
@ -113,8 +118,8 @@ function this:OnShow(_parent,...)
|
||||||
--this.remainTime.text = "剩余时间:"..TimeToDHMS(tonumber(endTimeScale) - GetTimeStamp())
|
--this.remainTime.text = "剩余时间:"..TimeToDHMS(tonumber(endTimeScale) - GetTimeStamp())
|
||||||
--this:ShowTime(endTimeScale)
|
--this:ShowTime(endTimeScale)
|
||||||
this.refresh(true, true)
|
this.refresh(true, true)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function this:OnSortingOrderChange(sortingOrder)
|
function this:OnSortingOrderChange(sortingOrder)
|
||||||
for i, v in pairs(itemsList) do
|
for i, v in pairs(itemsList) do
|
||||||
for j = 1, #itemsList[i] do
|
for j = 1, #itemsList[i] do
|
||||||
|
@ -130,6 +135,7 @@ end
|
||||||
function this:OnClose()
|
function this:OnClose()
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function this:OnDestroy()
|
function this:OnDestroy()
|
||||||
this.spLoader:Destroy()
|
this.spLoader:Destroy()
|
||||||
itemsList = {}
|
itemsList = {}
|
||||||
|
@ -190,10 +196,11 @@ function this:topBar()
|
||||||
--this.RechargeSuccessFunc()
|
--this.RechargeSuccessFunc()
|
||||||
this.jiesuoBtnText.text = Language[11870]
|
this.jiesuoBtnText.text = Language[11870]
|
||||||
Game.GlobalEvent:DispatchEvent(GameEvent.TreasureOfHeaven.RechargeQinglongSerectSuccess, false, false)
|
Game.GlobalEvent:DispatchEvent(GameEvent.TreasureOfHeaven.RechargeQinglongSerectSuccess, false, false)
|
||||||
|
|
||||||
end)
|
end)
|
||||||
--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 = (not treasureState)
|
this.box :GetComponent("Image").enabled = (not treasureState)
|
||||||
this.extra:GetComponent("Button").enabled = ((treasureState) and (times > 0))
|
this.extra:GetComponent("Button").enabled = ((treasureState) and (times > 0))
|
||||||
|
@ -221,6 +228,7 @@ function this:topBar()
|
||||||
end)
|
end)
|
||||||
end,1.5):Start()
|
end,1.5):Start()
|
||||||
end)
|
end)
|
||||||
|
]]
|
||||||
end
|
end
|
||||||
|
|
||||||
--任务列表
|
--任务列表
|
||||||
|
@ -264,7 +272,6 @@ function this:showTaskList(isTop,isAni)
|
||||||
-- end
|
-- end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--单个任务
|
--单个任务
|
||||||
function this:SingleTask(rewardItem, rewardSingleData)
|
function this:SingleTask(rewardItem, rewardSingleData)
|
||||||
-- if isPlayAnim then
|
-- if isPlayAnim then
|
||||||
|
@ -316,7 +323,8 @@ function this:SingleTask(rewardItem, rewardSingleData)
|
||||||
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,false,false,sortingOrder)
|
itemsList[rewardItem][i]:OnOpen(false, rewardSingleData.Reward[i].item, 0.8, false, false, false,
|
||||||
|
sortingOrder)
|
||||||
SetMask(rewardItem, i, rewardSingleData.Reward[i].type)
|
SetMask(rewardItem, i, rewardSingleData.Reward[i].type)
|
||||||
else
|
else
|
||||||
itemsList[rewardItem][i].gameObject:SetActive(false)
|
itemsList[rewardItem][i].gameObject:SetActive(false)
|
||||||
|
@ -326,6 +334,7 @@ function this:SingleTask(rewardItem, rewardSingleData)
|
||||||
--初始化按钮状态
|
--初始化按钮状态
|
||||||
this:InitButtonState(rewardItem, rewardSingleData)
|
this:InitButtonState(rewardItem, rewardSingleData)
|
||||||
end
|
end
|
||||||
|
|
||||||
local type = {
|
local type = {
|
||||||
[-2] = { sprite = "s_slbz_1anniuhuise", text = Language[10341] },
|
[-2] = { sprite = "s_slbz_1anniuhuise", text = Language[10341] },
|
||||||
[-1] = { sprite = "s_slbz_1anniuhuise", text = Language[10025] },
|
[-1] = { sprite = "s_slbz_1anniuhuise", text = Language[10025] },
|
||||||
|
@ -334,7 +343,6 @@ local type={
|
||||||
}
|
}
|
||||||
--初始化按钮状态
|
--初始化按钮状态
|
||||||
function this:InitButtonState(rewardItem, rewardSingleData)
|
function this:InitButtonState(rewardItem, rewardSingleData)
|
||||||
|
|
||||||
local btnDeal = Util.GetGameObject(rewardItem, "btnDeal")
|
local btnDeal = Util.GetGameObject(rewardItem, "btnDeal")
|
||||||
|
|
||||||
local get = Util.GetGameObject(rewardItem, "btnDeal/get"):GetComponent("Image")
|
local get = Util.GetGameObject(rewardItem, "btnDeal/get"):GetComponent("Image")
|
||||||
|
@ -401,4 +409,5 @@ function this:ShowTime(endtime)
|
||||||
end, 1, -1, true)
|
end, 1, -1, true)
|
||||||
self.timer:Start()
|
self.timer:Start()
|
||||||
end
|
end
|
||||||
|
|
||||||
return this
|
return this
|
|
@ -25,12 +25,13 @@ function this:InitComponent(gameObject)
|
||||||
local v2 = this.treasureList:GetComponent("RectTransform").sizeDelta
|
local v2 = this.treasureList:GetComponent("RectTransform").sizeDelta
|
||||||
this.itemPre = Util.GetGameObject(this.gameObject, "rewardPre")
|
this.itemPre = Util.GetGameObject(this.gameObject, "rewardPre")
|
||||||
this.box = Util.GetGameObject(this.gameObject, "topBar/box")
|
this.box = Util.GetGameObject(this.gameObject, "topBar/box")
|
||||||
|
this.box.gameObject:SetActive(false)
|
||||||
this.extra = Util.GetGameObject(this.gameObject, "topBar/extraBox")
|
this.extra = Util.GetGameObject(this.gameObject, "topBar/extraBox")
|
||||||
this.canOpenExtra = Util.GetGameObject(this.gameObject, "topBar/UI_Effect_BaoXiang_KeKaiQi")
|
this.canOpenExtra = Util.GetGameObject(this.gameObject, "topBar/UI_Effect_BaoXiang_KeKaiQi")
|
||||||
this.canOpenExtra.gameObject:SetActive(false)
|
this.canOpenExtra.gameObject:SetActive(false)
|
||||||
this.openExtra = Util.GetGameObject(this.gameObject, "topBar/UI_Effect_BaoXiang_KaiQi")
|
this.openExtra = Util.GetGameObject(this.gameObject, "topBar/UI_Effect_BaoXiang_KaiQi")
|
||||||
this.openExtra.gameObject:SetActive(false)
|
this.openExtra.gameObject:SetActive(false)
|
||||||
|
this.extra.gameObject:SetActive(false)
|
||||||
--设置滚动条
|
--设置滚动条
|
||||||
this.ScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView, this.treasureList.transform,
|
this.ScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView, this.treasureList.transform,
|
||||||
this.itemPre, nil, Vector2.New(v2.x, v2.y), 1, 1, Vector2.New(100, 0))
|
this.itemPre, nil, Vector2.New(v2.x, v2.y), 1, 1, Vector2.New(100, 0))
|
||||||
|
@ -125,9 +126,9 @@ function this:SetTopBar()
|
||||||
--this.RechargeSuccessFunc()
|
--this.RechargeSuccessFunc()
|
||||||
this.jiesuoBtnText.text = Language[11870]
|
this.jiesuoBtnText.text = Language[11870]
|
||||||
Game.GlobalEvent:DispatchEvent(GameEvent.TreasureOfHeaven.RechargeQinglongSerectSuccess, false, false)
|
Game.GlobalEvent:DispatchEvent(GameEvent.TreasureOfHeaven.RechargeQinglongSerectSuccess, false, false)
|
||||||
|
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
--[[
|
||||||
local times = PrivilegeManager.GetPrivilegeRemainValue(1007)
|
local times = PrivilegeManager.GetPrivilegeRemainValue(1007)
|
||||||
this.box:GetComponent("Image").enabled = (not treasureState)
|
this.box:GetComponent("Image").enabled = (not treasureState)
|
||||||
this.extra:GetComponent("Button").enabled = (treasureState and (times > 0))
|
this.extra:GetComponent("Button").enabled = (treasureState and (times > 0))
|
||||||
|
@ -152,11 +153,12 @@ function this:SetTopBar()
|
||||||
end)
|
end)
|
||||||
end, 1.5):Start()
|
end, 1.5):Start()
|
||||||
end)
|
end)
|
||||||
|
]]
|
||||||
end
|
end
|
||||||
|
|
||||||
function this:OnSortingOrderChange(sortingOrder)
|
function this:OnSortingOrderChange(sortingOrder)
|
||||||
Util.SetParticleSortLayer(this.canOpenExtra, sortingOrder)
|
--Util.SetParticleSortLayer(this.canOpenExtra, sortingOrder)
|
||||||
Util.SetParticleSortLayer(this.openExtra, sortingOrder)
|
--Util.SetParticleSortLayer(this.openExtra, sortingOrder)
|
||||||
end
|
end
|
||||||
|
|
||||||
function this:OnClose()
|
function this:OnClose()
|
||||||
|
|
Loading…
Reference in New Issue