From 52bc10db1527b0a1f577009479219949d242253a Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Wed, 26 Jul 2023 11:47:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/ui/hero/hero_info_comp.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lua/app/ui/hero/hero_info_comp.lua b/lua/app/ui/hero/hero_info_comp.lua index d4e00ced..e1b56c4d 100644 --- a/lua/app/ui/hero/hero_info_comp.lua +++ b/lua/app/ui/hero/hero_info_comp.lua @@ -32,6 +32,7 @@ function HeroInfoComp:init() self.upgrade = uiMap["hero_info.up"] self.bgElement = uiMap["hero_detail_ui.bg.element_bg"] self.btnAttr = uiMap["hero_info.bg_6.btn_attr"] + self.fragmentNode = uiMap["hero_detail_ui.bg.fragment_bg"] self.skill = {} self.skillIcon = {} @@ -67,6 +68,8 @@ function HeroInfoComp:refresh(checkLevel) local isLvChange = checkLevel and self.curLevel ~= self.heroEntity:getLv() self.txLv:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_1, self.heroEntity:getLv())) + local lvTxW = self.txLv:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).preferredWidth + self.txLv:setSizeDeltaX(lvTxW) self.spineObjAvatar:getSkeletonGraphic().enabled = false self.spineObjAvatar:loadAssetAsync(self.heroEntity:getModelId(), function() @@ -188,9 +191,14 @@ function HeroInfoComp:refresh(checkLevel) if self.onlyLook then -- 仅查看的不显示升级和激活按钮 self.upgrade:setVisible(false) self.baseObject:setSizeDeltaY(SIZE_DELTA_Y_LOOK) + self.fragmentNode:setVisible(false) + self.spineObjLv:setVisible(false) + self.txLv:setAnchoredPositionX(lvTxW / 2) else self.upgrade:setVisible(true) self.baseObject:setSizeDeltaY(SIZE_DELTA_Y_HERO) + self.txLv:setAnchoredPositionX(-44) + self.fragmentNode:setVisible(true) end end