界面处理

This commit is contained in:
xiekaidong 2023-04-15 16:54:44 +08:00
parent dc5a37ac0f
commit 00b1c43f54
3 changed files with 14 additions and 1 deletions

View File

@ -27,6 +27,8 @@ local LocalizationGlobalConst =
HERO_DESC_7 = "HERO_DESC_7", HERO_DESC_7 = "HERO_DESC_7",
REWARD_PREVIEW_DESC = "REWARD_PREVIEW_DESC", REWARD_PREVIEW_DESC = "REWARD_PREVIEW_DESC",
HERO_DESC_8 = "HERO_DESC_8",
HERO_DESC_9 = "HERO_DESC_9",
} }
return LocalizationGlobalConst return LocalizationGlobalConst

View File

@ -39,6 +39,8 @@ local localization_global =
["BATTLE_DESC_7"] = "累计造成总伤害:<color=#89FF76>{0}</color>", ["BATTLE_DESC_7"] = "累计造成总伤害:<color=#89FF76>{0}</color>",
["REWARD_PREVIEW_DESC"] = "奖励预览", ["REWARD_PREVIEW_DESC"] = "奖励预览",
["HERO_DESC_8"] = "使用",
["HERO_DESC_9"] = "信息",
} }
return localization_global return localization_global

View File

@ -7,9 +7,10 @@ function LargeHeroCell:init()
self.check = uiMap["hero_cell.hero_bg.mask"] self.check = uiMap["hero_cell.hero_bg.mask"]
self.matchImg = uiMap["hero_cell.hero_bg.match_img"] self.matchImg = uiMap["hero_cell.hero_bg.match_img"]
self.infoBtnDesc = uiMap["large_hero_cell.hero_bg.info_btn.desc"] self.infoBtnDesc = uiMap["large_hero_cell.hero_bg.info_btn.desc"]
self.useBtn = uiMap["large_hero_cell.hero_bg.use_btn.desc"] self.useBtnDesc = uiMap["large_hero_cell.hero_bg.use_btn.desc"]
self.isGray = false self.isGray = false
self.useBtnDesc:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_8))
uiMap["large_hero_cell.hero_bg.info_btn"]:addClickListener(function() uiMap["large_hero_cell.hero_bg.info_btn"]:addClickListener(function()
if not self.heroId or not self.matchType then if not self.heroId or not self.matchType then
return return
@ -30,6 +31,13 @@ function LargeHeroCell:refresh(heroEntity, isGray)
self.matchType = heroEntity:getMatchType() self.matchType = heroEntity:getMatchType()
local heroInfo = heroEntity:getConfig() local heroInfo = heroEntity:getConfig()
self:_refresh(heroInfo, isGray) self:_refresh(heroInfo, isGray)
local str
if heroEntity:canLvUp() then
str = I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_4)
else
str = I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_9)
end
self.infoBtnDesc:setText(str)
end end
function LargeHeroCell:refreshWithCfgId(id, isGray) function LargeHeroCell:refreshWithCfgId(id, isGray)
@ -37,6 +45,7 @@ function LargeHeroCell:refreshWithCfgId(id, isGray)
self.heroId = id self.heroId = id
self.matchType = heroInfo.position self.matchType = heroInfo.position
self:_refresh(heroInfo, isGray) self:_refresh(heroInfo, isGray)
self.infoBtnDesc:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_9))
end end
function LargeHeroCell:_refresh(heroInfo, isGray) function LargeHeroCell:_refresh(heroInfo, isGray)