每日挑战
This commit is contained in:
parent
2044015a21
commit
be6283fd1c
@ -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_task2"])
|
||||||
table.insert(self.tasks, uiMap["daily_challenge_ui.task.icon_task3"])
|
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.buffObj = uiMap["daily_challenge_ui.buffs.buff.btn_buff"]
|
||||||
self.debuffObj = uiMap["daily_challenge_ui.buffs.debuff.btn_debuff"]
|
self.debuffObj = uiMap["daily_challenge_ui.buffs.debuff.btn_debuff"]
|
||||||
self.bossSpine = uiMap["daily_challenge_ui.spine_node"]
|
self.bossSpine = uiMap["daily_challenge_ui.spine_node"]
|
||||||
@ -86,14 +91,17 @@ function DailyChallengeUI:refreshTask()
|
|||||||
if DataManager.DailyChallengeData:canClaimTask(i) then
|
if DataManager.DailyChallengeData:canClaimTask(i) then
|
||||||
-- 任务奖励可领取
|
-- 任务奖励可领取
|
||||||
taskObj:addRedPoint(30, 30, 1)
|
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
|
else
|
||||||
-- 任务奖励不可领取
|
-- 任务奖励不可领取
|
||||||
taskObj:removeRedPoint()
|
taskObj:removeRedPoint()
|
||||||
if not DataManager.DailyChallengeData:isTaskFinish(i) then
|
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
|
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
|
||||||
end
|
end
|
||||||
taskObj:addClickListener(function()
|
taskObj:addClickListener(function()
|
||||||
|
|||||||
@ -4,6 +4,7 @@ function TalentCell:init()
|
|||||||
local uiMap = self:getUIMap()
|
local uiMap = self:getUIMap()
|
||||||
|
|
||||||
self.animator = self.baseObject:getComponent(GConst.TYPEOF_UNITY_CLASS.ANIMATOR)
|
self.animator = self.baseObject:getComponent(GConst.TYPEOF_UNITY_CLASS.ANIMATOR)
|
||||||
|
self.bg1 = uiMap["talent_cell.bg1"]
|
||||||
self.bg = uiMap["talent_cell.bg"]
|
self.bg = uiMap["talent_cell.bg"]
|
||||||
self.descTx1 = uiMap["talent_cell.desc_tx_1"]
|
self.descTx1 = uiMap["talent_cell.desc_tx_1"]
|
||||||
self.descTx2 = uiMap["talent_cell.desc_tx_2"]
|
self.descTx2 = uiMap["talent_cell.desc_tx_2"]
|
||||||
@ -18,11 +19,12 @@ end
|
|||||||
|
|
||||||
function TalentCell:refresh(idx, cfg, showAni)
|
function TalentCell:refresh(idx, cfg, showAni)
|
||||||
self.idx = idx
|
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"))
|
self.descTx1:setText(I18N:getText("talent", idx, "name"))
|
||||||
local lv = DataManager.TalentData:getLevels(idx)
|
local lv = DataManager.TalentData:getLevels(idx)
|
||||||
self.descTx2:setText("Lv." .. lv)
|
self.descTx2:setText("Lv." .. lv)
|
||||||
self.bg:setSprite(GConst.ATLAS_PATH.ICON_TALENT, "talent_" .. idx)
|
|
||||||
if showAni then
|
if showAni then
|
||||||
self.animator.enabled = true
|
self.animator.enabled = true
|
||||||
self.animator:SetTrigger("t_open")
|
self.animator:SetTrigger("t_open")
|
||||||
|
|||||||
@ -17,13 +17,8 @@ end
|
|||||||
|
|
||||||
function TalentInfoUI:onLoadRootComplete()
|
function TalentInfoUI:onLoadRootComplete()
|
||||||
local uiMap = self.root:genAllChildren()
|
local uiMap = self.root:genAllChildren()
|
||||||
-- self.root:addClickListener(function()
|
|
||||||
-- self:closeUI()
|
|
||||||
-- end)
|
|
||||||
|
|
||||||
self.talentCell = uiMap["talent_info_ui.talent_cell"]:addLuaComponent(TALENT_CELL)
|
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.descTx = uiMap["talent_info_ui.desc_tx"]
|
||||||
self.leftArrowBtn = uiMap["talent_info_ui.left_arrow_btn"]
|
self.leftArrowBtn = uiMap["talent_info_ui.left_arrow_btn"]
|
||||||
self.rightArrowBtn = uiMap["talent_info_ui.right_arrow_btn"]
|
self.rightArrowBtn = uiMap["talent_info_ui.right_arrow_btn"]
|
||||||
@ -45,7 +40,8 @@ end
|
|||||||
|
|
||||||
function TalentInfoUI:onRefresh()
|
function TalentInfoUI:onRefresh()
|
||||||
self.list = DataManager.TalentData:getCfgList()
|
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.leftArrowBtn:setActive(self.id > 1)
|
||||||
self.rightArrowBtn:setActive(self.id < #self.list)
|
self.rightArrowBtn:setActive(self.id < #self.list)
|
||||||
self.descTx:setText(I18N:getText("talent", self.id, "desc"))
|
self.descTx:setText(I18N:getText("talent", self.id, "desc"))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user