fix bug
This commit is contained in:
parent
25b80d6f67
commit
fdfe3a1d4f
@ -1,6 +1,6 @@
|
|||||||
local TaskCell = class("TaskCell", BaseCell)
|
local TaskCell = class("TaskCell", BaseCell)
|
||||||
|
|
||||||
local ICON_BG = {"common_board_131", "common_board_132"}
|
local ICON_BG = {"act_common_bg_14", "act_common_bg_14"}
|
||||||
local ICON = {"daily_task_1", "daily_task_2"}
|
local ICON = {"daily_task_1", "daily_task_2"}
|
||||||
|
|
||||||
function TaskCell:refresh(taskInfo, customProgress)
|
function TaskCell:refresh(taskInfo, customProgress)
|
||||||
@ -9,7 +9,7 @@ function TaskCell:refresh(taskInfo, customProgress)
|
|||||||
local uiMap = self:getUIMap()
|
local uiMap = self:getUIMap()
|
||||||
local cfg = DataManager.DailyChallengeData:getTaskCfg()[taskInfo.task_id]
|
local cfg = DataManager.DailyChallengeData:getTaskCfg()[taskInfo.task_id]
|
||||||
local icon = complete and ICON_BG[2] or ICON_BG[1]
|
local icon = complete and ICON_BG[2] or ICON_BG[1]
|
||||||
-- uiMap["task_cell.task_icon_bg"]:setSprite(GConst.ATLAS_PATH.COMMON, icon)
|
uiMap["task_cell.bg"]:setSprite(GConst.ATLAS_PATH.ACT_COMMON, icon)
|
||||||
-- icon = complete and ICON[2] or ICON[1]
|
-- icon = complete and ICON[2] or ICON[1]
|
||||||
-- uiMap["task_cell.task_icon"]:setSprite(GConst.ATLAS_PATH.DAILY_CHALLENGE, icon)
|
-- uiMap["task_cell.task_icon"]:setSprite(GConst.ATLAS_PATH.DAILY_CHALLENGE, icon)
|
||||||
uiMap["task_cell.desc"]:setText(DataManager.DailyChallengeData:getTaskDesc(taskInfo.task_id, true, customProgress))
|
uiMap["task_cell.desc"]:setText(DataManager.DailyChallengeData:getTaskDesc(taskInfo.task_id, true, customProgress))
|
||||||
@ -18,7 +18,7 @@ function TaskCell:refresh(taskInfo, customProgress)
|
|||||||
local cell = uiMap["task_cell.reward_cell_" .. i]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL)
|
local cell = uiMap["task_cell.reward_cell_" .. i]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL)
|
||||||
if cfg.reward[i] then
|
if cfg.reward[i] then
|
||||||
cell:setActive(true)
|
cell:setActive(true)
|
||||||
cell:refreshByConfig(cfg.reward[i])
|
cell:refreshByConfig(cfg.reward[i], complete, complete)
|
||||||
else
|
else
|
||||||
cell:setActive(false)
|
cell:setActive(false)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -65,11 +65,13 @@ function TaskMainUI:onLoadRootComplete()
|
|||||||
self.dailyTaskFinalCellProgressTx = uiMap["task_main_ui.bg.daily.task_final_cell.progress_tx"]
|
self.dailyTaskFinalCellProgressTx = uiMap["task_main_ui.bg.daily.task_final_cell.progress_tx"]
|
||||||
self.boxBtns = {}
|
self.boxBtns = {}
|
||||||
self.boxBtnTxs = {}
|
self.boxBtnTxs = {}
|
||||||
|
self.boxBtnSpines = {}
|
||||||
local stageIds = DataManager.DailyTaskData:getStageIds()
|
local stageIds = DataManager.DailyTaskData:getStageIds()
|
||||||
for i = 1, 5 do
|
for i = 1, 5 do
|
||||||
self.boxBtns[i] = uiMap["task_main_ui.bg.daily.task_final_cell.box_" .. i]
|
self.boxBtns[i] = uiMap["task_main_ui.bg.daily.task_final_cell.box_" .. i]
|
||||||
self.boxBtnTxs[i] = uiMap["task_main_ui.bg.daily.task_final_cell.box_" .. i .. ".text"]
|
self.boxBtnTxs[i] = uiMap["task_main_ui.bg.daily.task_final_cell.box_" .. i .. ".text"]
|
||||||
self.boxBtnTxs[i]:setText(DataManager.DailyTaskData:getStageCondition(stageIds[i]))
|
self.boxBtnTxs[i]:setText(DataManager.DailyTaskData:getStageCondition(stageIds[i]))
|
||||||
|
self.boxBtnSpines[i] = uiMap["task_main_ui.bg.daily.task_final_cell.box_" .. i .. ".ui_spine_obj"]
|
||||||
-- self.boxBtns[i]:addClickListener(function()
|
-- self.boxBtns[i]:addClickListener(function()
|
||||||
-- GFunc.showToast(i)
|
-- GFunc.showToast(i)
|
||||||
-- -- local taskId = DataManager.DailyTaskData:getDailyTaskFinalId()
|
-- -- local taskId = DataManager.DailyTaskData:getDailyTaskFinalId()
|
||||||
@ -166,11 +168,17 @@ function TaskMainUI:refreshDaily()
|
|||||||
local stageId = stageIds[i]
|
local stageId = stageIds[i]
|
||||||
if stageId then
|
if stageId then
|
||||||
item:setActive(true)
|
item:setActive(true)
|
||||||
if DataManager.DailyTaskData:canClaimStage(stageId) then
|
if DataManager.DailyTaskData:isStageReceived(stageId) then
|
||||||
|
self.boxBtnSpines[i]:playAnim("idle02", true, false)
|
||||||
|
elseif DataManager.DailyTaskData:canClaimStage(stageId) then
|
||||||
|
self.boxBtnSpines[i]:playAnim("ready", true, false)
|
||||||
item:addClickListener(function()
|
item:addClickListener(function()
|
||||||
self:onClickBox()
|
self.boxBtnSpines[i]:playAnimComplete("open", false, true, function()
|
||||||
|
self:onClickBox()
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
else
|
else
|
||||||
|
self.boxBtnSpines[i]:playAnim("idle01", true, false)
|
||||||
item:addClickListener(function()
|
item:addClickListener(function()
|
||||||
ModuleManager.TipsManager:showRewardsTips(DataManager.DailyTaskData:getStageReward(stageId), nil, item)
|
ModuleManager.TipsManager:showRewardsTips(DataManager.DailyTaskData:getStageReward(stageId), nil, item)
|
||||||
end)
|
end)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user