From 06229275bf2d0a4d100a4fbb693bd3b2e6318a96 Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Fri, 21 Apr 2023 09:56:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E5=8D=A1=E6=95=B0=E6=8D=AE=E5=AE=B9?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/config/localization/localization_global_const.lua | 1 + lua/app/config/strings/cn/global.lua | 3 +++ lua/app/ui/common/cell/hero_cell.lua | 3 +++ lua/app/ui/hero/cell/hero_list_cell.lua | 4 ++-- lua/app/userdata/chapter/chapter_data.lua | 6 ++++-- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/lua/app/config/localization/localization_global_const.lua b/lua/app/config/localization/localization_global_const.lua index a9ed8382..b15b5b56 100644 --- a/lua/app/config/localization/localization_global_const.lua +++ b/lua/app/config/localization/localization_global_const.lua @@ -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 \ No newline at end of file diff --git a/lua/app/config/strings/cn/global.lua b/lua/app/config/strings/cn/global.lua index 36d16819..df5ebe88 100644 --- a/lua/app/config/strings/cn/global.lua +++ b/lua/app/config/strings/cn/global.lua @@ -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 \ No newline at end of file diff --git a/lua/app/ui/common/cell/hero_cell.lua b/lua/app/ui/common/cell/hero_cell.lua index 4cff0b0e..7559d85b 100644 --- a/lua/app/ui/common/cell/hero_cell.lua +++ b/lua/app/ui/common/cell/hero_cell.lua @@ -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) diff --git a/lua/app/ui/hero/cell/hero_list_cell.lua b/lua/app/ui/hero/cell/hero_list_cell.lua index 57a47224..3a2372da 100644 --- a/lua/app/ui/hero/cell/hero_list_cell.lua +++ b/lua/app/ui/hero/cell/hero_list_cell.lua @@ -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 diff --git a/lua/app/userdata/chapter/chapter_data.lua b/lua/app/userdata/chapter/chapter_data.lua index 529c2e0a..c775e364 100644 --- a/lua/app/userdata/chapter/chapter_data.lua +++ b/lua/app/userdata/chapter/chapter_data.lua @@ -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)