From efd60150c99fab6797edf0d01888e01f3a353c7b Mon Sep 17 00:00:00 2001 From: puxuan <413323644@qq.com> Date: Wed, 5 Nov 2025 17:26:02 +0800 Subject: [PATCH] fix bug --- lua/app/ui/company/company_comp.lua | 13 +++++++++++++ lua/app/ui/hero/hero_detail_ui.lua | 12 ++++++++++++ lua/app/ui/main_city/main_city_ui.lua | 10 ++++++++++ lua/app/userdata/talent/talent_data.lua | 15 +++++++++++++++ 4 files changed, 50 insertions(+) diff --git a/lua/app/ui/company/company_comp.lua b/lua/app/ui/company/company_comp.lua index 6bb2782c..7bf2f01a 100644 --- a/lua/app/ui/company/company_comp.lua +++ b/lua/app/ui/company/company_comp.lua @@ -9,9 +9,22 @@ function CompanyComp:init() self.talentBtn:addClickListener(function() ModuleManager.TalentManager:showMainUI() end) + + self:bind(DataManager.TalentData, "isDirty", function() + self:refreshRedPoint() + end) end function CompanyComp:refresh() + self:refreshRedPoint() +end + +function CompanyComp:refreshRedPoint() + if DataManager.TalentData:showRedPoint() then + self.talentBtn:addRedPoint(60, 80, 1) + else + self.talentBtn:removeRedPoint() + end end return CompanyComp \ No newline at end of file diff --git a/lua/app/ui/hero/hero_detail_ui.lua b/lua/app/ui/hero/hero_detail_ui.lua index 2673713b..15cd3569 100644 --- a/lua/app/ui/hero/hero_detail_ui.lua +++ b/lua/app/ui/hero/hero_detail_ui.lua @@ -39,6 +39,15 @@ function HeroDetailUI:ctor(parmas) end self.curLevel = self.heroEntity:getLv() self:initList() + self:checkPage() +end + +function HeroDetailUI:checkPage() + if self.heroEntity:showRedPoint(GConst.HeroConst.PANEL_TYPE.STAR, self.formationType) then + self.page = GConst.HeroConst.PANEL_TYPE.STAR + elseif self.heroEntity:showRedPoint(GConst.HeroConst.PANEL_TYPE.EQUIP, self.formationType) then + self.page = GConst.HeroConst.PANEL_TYPE.EQUIP + end end function HeroDetailUI:onLoadRootComplete() @@ -74,6 +83,9 @@ function HeroDetailUI:onLoadRootComplete() self.bg4Vfx01 = uiMap["hero_detail_ui.top.attr_node.bg_4.vfx_c1_ui_up_b01"] self.bg5Vfx01 = uiMap["hero_detail_ui.top.attr_node.bg_5.vfx_c1_ui_up_b01"] self.bg6Vfx01 = uiMap["hero_detail_ui.top.attr_node.bg_6.vfx_c1_ui_up_b01"] + self.bg4Vfx01:setActive(false) + self.bg5Vfx01:setActive(false) + self.bg6Vfx01:setActive(false) self.bg5:addClickListener(function() UIManager:showUI("app/ui/hero/hero_attr_ui", {heroEntity = self.heroEntity}) end) diff --git a/lua/app/ui/main_city/main_city_ui.lua b/lua/app/ui/main_city/main_city_ui.lua index a64a24b9..d09967ba 100644 --- a/lua/app/ui/main_city/main_city_ui.lua +++ b/lua/app/ui/main_city/main_city_ui.lua @@ -259,6 +259,10 @@ function MainCityUI:_bind() self:refreshSettingBtn() end) + self:bind(DataManager.TalentData, "isDirty", function() + self:refreshBottomRp() + end) + self:bind(DataManager.ShopData, "isDirty", function() if self.selectedIndex == GConst.MainCityConst.BOTTOM_PAGE.SHOP and self.subComps[self.selectedIndex] then if self.subComps[self.selectedIndex] then @@ -601,6 +605,12 @@ function MainCityUI:refreshBottomRp() else shopRpObj:removeRedPoint() end + local companyRpObj = uiMap["main_ui.bottom_node.icons.ui_spine_obj_4.rp_node"] + if DataManager.TalentData:showRedPoint() then + companyRpObj:addRedPoint(0, 0, 1) + else + companyRpObj:removeRedPoint() + end end function MainCityUI:refreshSettingBtn() diff --git a/lua/app/userdata/talent/talent_data.lua b/lua/app/userdata/talent/talent_data.lua index faf2008c..c212009e 100644 --- a/lua/app/userdata/talent/talent_data.lua +++ b/lua/app/userdata/talent/talent_data.lua @@ -189,4 +189,19 @@ function TalentData:getExpAdd() return lv * (cfg.value or 0) end --@endregion + +--@region 红点 +function TalentData:showRedPoint() + local stage = self:getStage() + local cfg = self:getPlayerExpCfgList(stage) + if not GFunc.checkCost(cfg.cost.id, cfg.cost.num) then + return false + end + local can = self:checkStage() + if not can then + return false + end + return true +end +--@endregion return TalentData \ No newline at end of file