parent
734efe7b52
commit
76fad397de
|
@ -471,6 +471,7 @@ GameEvent = {
|
||||||
RechargeQinglongSerectSuccess = "EndLess.RechargeQinglongSerectSuccess",
|
RechargeQinglongSerectSuccess = "EndLess.RechargeQinglongSerectSuccess",
|
||||||
RefreshHeroData = "EndLess.RefreshHeroData",
|
RefreshHeroData = "EndLess.RefreshHeroData",
|
||||||
GuidePanel = "EndLess.GuidePanel",
|
GuidePanel = "EndLess.GuidePanel",
|
||||||
|
QinglongSerectRefresh = "EndLess.QinglongSerectRefresh",
|
||||||
},
|
},
|
||||||
--山河社稷图
|
--山河社稷图
|
||||||
FightLevel={
|
FightLevel={
|
||||||
|
|
|
@ -227,8 +227,7 @@ function EndLessMapView:BindEvent()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if not this:CanClick() then return end
|
if not this:CanClick() then return end
|
||||||
local data = EndLessMapManager.treasureData
|
UIManager.OpenPanel(UIName.EndLessTreasurePanel)
|
||||||
UIManager.OpenPanel(UIName.EndLessTreasurePanel,data)
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
Util.AddClick(this.btnFormat, function ()
|
Util.AddClick(this.btnFormat, function ()
|
||||||
|
|
|
@ -145,7 +145,10 @@ function this.EenlessTreasureRefreshIndication(buffer)
|
||||||
local data = buffer:DataByte()
|
local data = buffer:DataByte()
|
||||||
local msg = MapInfoProto_pb.EndlessTreasureInfoResponse()
|
local msg = MapInfoProto_pb.EndlessTreasureInfoResponse()
|
||||||
msg:ParseFromString(data)
|
msg:ParseFromString(data)
|
||||||
|
local num = BagManager.GetItemCountById(EndLessMapManager.scoreValueId)
|
||||||
|
BagManager.HeroLvUpUpdateItemsNum(EndLessMapManager.scoreValueId, num)
|
||||||
EndLessMapManager.InitTreasureData(msg)
|
EndLessMapManager.InitTreasureData(msg)
|
||||||
|
Game.GlobalEvent:DispatchEvent(GameEvent.EndLess.QinglongSerectRefresh)
|
||||||
end
|
end
|
||||||
|
|
||||||
--后端推送福利红包数据
|
--后端推送福利红包数据
|
||||||
|
|
|
@ -44,21 +44,23 @@ end
|
||||||
--添加事件监听(用于子类重写)
|
--添加事件监听(用于子类重写)
|
||||||
function EndLessTreasurePanel:AddListener()
|
function EndLessTreasurePanel:AddListener()
|
||||||
Game.GlobalEvent:AddEvent(GameEvent.EndLess.RechargeQinglongSerectSuccess, self.refresh,self)
|
Game.GlobalEvent:AddEvent(GameEvent.EndLess.RechargeQinglongSerectSuccess, self.refresh,self)
|
||||||
|
Game.GlobalEvent:AddEvent(GameEvent.EndLess.QinglongSerectRefresh, self.OnShow,self)
|
||||||
end
|
end
|
||||||
|
|
||||||
--移除事件监听(用于子类重写)
|
--移除事件监听(用于子类重写)
|
||||||
function EndLessTreasurePanel:RemoveListener()
|
function EndLessTreasurePanel:RemoveListener()
|
||||||
Game.GlobalEvent:RemoveEvent(GameEvent.EndLess.RechargeQinglongSerectSuccess, self.refresh,self)
|
Game.GlobalEvent:RemoveEvent(GameEvent.EndLess.RechargeQinglongSerectSuccess, self.refresh,self)
|
||||||
|
Game.GlobalEvent:AddEvent(GameEvent.EndLess.QinglongSerectRefresh, self.OnShow,self)
|
||||||
end
|
end
|
||||||
|
|
||||||
--界面打开时调用(用于子类重写)
|
--界面打开时调用(用于子类重写)
|
||||||
function EndLessTreasurePanel:OnOpen(...)
|
function EndLessTreasurePanel:OnOpen(...)
|
||||||
local args = {...}
|
|
||||||
self.treasureData = args[1]
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 打开,重新打开时回调
|
-- 打开,重新打开时回调
|
||||||
function EndLessTreasurePanel:OnShow()
|
function EndLessTreasurePanel:OnShow()
|
||||||
|
self.treasureData = EndLessMapManager.treasureData
|
||||||
self.tips.text = self.treasureData.tip
|
self.tips.text = self.treasureData.tip
|
||||||
--self.time.gameObject:SetActive(false)
|
--self.time.gameObject:SetActive(false)
|
||||||
self.time.text = "重置时间:"..TimeToDHMS(self.treasureData.resetTime - GetTimeStamp())
|
self.time.text = "重置时间:"..TimeToDHMS(self.treasureData.resetTime - GetTimeStamp())
|
||||||
|
@ -243,8 +245,10 @@ function EndLessTreasurePanel:ShowTime()
|
||||||
self.localTimer = Timer.New(function()
|
self.localTimer = Timer.New(function()
|
||||||
time = time - 1
|
time = time - 1
|
||||||
if time <= 0 then
|
if time <= 0 then
|
||||||
self.treasureState = 0
|
self.time.text = "重置时间:"..TimeToDHMS(0)
|
||||||
self.ScrollView:SetIndex(1)
|
self.localTimer:Stop()
|
||||||
|
self.localTimer = nil
|
||||||
|
return
|
||||||
end
|
end
|
||||||
self.time.text = "重置时间:"..TimeToDHMS(time)
|
self.time.text = "重置时间:"..TimeToDHMS(time)
|
||||||
end,1,-1,true)
|
end,1,-1,true)
|
||||||
|
|
Loading…
Reference in New Issue