每日挑战

This commit is contained in:
puxuan 2025-08-28 19:39:12 +08:00
parent 2044015a21
commit be6283fd1c
3 changed files with 17 additions and 11 deletions

View File

@ -38,6 +38,11 @@ function DailyChallengeUI:onLoadRootComplete()
table.insert(self.tasks, uiMap["daily_challenge_ui.task.icon_task2"])
table.insert(self.tasks, uiMap["daily_challenge_ui.task.icon_task3"])
self.taskMasks = GFunc.getTable()
table.insert(self.taskMasks, uiMap["daily_challenge_ui.task.icon_task1.mask"])
table.insert(self.taskMasks, uiMap["daily_challenge_ui.task.icon_task2.mask"])
table.insert(self.taskMasks, uiMap["daily_challenge_ui.task.icon_task3.mask"])
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"]
@ -86,14 +91,17 @@ function DailyChallengeUI:refreshTask()
if DataManager.DailyChallengeData:canClaimTask(i) then
-- 任务奖励可领取
taskObj:addRedPoint(30, 30, 1)
taskObj:setSprite(GConst.ATLAS_PATH.DAILY_CHALLENGE, "daily_task_1")
-- taskObj:setSprite(GConst.ATLAS_PATH.DAILY_CHALLENGE, "daily_task_1")
self.taskMasks[i]:setActive(false)
else
-- 任务奖励不可领取
taskObj:removeRedPoint()
if not DataManager.DailyChallengeData:isTaskFinish(i) then
taskObj:setSprite(GConst.ATLAS_PATH.DAILY_CHALLENGE, "daily_task_1")
-- taskObj:setSprite(GConst.ATLAS_PATH.DAILY_CHALLENGE, "daily_task_1")
self.taskMasks[i]:setActive(false)
else
taskObj:setSprite(GConst.ATLAS_PATH.DAILY_CHALLENGE, "daily_task_2")
-- taskObj:setSprite(GConst.ATLAS_PATH.DAILY_CHALLENGE, "daily_task_2")
self.taskMasks[i]:setActive(true)
end
end
taskObj:addClickListener(function()

View File

@ -4,6 +4,7 @@ function TalentCell:init()
local uiMap = self:getUIMap()
self.animator = self.baseObject:getComponent(GConst.TYPEOF_UNITY_CLASS.ANIMATOR)
self.bg1 = uiMap["talent_cell.bg1"]
self.bg = uiMap["talent_cell.bg"]
self.descTx1 = uiMap["talent_cell.desc_tx_1"]
self.descTx2 = uiMap["talent_cell.desc_tx_2"]
@ -18,11 +19,12 @@ end
function TalentCell:refresh(idx, cfg, showAni)
self.idx = idx
self.bg:setSprite(GConst.ATLAS_PATH.UI_TALENT, "talent_" .. idx)
local cfg = DataManager.TalentData:getCfgList()[idx]
self.bg1:setSprite(GConst.ATLAS_PATH.ICON_TALENT, "talent_b_" .. cfg.qlt)
self.bg:setSprite(GConst.ATLAS_PATH.ICON_TALENT, "talent_" .. idx)
self.descTx1:setText(I18N:getText("talent", idx, "name"))
local lv = DataManager.TalentData:getLevels(idx)
self.descTx2:setText("Lv." .. lv)
self.bg:setSprite(GConst.ATLAS_PATH.ICON_TALENT, "talent_" .. idx)
if showAni then
self.animator.enabled = true
self.animator:SetTrigger("t_open")

View File

@ -17,13 +17,8 @@ end
function TalentInfoUI:onLoadRootComplete()
local uiMap = self.root:genAllChildren()
-- self.root:addClickListener(function()
-- self:closeUI()
-- end)
self.talentCell = uiMap["talent_info_ui.talent_cell"]:addLuaComponent(TALENT_CELL)
-- self.animator = uiMap["talent_info_ui.talent_cell"]:getComponent(GConst.TYPEOF_UNITY_CLASS.ANIMATOR)
-- self.animator.enabled = false
self.descTx = uiMap["talent_info_ui.desc_tx"]
self.leftArrowBtn = uiMap["talent_info_ui.left_arrow_btn"]
self.rightArrowBtn = uiMap["talent_info_ui.right_arrow_btn"]
@ -45,7 +40,8 @@ end
function TalentInfoUI:onRefresh()
self.list = DataManager.TalentData:getCfgList()
self.talentCell:refresh(self.id, self.list[self.id])
-- self.talentCell:refresh(self.id, self.list[self.id])
self.talentCell:refresh(self.id, self.list[self.id], true)
self.leftArrowBtn:setActive(self.id > 1)
self.rightArrowBtn:setActive(self.id < #self.list)
self.descTx:setText(I18N:getText("talent", self.id, "desc"))