显示优化

This commit is contained in:
xiekaidong 2023-09-12 20:07:45 +08:00
parent dd62b41f00
commit d56fd65a70

View File

@ -37,34 +37,45 @@ function RuneChapterCell:refresh(id, index, isFinal, chapterListCount)
lightImg:setVisible(false) lightImg:setVisible(false)
sweep:setVisible(false) sweep:setVisible(false)
local passed = false local passed = false
if runeData:curFight(id) then -- 正在可打的 local isBossChapter = runeData:isBossChapter(id)
curBg:setVisible(true) curBg:setVisible(isBossChapter)
fightBg:setVisible(false) fightBg:setVisible(not isBossChapter)
local curLayerDecs
local layer = uiMap["chapter_cell.touch_node.bg_cur.desc"] local curLock
layer:setText(I18N:getGlobalText(I18N.GlobalConst.DUNGEON_WEAPON_DESC_6, id)) local curMask
if isBossChapter then
curLayerDecs = uiMap["chapter_cell.touch_node.bg_cur.desc"]
curLock = uiMap["chapter_cell.touch_node.bg_cur.lock"]
curMask = uiMap["chapter_cell.touch_node.bg_cur.bg_mask"]
else else
curBg:setVisible(false) curLayerDecs = uiMap["chapter_cell.touch_node.bg.desc"]
fightBg:setVisible(true) curLock = uiMap["chapter_cell.touch_node.bg.lock"]
curMask = uiMap["chapter_cell.touch_node.bg.bg_mask"]
end
local layer = uiMap["chapter_cell.touch_node.bg.desc"] curLayerDecs:setText(I18N:getGlobalText(I18N.GlobalConst.DUNGEON_WEAPON_DESC_6, id))
layer:setText(I18N:getGlobalText(I18N.GlobalConst.DUNGEON_WEAPON_DESC_6, id)) if maxPassedId >= id then -- 已通关的
local lock = uiMap["chapter_cell.touch_node.bg.lock"] passed = true
if maxPassedId >= id then -- 已通关的 local canSweep = runeData:canSweep(id)
passed = true sweep:setVisible(canSweep)
local canSweep = runeData:canSweep(id) if canSweep then
sweep:setVisible(canSweep) uiMap["chapter_cell.touch_node.sweep_bg.tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.SMASH))
if canSweep then end
uiMap["chapter_cell.touch_node.sweep_bg.tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.SMASH)) curLock:setVisible(false)
end curMask:setVisible(false)
lock:setVisible(false) curLayerDecs:setAnchoredPositionX(0)
layer:setAnchoredPositionX(0) -- lightImg:setVisible(true)
-- lightImg:setVisible(true) -- descMinRound:setText(I18N:getGlobalText(I18N.GlobalConst.DUNGEON_RUNE_MIN, runeData:getChapterPassRound(id)))
-- descMinRound:setText(I18N:getGlobalText(I18N.GlobalConst.DUNGEON_RUNE_MIN, runeData:getChapterPassRound(id))) -- descMinRound:setVisible(true)
-- descMinRound:setVisible(true) else
if runeData:canFight(id) then
curLock:setVisible(false)
curMask:setVisible(false)
curLayerDecs:setAnchoredPositionX(0)
else else
lock:setVisible(true) curLock:setVisible(true)
GFunc.centerImgAndTx(lock, layer, 5) curMask:setVisible(true)
GFunc.centerImgAndTx(curLock, curLayerDecs, 5)
end end
end end
@ -79,8 +90,20 @@ function RuneChapterCell:refresh(id, index, isFinal, chapterListCount)
for i, cell in ipairs(self.rewardCells) do for i, cell in ipairs(self.rewardCells) do
if rewards[i] then if rewards[i] then
cell:refreshByConfig(rewards[i], passed, passed) cell:refreshByConfig(rewards[i], passed, passed)
if isBossChapter then
cell:getBaseObject():setLocalScale(0.6, 0.6, 0.6)
else
cell:getBaseObject():setLocalScale(0.5, 0.5, 0.5)
end
end end
end end
if isBossChapter then
self.rewardCells[1]:getBaseObject():setAnchoredPositionX(-43)
self.rewardCells[2]:getBaseObject():setAnchoredPositionX(43)
else
self.rewardCells[1]:getBaseObject():setAnchoredPositionX(-35)
self.rewardCells[2]:getBaseObject():setAnchoredPositionX(35)
end
end end
function RuneChapterCell:addClickListener(func) function RuneChapterCell:addClickListener(func)