From 897bd97fe4ede2f90d314678d4663cb51a595866 Mon Sep 17 00:00:00 2001 From: puxuan <413323644@qq.com> Date: Mon, 27 Oct 2025 15:23:43 +0800 Subject: [PATCH] UI --- lua/app/ui/bag/bag_main_ui.lua | 70 ++++++++++---------- lua/app/ui/common/cell/hero_cell.lua | 14 ++-- lua/app/ui/common/common_box_ui.lua | 12 ++-- lua/app/ui/main_city/component/main_comp.lua | 18 ++--- 4 files changed, 56 insertions(+), 58 deletions(-) diff --git a/lua/app/ui/bag/bag_main_ui.lua b/lua/app/ui/bag/bag_main_ui.lua index 8a1d2b87..fb45798c 100644 --- a/lua/app/ui/bag/bag_main_ui.lua +++ b/lua/app/ui/bag/bag_main_ui.lua @@ -24,26 +24,26 @@ function BagMainUI:onLoadRootComplete() self.titleTx = uiMap["bag_main_ui.bg.title_tx"] self.btnTxs = {I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_4), I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_16)} - self.pageBtns = {} - self.pageBtnTxs = {} - self.pageBtnLocks = {} - self.pageRedImgs = {} - for i = 1, 2 do - self.pageBtns[i] = uiMap["bag_main_ui.bg.btns.page_btn_" .. i] - self.pageBtnTxs[i] = uiMap["bag_main_ui.bg.btns.page_btn_" .. i .. ".text"] - self.pageBtnLocks[i] = uiMap["bag_main_ui.bg.btns.page_btn_" .. i .. ".lock_img"] - self.pageRedImgs[i] = uiMap["bag_main_ui.red_node.red_img_" .. i] - -- if self.pageBtnLocks[i] then - -- self.pageBtnLocks[i]:setActive(not self:getIsOpen(i)) - -- end - self.pageBtns[i] :addClickListener(function() - if not self:getIsOpen(i) or self.page == i then - return - end - self.page = i - self:onRefresh() - end) - end + -- self.pageBtns = {} + -- self.pageBtnTxs = {} + -- self.pageBtnLocks = {} + -- self.pageRedImgs = {} + -- for i = 1, 2 do + -- self.pageBtns[i] = uiMap["bag_main_ui.bg.btns.page_btn_" .. i] + -- self.pageBtnTxs[i] = uiMap["bag_main_ui.bg.btns.page_btn_" .. i .. ".text"] + -- self.pageBtnLocks[i] = uiMap["bag_main_ui.bg.btns.page_btn_" .. i .. ".lock_img"] + -- self.pageRedImgs[i] = uiMap["bag_main_ui.red_node.red_img_" .. i] + -- -- if self.pageBtnLocks[i] then + -- -- self.pageBtnLocks[i]:setActive(not self:getIsOpen(i)) + -- -- end + -- self.pageBtns[i] :addClickListener(function() + -- if not self:getIsOpen(i) or self.page == i then + -- return + -- end + -- self.page = i + -- self:onRefresh() + -- end) + -- end self.scrollrect = uiMap["bag_main_ui.bg.scrollrect"] self.scrollRectComp = uiMap["bag_main_ui.bg.scrollrect"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.SCROLL_RECT_BASE) @@ -65,7 +65,7 @@ end function BagMainUI:onRefresh() self:initList() - self:refreshPageBtn() + -- self:refreshPageBtn() self:refreshScrollrect() self.titleTx:setText(I18N:getGlobalText(I18N.GlobalConst.BAG_DESC_1)) @@ -76,20 +76,20 @@ function BagMainUI:initList() end -- 刷新标签红点 -function BagMainUI:refreshPageBtn() - for i = 1, 2 do - self.pageBtns[i]:setActive(false) - if self.page == i then - self.pageBtns[i]:setSprite(GConst.ATLAS_PATH.COMMON, "common_tab_1") - self.pageBtnTxs[i]:setText(self.btnTxs[i]) - else - self.pageBtns[i]:setSprite(GConst.ATLAS_PATH.COMMON, "common_tab_2") - self.pageBtnTxs[i]:setText("" .. self.btnTxs[i] .. "") - end - -- self.pageRedImgs[i]:setActive(self.heroEntity:showRedPoint(i)) - self.pageRedImgs[i]:setActive(false) - end -end +-- function BagMainUI:refreshPageBtn() +-- for i = 1, 2 do +-- self.pageBtns[i]:setActive(false) +-- if self.page == i then +-- self.pageBtns[i]:setSprite(GConst.ATLAS_PATH.COMMON, "common_tab_1") +-- self.pageBtnTxs[i]:setText(self.btnTxs[i]) +-- else +-- self.pageBtns[i]:setSprite(GConst.ATLAS_PATH.COMMON, "common_tab_2") +-- self.pageBtnTxs[i]:setText("" .. self.btnTxs[i] .. "") +-- end +-- -- self.pageRedImgs[i]:setActive(self.heroEntity:showRedPoint(i)) +-- self.pageRedImgs[i]:setActive(false) +-- end +-- end function BagMainUI:refreshScrollrect() self.scrollRectComp:refillCells(#self.list) diff --git a/lua/app/ui/common/cell/hero_cell.lua b/lua/app/ui/common/cell/hero_cell.lua index c432dd2f..9090e1e7 100644 --- a/lua/app/ui/common/cell/hero_cell.lua +++ b/lua/app/ui/common/cell/hero_cell.lua @@ -141,7 +141,7 @@ function HeroCell:_refresh(id, isGray) self.matchImg:setSprite(GConst.ATLAS_PATH.ICON_HERO, GConst.HeroConst.MATCH_ICON_NAME[heroInfo.position]) self.check:setVisible(false) self:refreshHeroIcon(heroInfo.icon) - self:setGray(isGray) + -- self:setGray(isGray) self.nameTx:setText(ModuleManager.HeroManager:getHeroName(id)) end @@ -162,12 +162,12 @@ function HeroCell:setSpineVisible(visible, scale) end function HeroCell:setGray(isGray) - if self.isGray == isGray then - return - end - self.isGray = isGray - self.icon:setImageGray(isGray) - self.matchImg:setImageGray(isGray) + -- if self.isGray == isGray then + -- return + -- end + -- self.isGray = isGray + -- self.icon:setImageGray(isGray) + -- self.matchImg:setImageGray(isGray) end return HeroCell diff --git a/lua/app/ui/common/common_box_ui.lua b/lua/app/ui/common/common_box_ui.lua index 71f49c3c..69ee0719 100755 --- a/lua/app/ui/common/common_box_ui.lua +++ b/lua/app/ui/common/common_box_ui.lua @@ -52,9 +52,7 @@ function CommonBoxUI:onLoadRootComplete() self.btnClose = uiMap["common_box_ui.content.btn_close"] self.rewardCell = uiMap["common_box_ui.content.info_node.reward_cell"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL) self.txName = uiMap["common_box_ui.content.info_node.tx_name"] - self.txType = uiMap["common_box_ui.content.info_node.tx_type"] - self.txCount = uiMap["common_box_ui.content.info_node.tx_count"] - self.txDesc = uiMap["common_box_ui.content.desc.tx_desc"] + self.txDesc = uiMap["common_box_ui.content.info_node.tx_desc"] self.scrollrect = uiMap["common_box_ui.content.scrollrect"] self.selectNode = uiMap["common_box_ui.content.select"] self.txSelect = uiMap["common_box_ui.content.select.tx_select"] @@ -113,8 +111,8 @@ end function CommonBoxUI:onRefresh() self.rewardCell:refreshById(self.id) self.txName:setText(ModuleManager.ItemManager:getItemName(self.id)) - self.txType:setText(I18N:getGlobalText(I18N.GlobalConst["ITEM_TYPE_" .. ModuleManager.ItemManager:getItemType(self.id)])) - self.txCount:setText(I18N:getGlobalText(I18N.GlobalConst.ITEM_DESC_1, self.maxCount)) + -- self.txType:setText(I18N:getGlobalText(I18N.GlobalConst["ITEM_TYPE_" .. ModuleManager.ItemManager:getItemType(self.id)])) + -- self.txCount:setText(I18N:getGlobalText(I18N.GlobalConst.ITEM_DESC_1, self.maxCount)) self.txDesc:setText(ModuleManager.ItemManager:getItemDesc(self.id)) self.txSelect:setText(self.curCount) @@ -152,12 +150,12 @@ function CommonBoxUI:onRefresh() -- 展示宝箱tips self.selectNode:setActive(false) self.btnUse:setActive(false) - self.contentNode:setSizeDeltaY(580) + self.contentNode:setSizeDeltaY(620) else -- 展示宝箱开奖励 self.selectNode:setActive(true) self.btnUse:setActive(true) - self.contentNode:setSizeDeltaY(728) + self.contentNode:setSizeDeltaY(768) end end diff --git a/lua/app/ui/main_city/component/main_comp.lua b/lua/app/ui/main_city/component/main_comp.lua index 3d7e8dad..fb04d098 100644 --- a/lua/app/ui/main_city/component/main_comp.lua +++ b/lua/app/ui/main_city/component/main_comp.lua @@ -42,15 +42,15 @@ function MainComp:init() self.heroNodeList = {} for i = 1, 5 do self.heroNodeList[i] = uiMap["main_comp.formation.hero_" .. i] - self.heroNodeList[i]:addClickListener(function() - local heroId = self.curFormation[i] - if heroId then - local hero = DataManager.HeroData:getHeroById(heroId) - if hero then - ModuleManager.HeroManager:showHeroDetailUI(heroId, nil, nil, GConst.BattleConst.FORMATION_TYPE.STAGE) - end - end - end) + -- self.heroNodeList[i]:addClickListener(function() + -- local heroId = self.curFormation[i] + -- if heroId then + -- local hero = DataManager.HeroData:getHeroById(heroId) + -- if hero then + -- ModuleManager.HeroManager:showHeroDetailUI(heroId, nil, nil, GConst.BattleConst.FORMATION_TYPE.STAGE) + -- end + -- end + -- end) end self.chapterMiddleBg = uiMap["main_comp.middle_bg"]