diff --git a/lua/app/ui/hero/hero_detail_ui.lua b/lua/app/ui/hero/hero_detail_ui.lua index 215ab19d..791ffa3a 100644 --- a/lua/app/ui/hero/hero_detail_ui.lua +++ b/lua/app/ui/hero/hero_detail_ui.lua @@ -32,33 +32,32 @@ end function HeroDetailUI:onLoadRootComplete() local uiMap = self.root:genAllChildren() - self.root:addClickListener(function() - self:closeUI() - end) + -- self.root:addClickListener(function() + -- self:closeUI() + -- end) -- uiMap["hero_detail_ui.mask"]:addClickListener(function() -- self:closeUI() -- end) - uiMap["hero_detail_ui.common.close_btn"]:addClickListener(function() + uiMap["hero_detail_ui.bottom.close_btn"]:addClickListener(function() self:closeUI() end) - self.heroInfo = uiMap["hero_detail_ui.hero_info"] - self.starInfo = uiMap["hero_detail_ui.star_info"] - self.equipInfo = uiMap["hero_detail_ui.equip_info"] - self.titleTx = uiMap["hero_detail_ui.common.name_tx"] - self.bg = uiMap["hero_detail_ui.common.bg"] - self.leftBtn = uiMap["hero_detail_ui.common.left_btn"] - self.rightBtn = uiMap["hero_detail_ui.common.right_btn"] + self.heroInfo = uiMap["hero_detail_ui.middle.hero_info"] + self.starInfo = uiMap["hero_detail_ui.middle.star_info"] + self.equipInfo = uiMap["hero_detail_ui.middle.equip_info"] + self.titleTx = uiMap["hero_detail_ui.top.name_tx"] + self.leftBtn = uiMap["hero_detail_ui.top.left_btn"] + self.rightBtn = uiMap["hero_detail_ui.top.right_btn"] self.heroNode = uiMap["hero_detail_ui.hero_node"] - self.elementBg = uiMap["hero_detail_ui.common.hero_node.element_bg"] - self.elementDesc = uiMap["hero_detail_ui.common.hero_node.element_bg.element_desc_tx"] - self.heroElement = uiMap["hero_detail_ui.common.hero_node.hero_element"] - self.spineObjAvatar = uiMap["hero_detail_ui.common.hero_node.ui_spine_obj_avatar"] - self.powerTx = uiMap["hero_detail_ui.common.power_img.power_tx"] - self.qltBg = uiMap["hero_detail_ui.common.qlt_bg"] - self.qltBgTx = uiMap["hero_detail_ui.common.qlt_bg.qlt_tx"] - self.starComp = uiMap["hero_detail_ui.common.hero_node.star_cell"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.STAR_CELL) + -- self.elementBg = uiMap["hero_detail_ui.top.hero_node.element_bg"] + -- self.elementDesc = uiMap["hero_detail_ui.top.hero_node.element_bg.element_desc_tx"] + self.heroElement = uiMap["hero_detail_ui.top.hero_element"] + self.spineObjAvatar = uiMap["hero_detail_ui.top.hero_node.ui_spine_obj_avatar"] + self.powerTx = uiMap["hero_detail_ui.top.power_img.power_tx"] + self.qltBg = uiMap["hero_detail_ui.top.qlt_bg"] + self.qltBgTx = uiMap["hero_detail_ui.top.qlt_bg.qlt_tx"] + self.starComp = uiMap["hero_detail_ui.top.star_cell"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.STAR_CELL) self.btnTxs = {I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_4), I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_16), I18N:getGlobalText(I18N.GlobalConst.EQUIP_DESC_1)} self.pageBtns = {} @@ -67,9 +66,9 @@ function HeroDetailUI:onLoadRootComplete() self.pageRedBgs = {} self.pageRedImgs = {} for i = 1, 3 do - self.pageBtns[i] = uiMap["hero_detail_ui.common.btns.page_btn_" .. i] - self.pageBtnTxs[i] = uiMap["hero_detail_ui.common.btns.page_btn_" .. i .. ".text"] - self.pageBtnLocks[i] = uiMap["hero_detail_ui.common.btns.page_btn_" .. i .. ".lock_img"] + self.pageBtns[i] = uiMap["hero_detail_ui.bottom.btns.page_btn_" .. i] + self.pageBtnTxs[i] = uiMap["hero_detail_ui.bottom.btns.page_btn_" .. i .. ".text"] + self.pageBtnLocks[i] = uiMap["hero_detail_ui.bottom.btns.page_btn_" .. i .. ".lock_img"] self.pageRedBgs[i] = uiMap["hero_detail_ui.red_node.red_img_" .. i] self.pageRedImgs[i] = uiMap["hero_detail_ui.red_node.red_img_" .. i .. ".red_img"] if self.pageBtnLocks[i] then @@ -165,16 +164,16 @@ end function HeroDetailUI:updateHero() local matchType = self.heroEntity:getMatchType() - self.elementDesc:setText(ModuleManager.HeroManager:getMatchTypeName(matchType)) - local elementTxRectWidth = self.elementDesc:getRectWidth() - local elementTxWidth = self.elementDesc:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).preferredWidth - if elementTxWidth > elementTxRectWidth then - self.elementBg:setSizeDeltaX(52 + elementTxWidth) - else - self.elementBg:setSizeDeltaX(52 + elementTxRectWidth) - end + -- self.elementDesc:setText(ModuleManager.HeroManager:getMatchTypeName(matchType)) + -- local elementTxRectWidth = self.elementDesc:getRectWidth() + -- local elementTxWidth = self.elementDesc:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).preferredWidth + -- if elementTxWidth > elementTxRectWidth then + -- self.elementBg:setSizeDeltaX(52 + elementTxWidth) + -- else + -- self.elementBg:setSizeDeltaX(52 + elementTxRectWidth) + -- end - self.elementBg:setSprite(ModuleManager.HeroManager:getMatchTypeBg(matchType)) + -- self.elementBg:setSprite(ModuleManager.HeroManager:getMatchTypeBg(matchType)) self.heroElement:setSprite(GConst.ATLAS_PATH.ICON_HERO, ModuleManager.HeroManager:getMatchTypeIcon(matchType)) self.spineObjAvatar:getSkeletonGraphic().enabled = false self.spineObjAvatar:loadAssetAsync(self.heroEntity:getModelId(), function() @@ -231,7 +230,6 @@ function HeroDetailUI:showHeroInfo() self.heroInfo:setActive(true) self.starInfo:setActive(false) self.equipInfo:setActive(false) - self.bg:setActive(true) local power = self.heroEntity:getPower() self.powerTx:setText(GFunc.num2Str2(power, 2)) @@ -250,7 +248,6 @@ function HeroDetailUI:showStarInfo() self.heroInfo:setActive(false) self.starInfo:setActive(true) self.equipInfo:setActive(false) - self.bg:setActive(true) if not self.compStar then self.starInfo:initPrefabHelper() @@ -267,7 +264,6 @@ function HeroDetailUI:showEquipInfo() self.heroInfo:setActive(false) self.starInfo:setActive(false) self.equipInfo:setActive(true) - self.bg:setActive(true) if not self.compEquip then self.equipInfo:initPrefabHelper() diff --git a/lua/app/ui/hero/hero_info_comp.lua b/lua/app/ui/hero/hero_info_comp.lua index 460c9ad8..b6c932d7 100644 --- a/lua/app/ui/hero/hero_info_comp.lua +++ b/lua/app/ui/hero/hero_info_comp.lua @@ -15,7 +15,7 @@ function HeroInfoComp:init() self.txUpdesc = uiMap["hero_info.up.up_btn.text"] self.btnUp5 = uiMap["hero_info.up.up_5_btn"] self.txUpdesc5 = uiMap["hero_info.up.up_5_btn.text"] - self.txLv = uiMap["hero_info.lv_desc"] + self.lvTx = uiMap["hero_info.bg_4.lv_tx"] self.txElement = uiMap["hero_info.element_bg.element_desc"] self.txSkill = uiMap["hero_info.skill_desc"] self.btnskillDescTxs = uiMap["hero_info.skill_desc.btn_skill_desc"] @@ -30,15 +30,15 @@ function HeroInfoComp:init() self.bgElement = uiMap["hero_info.element_bg"] self.btnAttr = uiMap["hero_info.bg_6.attr_btn"] self.gotoBtn = uiMap["hero_info.up.goto_btn"] - self.needStarNode = uiMap["hero_info.up.need_star_node"] - self.needStarNodeDescTx1 = uiMap["hero_info.up.need_star_node.desc_tx_1"] - self.needStarNodeStarImg = uiMap["hero_info.up.need_star_node.star_img"] - self.needStarNodeDescTx2 = uiMap["hero_info.up.need_star_node.desc_tx_2"] - uiMap["hero_info.up.goto_btn.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_22)) - self.needStarNodeDescTx2:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_20)) - local meshProComp = self.needStarNodeDescTx2:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO) - local contentWidth = meshProComp.preferredWidth - self.needStarNodeDescTx2:setSizeDeltaX(contentWidth) + -- self.needStarNode = uiMap["hero_info.up.need_star_node"] + -- self.needStarNodeDescTx1 = uiMap["hero_info.up.need_star_node.desc_tx_1"] + -- self.needStarNodeStarImg = uiMap["hero_info.up.need_star_node.star_img"] + -- self.needStarNodeDescTx2 = uiMap["hero_info.up.need_star_node.desc_tx_2"] + -- uiMap["hero_info.up.goto_btn.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_22)) + -- self.needStarNodeDescTx2:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_20)) + -- local meshProComp = self.needStarNodeDescTx2:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO) + -- local contentWidth = meshProComp.preferredWidth + -- self.needStarNodeDescTx2:setSizeDeltaX(contentWidth) self.bg5Vfx01 = uiMap["hero_info.bg_5.vfx_c1_ui_up_b01"] self.bg6Vfx01 = uiMap["hero_info.bg_6.vfx_c1_ui_up_b01"] @@ -46,9 +46,9 @@ function HeroInfoComp:init() self.skillIcon = {} self.skillDescTxs = {} for i = 1, 4 do - self.skill[i] = uiMap["hero_info.skill_up_" .. i] - self.skillIcon[i] = uiMap["hero_info.skill_up_" .. i .. ".icon"] - self.skillDescTxs[i] = uiMap["hero_info.skill_up_" .. i .. ".desc_tx"] + self.skill[i] = uiMap["hero_info.skill_node.skill_up_" .. i] + self.skillIcon[i] = uiMap["hero_info.skill_node.skill_up_" .. i .. ".icon"] + self.skillDescTxs[i] = uiMap["hero_info.skill_node.skill_up_" .. i .. ".desc_tx"] end self.costCells = {} @@ -56,10 +56,10 @@ function HeroInfoComp:init() self.costCells[i] = uiMap["hero_info.up.reward_cell_" .. i]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL) end - self.lvUpVfxs = {} - for i = 1, 5 do - self.lvUpVfxs[i] = uiMap["hero_info.vfx_c1_ui_uplight_b0" .. i] - end + -- self.lvUpVfxs = {} + -- for i = 1, 5 do + -- self.lvUpVfxs[i] = uiMap["hero_info.vfx_c1_ui_uplight_b0" .. i] + -- end self.spineObj:setVisible(false) self.txUpdesc:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_15, 1)) @@ -108,9 +108,9 @@ end 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.lvTx:setText(I18N:getGlobalText(I18N.GlobalConst.RUNES_DESC_26, self.heroEntity:getLv())) + -- local lvTxW = self.lvTx:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).preferredWidth + -- self.lvTx:setSizeDeltaX(lvTxW) self.txSkill:setText(ModuleManager.HeroManager:getSkillDesc(self.heroEntity:getBaseSkill())) self.txHpName:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_2)) @@ -177,7 +177,7 @@ function HeroInfoComp:refresh(checkLevel) self.btnUp:setActive(false) self.btnUp5:setActive(false) self.gotoBtn:setActive(false) - self.needStarNode:setActive(false) + -- self.needStarNode:setActive(false) for i,v in ipairs(self.costCells) do v:setActive(false) end @@ -202,7 +202,7 @@ function HeroInfoComp:refresh(checkLevel) self.btnUp:setActive(false) self.btnUp5:setActive(false) self.gotoBtn:setActive(false) - self.needStarNode:setActive(false) + -- self.needStarNode:setActive(false) for i,v in ipairs(self.costCells) do v:setActive(false) end @@ -210,16 +210,16 @@ function HeroInfoComp:refresh(checkLevel) self.btnUp:setActive(false) self.btnUp5:setActive(false) self.gotoBtn:setActive(true) - self.needStarNode:setActive(true) - local star = self.heroEntity:getStar() - local currStar = star%5 + 1 - self.needStarNodeDescTx1:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_19, currStar)) - local meshProComp = self.needStarNodeDescTx1:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO) - local contentWidth = meshProComp.preferredWidth - self.needStarNodeDescTx1:setSizeDeltaX(contentWidth) - self.needStarNode:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_HORIZONTAL_OR_VERTICAL_LAYOUT):RefreshLayout() - local starType = math.ceil(currStar / 5) - self.needStarNodeStarImg:setSprite(GFunc.getStarImg(starType)) + -- self.needStarNode:setActive(true) + -- local star = self.heroEntity:getStar() + -- local currStar = star%5 + 1 + -- self.needStarNodeDescTx1:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_19, currStar)) + -- local meshProComp = self.needStarNodeDescTx1:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO) + -- local contentWidth = meshProComp.preferredWidth + -- self.needStarNodeDescTx1:setSizeDeltaX(contentWidth) + -- self.needStarNode:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_HORIZONTAL_OR_VERTICAL_LAYOUT):RefreshLayout() + -- local starType = math.ceil(currStar / 5) + -- self.needStarNodeStarImg:setSprite(GFunc.getStarImg(starType)) for i,v in ipairs(self.costCells) do v:setActive(false) @@ -228,7 +228,7 @@ function HeroInfoComp:refresh(checkLevel) self.btnUp:setActive(true) self.btnUp5:setActive(true) self.gotoBtn:setActive(false) - self.needStarNode:setActive(false) + -- self.needStarNode:setActive(false) local costs = {} costs[1] = {id = self.heroEntity:getFragmentId(), num = materials[1], type = 1} @@ -268,14 +268,14 @@ function HeroInfoComp:refresh(checkLevel) -- self.needStarNodeStarImg = uiMap["hero_info.up.need_star_node.star_img"] -- self.needStarNodeDescTx2 = uiMap["hero_info.up.need_star_node.desc_tx_2"] - for i,v in ipairs(self.lvUpVfxs) do - v:setActive(false) - end + -- for i,v in ipairs(self.lvUpVfxs) do + -- v:setActive(false) + -- end if isLvChange then local match = self.heroEntity:getMatchType() -- self.spineObj:setVisible(true) -- self.spineObj:playAnim("idle", false, true) - self.lvUpVfxs[match]:setActive(true) + -- self.lvUpVfxs[match]:setActive(true) self.bg5Vfx01:setActive(true) self.bg6Vfx01:setActive(true) else