diff --git a/lua/app/ui/battle/battle_daily_challenge_buff_ui.lua b/lua/app/ui/battle/battle_daily_challenge_buff_ui.lua index a48af0ed..e6b5610e 100644 --- a/lua/app/ui/battle/battle_daily_challenge_buff_ui.lua +++ b/lua/app/ui/battle/battle_daily_challenge_buff_ui.lua @@ -1,68 +1,68 @@ local BattleDailyChallengeBuffUI = class("BattleDailyChallengeBuffUI", BaseUI) function BattleDailyChallengeBuffUI:isFullScreen() - return false + return false end function BattleDailyChallengeBuffUI:getPrefabPath() - return "assets/prefabs/ui/battle/battle_daily_challenge_buff_ui.prefab" + return "assets/prefabs/ui/battle/battle_daily_challenge_buff_ui.prefab" end function BattleDailyChallengeBuffUI:ctor() - self.buffDescs = {} - for _, id in ipairs(DataManager.DailyChallengeData:getTodayBuffIds()) do - local cfg = ConfigManager:getConfig("buff_daily_challenge")[id] - if cfg then - self.buffDescs[cfg.buff_type] = ModuleManager.DailyChallengeManager:getBuffDesc(id) - end - end + self.buffDescs = {} + for _, id in ipairs(DataManager.DailyChallengeData:getTodayBuffIds()) do + local cfg = ConfigManager:getConfig("buff_daily_challenge")[id] + if cfg then + self.buffDescs[cfg.buff_type] = ModuleManager.DailyChallengeManager:getBuffDesc(id) + end + end end function BattleDailyChallengeBuffUI:onClose() - if self.txSeq then - self.txSeq:Kill() - self.txSeq = nil - end + if self.txSeq then + self.txSeq:Kill() + self.txSeq = nil + end end function BattleDailyChallengeBuffUI:onLoadRootComplete() - self:_display() - self:_addListeners() + self:_display() + self:_addListeners() end function BattleDailyChallengeBuffUI:_display() - local uiMap = self.root:genAllChildren() - local buffDescs = { - uiMap["battle_daily_challenge_buff_ui.raw_img.desc_1"], - uiMap["battle_daily_challenge_buff_ui.raw_img.desc_2"] - } - for index, obj in ipairs(buffDescs) do - obj:setText(self.buffDescs[index]) - end - local txNode = uiMap["battle_daily_challenge_buff_ui.raw_img"]:getComponent(GConst.TYPEOF_UNITY_CLASS.CANVAS_GROUP) - txNode.alpha = 0 - local spineObj = uiMap["battle_daily_challenge_buff_ui.ui_spine_obj"] - spineObj:setVisible(false) + local uiMap = self.root:genAllChildren() + local buffDescs = { + uiMap["battle_daily_challenge_buff_ui.raw_img.desc_1"], + uiMap["battle_daily_challenge_buff_ui.raw_img.desc_2"] + } + for index, obj in ipairs(buffDescs) do + obj:setText(self.buffDescs[index]) + end + local txNode = uiMap["battle_daily_challenge_buff_ui.raw_img"]:getComponent(GConst.TYPEOF_UNITY_CLASS.CANVAS_GROUP) + txNode.alpha = 0 + local spineObj = uiMap["battle_daily_challenge_buff_ui.ui_spine_obj"] + spineObj:setVisible(false) - if self.txSeq then - self.txSeq:Kill() - self.txSeq = nil - end - self.txSeq = self.root:createBindTweenSequence() - self.txSeq:AppendInterval(0.2) - self.txSeq:AppendCallback(function() - spineObj:setVisible(true) - spineObj:playAnim("idle", false, true) - end) - self.txSeq:AppendInterval(0.2) - self.txSeq:Append(txNode:DOFade(1, 0.2)) + if self.txSeq then + self.txSeq:Kill() + self.txSeq = nil + end + self.txSeq = self.root:createBindTweenSequence() + self.txSeq:AppendInterval(0.2) + self.txSeq:AppendCallback(function() + spineObj:setVisible(true) + spineObj:playAnim("idle", false, true) + end) + self.txSeq:AppendInterval(0.2) + self.txSeq:Append(txNode:DOFade(1, 0.2)) end function BattleDailyChallengeBuffUI:_addListeners() - local uiMap = self.root:genAllChildren() - uiMap["battle_daily_challenge_buff_ui.mask"]:addClickListener(function() - self:closeUI() - end) + local uiMap = self.root:genAllChildren() + uiMap["battle_daily_challenge_buff_ui.mask"]:addClickListener(function() + self:closeUI() + end) end return BattleDailyChallengeBuffUI \ No newline at end of file diff --git a/lua/app/ui/daily_challenge/cell/task_cell.lua b/lua/app/ui/daily_challenge/cell/task_cell.lua index 25696456..f697c2b8 100644 --- a/lua/app/ui/daily_challenge/cell/task_cell.lua +++ b/lua/app/ui/daily_challenge/cell/task_cell.lua @@ -4,14 +4,24 @@ local ICON_BG = {"common_board_131", "common_board_132"} local ICON = {"daily_task_1", "daily_task_2"} function TaskCell:refresh(taskInfo, customProgress) - local complete = taskInfo.claimed - customProgress = customProgress or 0 - local uiMap = self:getUIMap() - local icon = complete and ICON_BG[2] or ICON_BG[1] - uiMap["task_cell.task_icon_bg"]:setSprite(GConst.ATLAS_PATH.COMMON, icon) - icon = complete and ICON[2] or ICON[1] - 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)) + local complete = taskInfo.claimed + customProgress = customProgress or 0 + local uiMap = self:getUIMap() + local icon = complete and ICON_BG[2] or ICON_BG[1] + -- uiMap["task_cell.task_icon_bg"]:setSprite(GConst.ATLAS_PATH.COMMON, icon) + -- icon = complete and ICON[2] or ICON[1] + -- 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)) + + for i = 1, 3 do + local cell = uiMap["daily_challenge_task_ui.bg.task_cell_" .. i] + if taskInfo.reward[i] then + cell:setVisible(true) + cell:refresh(taskInfo.reward[i]) + else + cell:setVisible(false) + end + end end return TaskCell \ No newline at end of file diff --git a/lua/app/ui/daily_challenge/daily_challenge_ui.lua b/lua/app/ui/daily_challenge/daily_challenge_ui.lua index 3bdfc3c4..5798fc42 100644 --- a/lua/app/ui/daily_challenge/daily_challenge_ui.lua +++ b/lua/app/ui/daily_challenge/daily_challenge_ui.lua @@ -30,18 +30,18 @@ function DailyChallengeUI:onLoadRootComplete() uiMap["daily_challenge_ui.close_btn"]:addClickListener(function () self:closeUI() end) - uiMap["daily_challenge_ui.challenge.info.title.title_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.DAILY_CHALLENGE)) - uiMap["daily_challenge_ui.challenge.info.record_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.CHAPTER_DESC_1, DataManager.DailyChallengeData:getMaxWave())) + uiMap["daily_challenge_ui.title.title_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.DAILY_CHALLENGE)) + uiMap["daily_challenge_ui.record_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.CHAPTER_DESC_1, DataManager.DailyChallengeData:getMaxWave())) self.tasks = GFunc.getTable() - table.insert(self.tasks, uiMap["daily_challenge_ui.challenge.task.icon_task1"]) - table.insert(self.tasks, uiMap["daily_challenge_ui.challenge.task.icon_task2"]) - table.insert(self.tasks, uiMap["daily_challenge_ui.challenge.task.icon_task3"]) + table.insert(self.tasks, uiMap["daily_challenge_ui.task.icon_task1"]) + table.insert(self.tasks, uiMap["daily_challenge_ui.task.icon_task2"]) + table.insert(self.tasks, uiMap["daily_challenge_ui.task.icon_task3"]) - self.buffObj = uiMap["daily_challenge_ui.challenge.buffs.buff.btn_buff"] - self.debuffObj = uiMap["daily_challenge_ui.challenge.buffs.debuff.btn_debuff"] - self.bossSpine = uiMap["daily_challenge_ui.challenge.spine_node"] - self.countdownTx = uiMap["daily_challenge_ui.challenge.info.countdown.time_tx"] + self.buffObj = uiMap["daily_challenge_ui.buffs.buff.btn_buff"] + self.debuffObj = uiMap["daily_challenge_ui.buffs.debuff.btn_debuff"] + self.bossSpine = uiMap["daily_challenge_ui.spine_node"] + self.countdownTx = uiMap["daily_challenge_ui.countdown.time_tx"] self.fightBtn = uiMap["daily_challenge_ui.fight_btn"] -- 体力消耗