修复一些bug
This commit is contained in:
parent
ec33c7b7df
commit
b47d779cfc
@ -22,6 +22,7 @@ end
|
||||
function FourteenDayManager:rspTaskReward(result)
|
||||
if result.err_code == GConst.ERROR_STR.SUCCESS then
|
||||
DataManager.FourteenDayData:onReceivedTaskReward(result.reqData.id)
|
||||
GFunc.showRewardBox(result.rewards)
|
||||
end
|
||||
end
|
||||
|
||||
@ -41,13 +42,15 @@ function FourteenDayManager:rspBountyReward(result)
|
||||
end
|
||||
|
||||
-- 请求兑换奖励
|
||||
function FourteenDayManager:reqExchangeReward(id)
|
||||
self:sendMessage(ProtoMsgType.FromMsgEnum.FourteenBountyExchangeAwardReq, {id = id}, {}, self.rspExchangeReward, BIReport.ITEM_GET_TYPE.ACT_FOURTEEN_DAY_EXCHANGE)
|
||||
function FourteenDayManager:reqExchangeReward(id, count)
|
||||
self:sendMessage(ProtoMsgType.FromMsgEnum.FourteenBountyExchangeAwardReq, {id = id, count = count or 0}, {}, self.rspExchangeReward, BIReport.ITEM_GET_TYPE.ACT_FOURTEEN_DAY_EXCHANGE)
|
||||
end
|
||||
|
||||
function FourteenDayManager:rspExchangeReward(result)
|
||||
if result.err_code == GConst.ERROR_STR.SUCCESS then
|
||||
DataManager.FourteenDayData:onReceivedExchangeReward(result.reqData.id)
|
||||
if result.reqData.count then
|
||||
DataManager.FourteenDayData:onReceivedExchangeReward(result.reqData.id, result.reqData.count)
|
||||
end
|
||||
|
||||
GFunc.showRewardBox(result.rewards)
|
||||
end
|
||||
|
||||
@ -12,7 +12,12 @@ function FourteenDayExchangeCell:init()
|
||||
|
||||
self:addClickListener(function()
|
||||
if DataManager.FourteenDayData:canExchange(self.id) then
|
||||
ModuleManager.FourteenDayManager:reqExchangeReward(self.id)
|
||||
local cost = DataManager.FourteenDayData:getExchangeCost(self.id)
|
||||
local remainCount = DataManager.FourteenDayData:getExchangeRemainTime(self.id)
|
||||
local reward = DataManager.FourteenDayData:getExchangeReward(self.id)
|
||||
ModuleManager.CommonManager:showExchangeUI(1, remainCount, reward, cost, function(count)
|
||||
ModuleManager.FourteenDayManager:reqExchangeReward(self.id, count)
|
||||
end)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
@ -34,6 +34,9 @@ function FourteenDayTaskCell:refresh(id)
|
||||
local minScore = DataManager.ArenaData:getSeasonGradingMinScore()
|
||||
total = total - minScore
|
||||
cur = cur - minScore
|
||||
if cur < 0 then
|
||||
cur = 0
|
||||
end
|
||||
end
|
||||
self.imgTask:setSprite(GConst.ATLAS_PATH.ICON_TASK, tostring(DataManager.FourteenDayData:getTaskIcon(self.taskId)))
|
||||
self.txDesc:setText(DataManager.FourteenDayData:getTaskDesc(self.taskId))
|
||||
|
||||
@ -506,6 +506,10 @@ function FourteenDayData:getExchangeCostNum(id)
|
||||
return GFunc.getRewardNum(self:getExchangeCfg()[id].cost)
|
||||
end
|
||||
|
||||
function FourteenDayData:getExchangeCost(id)
|
||||
return self:getExchangeCfg()[id].cost
|
||||
end
|
||||
|
||||
-- 获取兑换的奖励道具
|
||||
function FourteenDayData:getExchangeReward(id)
|
||||
return self:getExchangeCfg()[id].reward
|
||||
@ -521,12 +525,13 @@ function FourteenDayData:onShowExchangeView()
|
||||
end
|
||||
|
||||
-- 兑换奖励领取成功
|
||||
function FourteenDayData:onReceivedExchangeReward(id)
|
||||
function FourteenDayData:onReceivedExchangeReward(id, count)
|
||||
count = count or 1
|
||||
if self.exchangeStatus[id] == nil then
|
||||
self.exchangeStatus[id] = 0
|
||||
end
|
||||
|
||||
self.exchangeStatus[id] = self.exchangeStatus[id] + 1
|
||||
self.exchangeStatus[id] = self.exchangeStatus[id] + count
|
||||
self:setDirty()
|
||||
end
|
||||
|
||||
|
||||
@ -720,7 +720,7 @@ function ArenaData:onBattleResultReceived(settlement, result)
|
||||
if self:getGradingIdFromScore(beforeMaxGrading) ~= self:getGradingIdFromScore(self.maxScore) then
|
||||
DataManager.HeroData:checkIfCanShowHeroUnlockDan(self:getFormartMaxGrading())
|
||||
end
|
||||
if beforeMaxGrading > self.maxScore then
|
||||
if beforeMaxGrading < self.maxScore then
|
||||
ModuleManager.TaskManager:addTaskProgress(GConst.TaskConst.TASK_TYPE.X_ARENA_GRADING, self.maxScore - beforeMaxGrading)
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user