From fc7b9a734bd074fff089554d0d54b2bd94c8a455 Mon Sep 17 00:00:00 2001 From: puxuan <413323644@qq.com> Date: Thu, 30 Oct 2025 10:37:15 +0800 Subject: [PATCH] fix bug --- lua/app/global/global_func.lua | 2 +- lua/app/ui/common/cell/hero_cell.lua | 11 +++++++++++ lua/app/ui/hero/hero_detail_ui.lua | 22 +++++++++++----------- lua/app/ui/main_city/main_city_ui.lua | 2 +- lua/app/userdata/hero/hero_data.lua | 11 ++++++++--- lua/app/userdata/hero/hero_entity.lua | 8 ++++---- 6 files changed, 36 insertions(+), 20 deletions(-) diff --git a/lua/app/global/global_func.lua b/lua/app/global/global_func.lua index 09a7c308..d3de222c 100644 --- a/lua/app/global/global_func.lua +++ b/lua/app/global/global_func.lua @@ -647,7 +647,7 @@ function GFunc.addRewards(rewards, itemGetType) if v.type == GConst.REWARD_TYPE.ITEM then DataManager.BagData.ItemData:addItem(v.item, itemGetType) elseif v.type == GConst.REWARD_TYPE.EQUIP then - DataManager.BagData.EquipData:addEquipCountById(v.equip.id, v.equip.count, itemGetType) + DataManager.EquipData:addEquipCountById(v.equip.id, v.equip.count, itemGetType) end end EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.GETED_REWARD_SUCCESS, newRewards) diff --git a/lua/app/ui/common/cell/hero_cell.lua b/lua/app/ui/common/cell/hero_cell.lua index f4239cf6..0fa592c1 100644 --- a/lua/app/ui/common/cell/hero_cell.lua +++ b/lua/app/ui/common/cell/hero_cell.lua @@ -52,6 +52,17 @@ function HeroCell:refresh(heroEntity, isGray) else self.lvUpArrow:setActive(false) end + + if inTeam then + if DataManager.EquipData:hasEquipRedPoint(heroEntity:getMatchType()) then + self.baseObject:addRedPoint(70, 100, 1) + else + self.baseObject:removeRedPoint() + end + else + self.baseObject:removeRedPoint() + end + local star = heroEntity:getStar() self.starComp:refresh(star) if heroEntity:isUnlock() then diff --git a/lua/app/ui/hero/hero_detail_ui.lua b/lua/app/ui/hero/hero_detail_ui.lua index cfb19a3f..2bbd221d 100644 --- a/lua/app/ui/hero/hero_detail_ui.lua +++ b/lua/app/ui/hero/hero_detail_ui.lua @@ -343,17 +343,17 @@ function HeroDetailUI:refreshSkillInfo(checkUp) end end - -- local needPop, isUnlock, skillIdx = self.heroEntity:checkSkillUnlock() - -- if needPop then - -- self.baseObject:performWithDelayGlobal(function() - -- local skillInfo = skillList[skillIdx] - -- if skillInfo then - -- local skillId = skillInfo[2] - -- local cfg = ConfigManager:getConfig("skill_rogue")[skillId] - -- ModuleManager.HeroManager:showHeroSkillInfoUI(self.heroEntity, skillIdx, cfg.buff_id, isUnlock, needPop) - -- end - -- end, 0.5) - -- end + local needPop, isUnlock, skillIdx = self.heroEntity:checkSkillUnlock() + if needPop then + self.root:performWithDelayGlobal(function() + local skillInfo = skillList[skillIdx] + if skillInfo then + local skillId = skillInfo[2] + local cfg = ConfigManager:getConfig("skill_rogue")[skillId] + ModuleManager.HeroManager:showHeroSkillInfoUI(self.heroEntity, skillIdx, cfg.buff_id, isUnlock, needPop) + end + end, 0.5) + end end function HeroDetailUI:refreshPageInfo() diff --git a/lua/app/ui/main_city/main_city_ui.lua b/lua/app/ui/main_city/main_city_ui.lua index fa65d086..b6384bd9 100644 --- a/lua/app/ui/main_city/main_city_ui.lua +++ b/lua/app/ui/main_city/main_city_ui.lua @@ -18,7 +18,7 @@ MainCityUI.CLICK_BTN_TYPE = { [1] = "HOME", [2] = "HERO", [3] = "SHOP", - [4] = "DUNGEON", + [4] = "COMPANY", [5] = "DUNGEON", } diff --git a/lua/app/userdata/hero/hero_data.lua b/lua/app/userdata/hero/hero_data.lua index 5c13ebf3..37b96c9f 100644 --- a/lua/app/userdata/hero/hero_data.lua +++ b/lua/app/userdata/hero/hero_data.lua @@ -186,9 +186,14 @@ function HeroData:getRp() end end - -- if DataManager.CollectionData:hasRedPoint() then - -- return true - -- end + for _, heroId in pairs(formationMap) do + if heroId > 0 then + local cfg = HeroCfg[heroId] + if DataManager.EquipData:hasEquipRedPoint(cfg.position) then + return true + end + end + end return false end diff --git a/lua/app/userdata/hero/hero_entity.lua b/lua/app/userdata/hero/hero_entity.lua index 1f5b9f04..4884c5b8 100644 --- a/lua/app/userdata/hero/hero_entity.lua +++ b/lua/app/userdata/hero/hero_entity.lua @@ -337,7 +337,6 @@ function HeroEntity:setLv(lv, onlyChangeLv) return end self.isNew = lv == 1 - self.oldLv = self.data.lv self.data.lv = lv self:_updateAllBaseAttr() self:setDirty() @@ -614,7 +613,7 @@ function HeroEntity:getUnlockRogueId() end function HeroEntity:checkSkillUnlock() - if not self.oldLv then + if not self.oldStar then return false end local needPop = false @@ -624,7 +623,7 @@ function HeroEntity:checkSkillUnlock() local ids = self.config["rouge_skill_" .. i] if ids then for ii = #ids, 1, -1 do - if self.data.lv >= ids[ii][1] and self.oldLv < ids[ii][1] then + if self.data.star >= ids[ii][1] and self.oldStar < ids[ii][1] then skillIdx = i needPop = true isUnlock = ii == 1 @@ -638,7 +637,7 @@ function HeroEntity:checkSkillUnlock() break end end - self.oldLv = nil + self.oldStar = nil return needPop, isUnlock, skillIdx end @@ -802,6 +801,7 @@ function HeroEntity:canStarUp(showToast) end function HeroEntity:onHeroStarUp() + self.oldStar = self.data.star self.data.star = self.data.star + 1 self:setBaseAttrDirty() self:setDirty()