c1_lua/lua/app/ui/company/company_comp.lua
2025-11-05 17:26:02 +08:00

30 lines
775 B
Lua

local CompanyComp = class("CompanyComp", LuaComponent)
function CompanyComp:init()
self.uiMap = self:getBaseObject():genAllChildren()
self.talentBtn = self.uiMap["company_comp.talent_btn"]
self.talentBtnTx = self.uiMap["company_comp.talent_btn.text"]
self.talentBtnTx:setText(I18N:getGlobalText(I18N.GlobalConst.TALENT_DESC_1))
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