关卡数据容错
This commit is contained in:
parent
c068622521
commit
06229275bf
@ -40,6 +40,7 @@ local LocalizationGlobalConst =
|
|||||||
HERO_DESC_9 = "HERO_DESC_9",
|
HERO_DESC_9 = "HERO_DESC_9",
|
||||||
HERO_DESC_10 = "HERO_DESC_10",
|
HERO_DESC_10 = "HERO_DESC_10",
|
||||||
BATTLE_DESC_8 = "BATTLE_DESC_8",
|
BATTLE_DESC_8 = "BATTLE_DESC_8",
|
||||||
|
HERO_DESC_11 = "HERO_DESC_11",
|
||||||
}
|
}
|
||||||
|
|
||||||
return LocalizationGlobalConst
|
return LocalizationGlobalConst
|
||||||
@ -38,8 +38,11 @@ local localization_global =
|
|||||||
["REWARD_PREVIEW_DESC"] = "奖励预览",
|
["REWARD_PREVIEW_DESC"] = "奖励预览",
|
||||||
["HERO_DESC_8"] = "使用",
|
["HERO_DESC_8"] = "使用",
|
||||||
["HERO_DESC_9"] = "信息",
|
["HERO_DESC_9"] = "信息",
|
||||||
|
|
||||||
["HERO_DESC_10"] = "通关章节{0}解锁",
|
["HERO_DESC_10"] = "通关章节{0}解锁",
|
||||||
["BATTLE_DESC_8"] = "还有可上阵英雄",
|
["BATTLE_DESC_8"] = "还有可上阵英雄",
|
||||||
|
|
||||||
|
["HERO_DESC_11"] = "已解锁",
|
||||||
}
|
}
|
||||||
|
|
||||||
return localization_global
|
return localization_global
|
||||||
@ -38,6 +38,9 @@ function HeroCell:refresh(heroEntity, isGray)
|
|||||||
self.lvTx:setVisible(true)
|
self.lvTx:setVisible(true)
|
||||||
self.progressBg:setVisible(not heroEntity:isMaxLv())
|
self.progressBg:setVisible(not heroEntity:isMaxLv())
|
||||||
self.unlockTx:setVisible(false)
|
self.unlockTx:setVisible(false)
|
||||||
|
if not heroEntity:isActived() then
|
||||||
|
self.lvTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_11))
|
||||||
|
end
|
||||||
else
|
else
|
||||||
self.lvTx:setVisible(false)
|
self.lvTx:setVisible(false)
|
||||||
self.progressBg:setVisible(false)
|
self.progressBg:setVisible(false)
|
||||||
|
|||||||
@ -46,11 +46,11 @@ function HeroListCell:refresh(index, heroList, stageFormation, allHeroCount, act
|
|||||||
local heroIndex = heroStartIndex
|
local heroIndex = heroStartIndex
|
||||||
for i = 1, 4 do
|
for i = 1, 4 do
|
||||||
if heroIndex <= activeCount then
|
if heroIndex <= activeCount then
|
||||||
self.heroCells[i]:setVisible(true)
|
|
||||||
local heroId = heroList[heroIndex]
|
local heroId = heroList[heroIndex]
|
||||||
local heroEntity = DataManager.HeroData:getHeroById(heroId)
|
local heroEntity = DataManager.HeroData:getHeroById(heroId)
|
||||||
local matchType = heroEntity:getMatchType()
|
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]:showCheck(stageFormation[matchType] == heroId)
|
||||||
self.heroCells[i]:addClickListener(function()
|
self.heroCells[i]:addClickListener(function()
|
||||||
if func then
|
if func then
|
||||||
|
|||||||
@ -57,7 +57,7 @@ end
|
|||||||
function ChapterData:getNextChapter(chapterId)
|
function ChapterData:getNextChapter(chapterId)
|
||||||
local chapterInfo = self:getChapterCfg()[chapterId]
|
local chapterInfo = self:getChapterCfg()[chapterId]
|
||||||
if chapterInfo == nil then
|
if chapterInfo == nil then
|
||||||
return chapterId
|
return 1
|
||||||
end
|
end
|
||||||
if chapterInfo.next_chapter == nil then
|
if chapterInfo.next_chapter == nil then
|
||||||
return chapterId
|
return chapterId
|
||||||
@ -109,8 +109,10 @@ function ChapterData:getChapterBoxNum(chapterId, index)
|
|||||||
chapterId = chapterId or self:getChapterId()
|
chapterId = chapterId or self:getChapterId()
|
||||||
local cfg = self:getChapterCfg()[chapterId]
|
local cfg = self:getChapterCfg()[chapterId]
|
||||||
if cfg and cfg.box_num then
|
if cfg and cfg.box_num then
|
||||||
return cfg.box_num[index]
|
return cfg.box_num[index] or 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
function ChapterData:getChapterBoxRewardGot(chapterId, index)
|
function ChapterData:getChapterBoxRewardGot(chapterId, index)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user