From 6e65ce411f21c3fa54cfb99d2c3be6d52f88b3c3 Mon Sep 17 00:00:00 2001 From: chenxi Date: Sun, 4 Jun 2023 22:55:36 +0800 Subject: [PATCH] tips --- lua/app/ui/tips/hero_fragment_tips.lua | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lua/app/ui/tips/hero_fragment_tips.lua b/lua/app/ui/tips/hero_fragment_tips.lua index 5c5053a1..b9c5bcf2 100644 --- a/lua/app/ui/tips/hero_fragment_tips.lua +++ b/lua/app/ui/tips/hero_fragment_tips.lua @@ -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