关卡数据容错

This commit is contained in:
xiekaidong 2023-04-21 09:56:30 +08:00
parent c068622521
commit 06229275bf
5 changed files with 13 additions and 4 deletions

View File

@ -40,6 +40,7 @@ local LocalizationGlobalConst =
HERO_DESC_9 = "HERO_DESC_9",
HERO_DESC_10 = "HERO_DESC_10",
BATTLE_DESC_8 = "BATTLE_DESC_8",
HERO_DESC_11 = "HERO_DESC_11",
}
return LocalizationGlobalConst

View File

@ -38,8 +38,11 @@ local localization_global =
["REWARD_PREVIEW_DESC"] = "奖励预览",
["HERO_DESC_8"] = "使用",
["HERO_DESC_9"] = "信息",
["HERO_DESC_10"] = "通关章节{0}解锁",
["BATTLE_DESC_8"] = "还有可上阵英雄",
["HERO_DESC_11"] = "已解锁",
}
return localization_global

View File

@ -38,6 +38,9 @@ function HeroCell:refresh(heroEntity, isGray)
self.lvTx:setVisible(true)
self.progressBg:setVisible(not heroEntity:isMaxLv())
self.unlockTx:setVisible(false)
if not heroEntity:isActived() then
self.lvTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_11))
end
else
self.lvTx:setVisible(false)
self.progressBg:setVisible(false)

View File

@ -46,11 +46,11 @@ function HeroListCell:refresh(index, heroList, stageFormation, allHeroCount, act
local heroIndex = heroStartIndex
for i = 1, 4 do
if heroIndex <= activeCount then
self.heroCells[i]:setVisible(true)
local heroId = heroList[heroIndex]
local heroEntity = DataManager.HeroData:getHeroById(heroId)
local matchType = heroEntity:getMatchType()
self.heroCells[i]:refresh(heroEntity, false)
self.heroCells[i]:setVisible(true)
self.heroCells[i]:refresh(heroEntity, not heroEntity:isActived())
self.heroCells[i]:showCheck(stageFormation[matchType] == heroId)
self.heroCells[i]:addClickListener(function()
if func then

View File

@ -57,7 +57,7 @@ end
function ChapterData:getNextChapter(chapterId)
local chapterInfo = self:getChapterCfg()[chapterId]
if chapterInfo == nil then
return chapterId
return 1
end
if chapterInfo.next_chapter == nil then
return chapterId
@ -109,8 +109,10 @@ function ChapterData:getChapterBoxNum(chapterId, index)
chapterId = chapterId or self:getChapterId()
local cfg = self:getChapterCfg()[chapterId]
if cfg and cfg.box_num then
return cfg.box_num[index]
return cfg.box_num[index] or 1
end
return 1
end
function ChapterData:getChapterBoxRewardGot(chapterId, index)