fix bug
This commit is contained in:
parent
54e59862e5
commit
2878bff888
@ -37,7 +37,8 @@ end
|
|||||||
|
|
||||||
function TaskManager:claimDailyTask(dailyTaskId)
|
function TaskManager:claimDailyTask(dailyTaskId)
|
||||||
local parmas = {
|
local parmas = {
|
||||||
id = dailyTaskId,
|
-- id = dailyTaskId,
|
||||||
|
id = 0,
|
||||||
}
|
}
|
||||||
self:sendMessage(ProtoMsgType.FromMsgEnum.TaskDailyRewardReq, parmas, {}, self.onDailyTaskClaim, BIReport.ITEM_GET_TYPE.TASK_DAILY_REWARD)
|
self:sendMessage(ProtoMsgType.FromMsgEnum.TaskDailyRewardReq, parmas, {}, self.onDailyTaskClaim, BIReport.ITEM_GET_TYPE.TASK_DAILY_REWARD)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -47,6 +47,10 @@ function RewardBox:_refreshScrollRect()
|
|||||||
self.scrollView:setSizeDelta(#self.params.rewards*CELL_WIDTH, 120)
|
self.scrollView:setSizeDelta(#self.params.rewards*CELL_WIDTH, 120)
|
||||||
self.scrollRect:setPerLineNum(#self.params.rewards)
|
self.scrollRect:setPerLineNum(#self.params.rewards)
|
||||||
self.scrollRect:refillCells(#self.params.rewards, true)
|
self.scrollRect:refillCells(#self.params.rewards, true)
|
||||||
|
elseif #self.params.rewards <= 10 then
|
||||||
|
self.scrollView:setSizeDelta(CELL_NUM*CELL_WIDTH, 240)
|
||||||
|
self.scrollRect:setPerLineNum(CELL_NUM)
|
||||||
|
self.scrollRect:refillCells(#self.params.rewards, true)
|
||||||
else
|
else
|
||||||
self.scrollView:setSizeDelta(CELL_WIDTH*5, 314)
|
self.scrollView:setSizeDelta(CELL_WIDTH*5, 314)
|
||||||
self.scrollRect:setPerLineNum(CELL_NUM)
|
self.scrollRect:setPerLineNum(CELL_NUM)
|
||||||
|
|||||||
@ -181,7 +181,6 @@ function ChapterData:getChapterBoxCanGetInfo()
|
|||||||
local boxes = {}
|
local boxes = {}
|
||||||
for i = 1, 3 do
|
for i = 1, 3 do
|
||||||
local canGet = not self:getChapterBoxRewardGot(chapterId, i) and self:boxCanGet(chapterId, i)
|
local canGet = not self:getChapterBoxRewardGot(chapterId, i) and self:boxCanGet(chapterId, i)
|
||||||
Logger.logHighlight("chapterId: = %s i = %s canGet = %s", chapterId, i, canGet)
|
|
||||||
if canGet then
|
if canGet then
|
||||||
table.insert(boxes, i)
|
table.insert(boxes, i)
|
||||||
end
|
end
|
||||||
@ -233,8 +232,10 @@ function ChapterData:getChapterMaxWave(chapterId)
|
|||||||
chapterId = chapterId or self:getChapterId()
|
chapterId = chapterId or self:getChapterId()
|
||||||
if chapterId <= self.data.maxChapterId then
|
if chapterId <= self.data.maxChapterId then
|
||||||
return self:getChapterCfgMaxWave(chapterId)
|
return self:getChapterCfgMaxWave(chapterId)
|
||||||
else
|
elseif chapterId == self:getNextChapter(self.data.maxChapterId) then
|
||||||
return self.maxWave
|
return self.maxWave
|
||||||
|
else
|
||||||
|
return 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -341,10 +342,14 @@ function ChapterData:getChapterPassed(chapterId)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function ChapterData:openBox()
|
function ChapterData:openBox()
|
||||||
for chapterId = 1, self.data.maxChapterId do
|
local maxChapterId = self:getNextChapter(self.data.maxChapterId)
|
||||||
|
for chapterId = 1, maxChapterId do
|
||||||
self.data.chapterInfo[chapterId] = self.data.chapterInfo[chapterId] or {total_count = 0, index = {}, mystery_box_idx = {}}
|
self.data.chapterInfo[chapterId] = self.data.chapterInfo[chapterId] or {total_count = 0, index = {}, mystery_box_idx = {}}
|
||||||
for i = 1, 3 do
|
for i = 1, 3 do
|
||||||
self.data.chapterInfo[chapterId].index[i] = i
|
local canGet = not self:getChapterBoxRewardGot(chapterId, i) and self:boxCanGet(chapterId, i)
|
||||||
|
if canGet then
|
||||||
|
self.data.chapterInfo[chapterId].index[i] = i
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
self.boxCanGetState = nil
|
self.boxCanGetState = nil
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user