This commit is contained in:
chenxi 2023-06-04 22:55:36 +08:00
parent dc32cdfd38
commit 6e65ce411f

View File

@ -41,13 +41,23 @@ function HeroFragmentTips:onLoadRootComplete()
end)
local uiMap = self.root:genAllChildren()
self.uiMap = uiMap
local itemQlt = cfg.qlt
if itemQlt < 1 then
itemQlt = 1
elseif itemQlt > 4 then
itemQlt = 4
end
local bgQlt = uiMap["hero_fragment_tips.title_bg_img.bg_qlt"]
bgQlt:setVisible(false)
bgQlt:setTexture("assets/arts/textures/background/shop/shop_card_bg_" .. itemQlt .. ".png", function()
bgQlt:setVisible(true)
end)
uiMap["hero_fragment_tips.title_bg_img.card"]:setSprite(GConst.ATLAS_PATH.ICON_ITEM, cfg.icon)
uiMap["hero_fragment_tips.title_bg_img.desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_CARD_TIPS_DESC))
uiMap["hero_fragment_tips.title_bg_img.title_text"]:setText(I18N:getGlobalText(I18N.GlobalConst["HERO_CARD_DESC_QLT_" .. cfg.qlt]))
uiMap["hero_fragment_tips.title_bg_img.ok_btn"]:addClickListener(function()
uiMap["hero_fragment_tips.title_bg_img.close_btn"]:addClickListener(function()
self:closeUI()
end)
uiMap["hero_fragment_tips.title_bg_img.ok_btn.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK))
self:initScrollRect()
end