Merge branch 'china/dev' of http://60.1.1.230/gaoxin/JL_Client into china/dev

dev_chengFeng
jiaoyangna 2021-05-07 17:01:34 +08:00
commit 21e5c3b78d
2 changed files with 22 additions and 16 deletions

View File

@ -521,7 +521,11 @@ function this.InitQuickFightData(monsterGroupId, eventId, msg)
Game.GlobalEvent:DispatchEvent(GameEvent.Map.PointRemove, MapManager.curTriggerPos) Game.GlobalEvent:DispatchEvent(GameEvent.Map.PointRemove, MapManager.curTriggerPos)
elseif this.difficulty == 2 then elseif this.difficulty == 2 then
Game.GlobalEvent:DispatchEvent(GameEvent.Map.PointRemove, MapManager.curTriggerPos) Game.GlobalEvent:DispatchEvent(GameEvent.Map.PointRemove, MapManager.curTriggerPos)
if data.drop and (#data.drop.itemlist > 0 or #data.drop.equipId > 0 or #data.drop.Hero > 0 or #data.drop.soulEquip > 0 or #data.drop.pokemon > 0) then
UIManager.OpenPanel(UIName.RewardItemPopup,data.drop,1,func) UIManager.OpenPanel(UIName.RewardItemPopup,data.drop,1,func)
else
func()
end
end end
func = nil func = nil
-- 试炼副本不能直接结束事件点 -- 试炼副本不能直接结束事件点

View File

@ -1,8 +1,8 @@
 
local MonthCardPage = {} local MonthCardPage = {}
local cardData = { local cardData = {
[1] = { curState = 0 ,cardType = MONTH_CARD_TYPE.MONTHCARD,time = nil}, [1] = { curState = 0 ,cardType = MONTH_CARD_TYPE.MONTHCARD},
[2] = { curState = 0 ,cardType = MONTH_CARD_TYPE.LUXURYMONTHCARD,time = nil} [2] = { curState = 0 ,cardType = MONTH_CARD_TYPE.LUXURYMONTHCARD}
} }
local sortingOrder = 0 local sortingOrder = 0
local addTimeNum = 30 * 24 * 60 * 60 local addTimeNum = 30 * 24 * 60 * 60
@ -24,6 +24,7 @@ local offSetX = {
function MonthCardPage:InitComponent() function MonthCardPage:InitComponent()
self.grid = Util.GetGameObject(self.gameObject, "grid") self.grid = Util.GetGameObject(self.gameObject, "grid")
self.cardPres = {} self.cardPres = {}
self.timerList = {}
for i= 1 ,self.grid.transform.childCount do for i= 1 ,self.grid.transform.childCount do
self.cardPres[i] = {} self.cardPres[i] = {}
self.cardPres[i].go = self.grid.transform:GetChild(i - 1).gameObject self.cardPres[i].go = self.grid.transform:GetChild(i - 1).gameObject
@ -119,7 +120,7 @@ function MonthCardPage:SetCardShow(i)
if dayNum > 0 then if dayNum > 0 then
self.cardPres[i].time:GetComponent("Text").text = Language[10480] .. dayNum ..Language[10017] self.cardPres[i].time:GetComponent("Text").text = Language[10480] .. dayNum ..Language[10017]
else else
self:SetMonthCardTimes(residueTimeNum,cardData[i].time,self.cardPres[i].time,i) self:SetMonthCardTimes(residueTimeNum,self.cardPres[i].time,i)
end end
if self.curAllMonthCardData[cardData[i].cardType].state == 0 then if self.curAllMonthCardData[cardData[i].cardType].state == 0 then
Util.SetGray(self.cardPres[i].month,false) Util.SetGray(self.cardPres[i].month,false)
@ -133,24 +134,24 @@ function MonthCardPage:SetCardShow(i)
end end
end end
function MonthCardPage:SetMonthCardTimes(timeNums,timer,timeCom,index) function MonthCardPage:SetMonthCardTimes(timeNums,timeCom,index)
if timer then if self.timerList[index] then
timer:Stop() self.timerList[index]:Stop()
timer = nil self.timerList[index] = nil
end end
timeCom:GetComponent("Text").text = Language[10023]..TimeStampToDateStr3(timeNums) timeCom:GetComponent("Text").text = Language[10023]..TimeStampToDateStr3(timeNums)
timer = Timer.New(function() self.timerList[index] = Timer.New(function()
timeCom:GetComponent("Text").text = Language[10023]..TimeStampToDateStr3(timeNums) timeCom:GetComponent("Text").text = Language[10023]..TimeStampToDateStr3(timeNums)
if timeNums < 0 then if timeNums < 0 then
OperatingManager.RefreshMonthCardEnd() OperatingManager.RefreshMonthCardEnd()
self.curAllMonthCardData = OperatingManager.GetMonthCardData() self.curAllMonthCardData = OperatingManager.GetMonthCardData()
self:SetCardShow(index) self:SetCardShow(index)
timer:Stop() self.timerList[index]:Stop()
timer = nil self.timerList[index] = nil
end end
timeNums = timeNums - 1 timeNums = timeNums - 1
end, 1, -1, true) end, 1, -1, true)
timer:Start() self.timerList[index]:Start()
end end
--界面关闭时调用(用于子类重写) --界面关闭时调用(用于子类重写)
@ -160,11 +161,12 @@ end
--界面销毁时调用(用于子类重写) --界面销毁时调用(用于子类重写)
function MonthCardPage:OnDestroy() function MonthCardPage:OnDestroy()
self.cardPres = {} self.cardPres = {}
for i = 1, #cardData do for index = 1, #self.timerList do
if cardData[i].time then if self.timerList[index] then
cardData[i].time:Stop() self.timerList[index]:Stop()
cardData[i].time = nil self.timerList[index] = nil
end end
end end
self.timerList = {}
end end
return MonthCardPage return MonthCardPage