This commit is contained in:
puxuan 2025-11-05 17:26:02 +08:00
parent f3dcc3f735
commit efd60150c9
4 changed files with 50 additions and 0 deletions

View File

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

View File

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

View File

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

View File

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