This commit is contained in:
puxuan 2025-09-03 18:33:43 +08:00
parent 653c927780
commit c50029683c
8 changed files with 36 additions and 6 deletions

View File

@ -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

View File

@ -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()

View File

@ -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()

View File

@ -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)

View File

@ -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])

View File

@ -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

View File

@ -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

View File

@ -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