From c50029683cbf1180ebd0a5753e3f9a2b26886d23 Mon Sep 17 00:00:00 2001 From: puxuan <413323644@qq.com> Date: Wed, 3 Sep 2025 18:33:43 +0800 Subject: [PATCH] fix bug --- lua/app/ui/hero/cell/star_cell.lua | 4 ++-- lua/app/ui/hero/star_info_comp.lua | 2 +- lua/app/ui/main_city/component/main_comp.lua | 6 ++++++ lua/app/ui/main_city/main_city_ui.lua | 8 +++++++- lua/app/ui/summon/cell/summon_hero_cell.lua | 2 +- lua/app/ui/summon/summon_main_ui.lua | 5 ++++- lua/app/userdata/arena/arena_data.lua | 3 +++ lua/app/userdata/chapter/chapter_data.lua | 12 ++++++++++++ 8 files changed, 36 insertions(+), 6 deletions(-) diff --git a/lua/app/ui/hero/cell/star_cell.lua b/lua/app/ui/hero/cell/star_cell.lua index a6c5631c..eaa17ab3 100644 --- a/lua/app/ui/hero/cell/star_cell.lua +++ b/lua/app/ui/hero/cell/star_cell.lua @@ -8,11 +8,11 @@ function StarCell:init() end end -function StarCell:refresh(currStar) +function StarCell:refresh(currStar, showStar0) local starType = math.ceil(currStar / 5) for i, v in ipairs(self.starImgs) do local star = (currStar - 1)%5 + 1 - if currStar == 0 and i == 1 then + if showStar0 and currStar == 0 and i == 1 then v:setActive(true) v:setSprite(GFunc.getStarImg(starType, currStar)) elseif currStar > 0 and i <= star then diff --git a/lua/app/ui/hero/star_info_comp.lua b/lua/app/ui/hero/star_info_comp.lua index f7800091..4936d4ba 100644 --- a/lua/app/ui/hero/star_info_comp.lua +++ b/lua/app/ui/hero/star_info_comp.lua @@ -81,7 +81,7 @@ function StarInfoComp:refreshInfo() self.nextLvTx:setActive(true) local currStar = self.heroEntity:getStar() local nextStar = currStar + 1 - self.currStarBg:refresh(currStar) + self.currStarBg:refresh(currStar, true) self.nextStarBg:refresh(nextStar) local lv = self.heroEntity:getLv() local maxLv = self.heroEntity:getCurrMaxLv() diff --git a/lua/app/ui/main_city/component/main_comp.lua b/lua/app/ui/main_city/component/main_comp.lua index 7edfbd26..95ef9fc9 100644 --- a/lua/app/ui/main_city/component/main_comp.lua +++ b/lua/app/ui/main_city/component/main_comp.lua @@ -305,6 +305,12 @@ function MainComp:refreshRedPoint() else self.dailyChallengeBtn:removeRedPoint() end + + if DataManager.ChapterData:showRedPoint() then + self.chapterBoxBtn:addRedPoint(20, 20, 1) + else + self.chapterBoxBtn:removeRedPoint() + end end function MainComp:getArenaBtnPosition() diff --git a/lua/app/ui/main_city/main_city_ui.lua b/lua/app/ui/main_city/main_city_ui.lua index b6168913..e1c8d084 100644 --- a/lua/app/ui/main_city/main_city_ui.lua +++ b/lua/app/ui/main_city/main_city_ui.lua @@ -276,7 +276,13 @@ function MainCityUI:_bind() end end end) - + self:bind(DataManager.ArenaData, "isDirty", function() + if self.selectedIndex == GConst.MainCityConst.BOTTOM_PAGE.MAIN then + if self.subComps[self.selectedIndex] then + self.subComps[self.selectedIndex]:refresh() + end + end + end) self:bind(DataManager.AIHelperData, "isDirty", function() self:refreshSettingBtn() end) diff --git a/lua/app/ui/summon/cell/summon_hero_cell.lua b/lua/app/ui/summon/cell/summon_hero_cell.lua index f45eed79..cbc84954 100755 --- a/lua/app/ui/summon/cell/summon_hero_cell.lua +++ b/lua/app/ui/summon/cell/summon_hero_cell.lua @@ -69,7 +69,7 @@ end function SummonBallCell:refreshInfo(heroId) self.heroId = heroId local cfg = DataManager.HeroData:getHeroConfig(heroId) - -- self.icon:setSprite(GConst.ATLAS_PATH.ICON_HERO, cfg.icon) + self.icon:setSprite(GConst.ATLAS_PATH.ICON_SUMMON, tostring(cfg.icon)) self.heroBg:setSprite(GConst.ATLAS_PATH.UI_SUMMON, "summon_card_" .. cfg.qlt) self.heroDec:setSprite(GConst.ATLAS_PATH.ICON_HERO, GConst.HERO_DEC_QLT[cfg.qlt]) self.matchImg:setSprite(GConst.ATLAS_PATH.ICON_HERO, GConst.HeroConst.MATCH_ICON_NAME[cfg.position]) diff --git a/lua/app/ui/summon/summon_main_ui.lua b/lua/app/ui/summon/summon_main_ui.lua index 38c399eb..b57b305b 100755 --- a/lua/app/ui/summon/summon_main_ui.lua +++ b/lua/app/ui/summon/summon_main_ui.lua @@ -73,6 +73,7 @@ function SummonMainUI:onLoadRootComplete() self.btnWish = uiMap["summon_main_ui.node.btn_wish"] --心愿 self.btnWishTx = uiMap["summon_main_ui.node.btn_wish.unlock.tx_guarantee"] --心愿 self.btnWishIcon = uiMap["summon_main_ui.node.btn_wish.unlock.img_wish_icon"] --心愿 + self.btnWishAddImg = uiMap["summon_main_ui.node.btn_wish.add_img"] -- self.toggleJump = uiMap["summon_main_ui.jump_tween"]:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TOGGLE) -- self.isJumpTween = self.toggleJump.isOn @@ -345,9 +346,11 @@ function SummonMainUI:refreshWishBtn() if cfg then self.btnWishIcon:setSprite(GFunc.getHeroIcon(cfg.icon)) self.btnWish:setSprite(GConst.ATLAS_PATH.ICON_ITEM, GConst.FRAME_QLT[cfg.qlt]) + self.btnWishAddImg:setActive(false) else self.btnWishIcon:setSprite(GConst.ATLAS_PATH.COMMON, "common_alpha") - self.btnWish:setSprite(GConst.ATLAS_PATH.ICON_ITEM, "frame_1") + -- self.btnWish:setSprite(GConst.ATLAS_PATH.ICON_ITEM, "frame_1") + self.btnWishAddImg:setActive(true) end end diff --git a/lua/app/userdata/arena/arena_data.lua b/lua/app/userdata/arena/arena_data.lua index a41a178c..ab089a75 100644 --- a/lua/app/userdata/arena/arena_data.lua +++ b/lua/app/userdata/arena/arena_data.lua @@ -461,6 +461,9 @@ end -- 是否有入口红点 function ArenaData:hasEntranceRedDot() + if not self:isOpen() then + return false + end return DataManager.BagData.ItemData:getItemNumById(GConst.ItemConst.ITEM_ID_ARENA_TICKET) > 0 or self:hasSeasonReward() or self:hasGradingRewardRedDot() end diff --git a/lua/app/userdata/chapter/chapter_data.lua b/lua/app/userdata/chapter/chapter_data.lua index d5dd6f30..18817e34 100644 --- a/lua/app/userdata/chapter/chapter_data.lua +++ b/lua/app/userdata/chapter/chapter_data.lua @@ -517,4 +517,16 @@ function ChapterData:getChapterStage(chapterId) end --@endregion +--@region 红点 +function ChapterData:showRedPoint(chapterId) + chapterId = chapterId or self:getChapterId() + local list = self:getChapterBoxRewardList(chapterId) + for i = 1, #list do + if self:boxCanGet(chapterId, i) then + return true + end + end + return false +end +--@endregion return ChapterData \ No newline at end of file