require("Base/BasePanel") RoleTalentPopup = Inherit(BasePanel) local heroConfig,breakId,upStarId local breakSkillDataList = {} local upStarSkillDataList = {} local passiveSkillLogicConfig=ConfigManager.GetConfig(ConfigName.PassiveSkillLogicConfig) local passiveSkillConfig=ConfigManager.GetConfig(ConfigName.PassiveSkillConfig) local heroRankupConfig=ConfigManager.GetConfig(ConfigName.HeroRankupConfig) --初始化组件(用于子类重写) function RoleTalentPopup:InitComponent() self.breakSkillGoList = {} self.upStarSkillGoList = {} self.BackMask = Util.GetGameObject(self.transform, "BackMask") self.breakOpenSkill =Util.GetGameObject(self.transform, "bg/breakOpenSkill") self.upStarOpenSkill =Util.GetGameObject(self.transform, "bg/upStarOpenSkill") self.breakSkillTextPre =Util.GetGameObject(self.transform, "bg/breakSkillTextPre") self.breakOpenSkillGrid =Util.GetGameObject(self.transform, "bg/breakOpenSkill/Mask") self.upStarSkillTextPre =Util.GetGameObject(self.transform, "bg/upStarSkillTextPre") self.upStarOpenSkill =Util.GetGameObject(self.transform, "bg/upStarOpenSkill/Mask") end --绑定事件(用于子类重写) function RoleTalentPopup:BindEvent() Util.AddClick(self.BackMask, function() self:ClosePanel() end) end --添加事件监听(用于子类重写) function RoleTalentPopup:AddListener() end --移除事件监听(用于子类重写) function RoleTalentPopup:RemoveListener() end --界面打开时调用(用于子类重写) --传三个参数 是因为图鉴也要用 function RoleTalentPopup:OnOpen(_heroConfig,_breakId,_upStarId) heroConfig = _heroConfig breakId = _breakId upStarId = _upStarId end --界面打开或者重新打开后,界面刷新时调用(用于子类重写) function RoleTalentPopup:OnShow() self:GetTalentDataShow() end function RoleTalentPopup:GetTalentDataShow() breakSkillDataList = {} upStarSkillDataList = {} if heroConfig.OpenPassiveSkillRules then for i = 1, #heroConfig.OpenPassiveSkillRules do if heroConfig.OpenPassiveSkillRules[i][1] == 1 then--突破 local titleStr = NumToSimplenessFont[heroRankupConfig[heroConfig.OpenPassiveSkillRules[i][2]].Phase[2]] .. Language[11864] local curBreakId = heroConfig.OpenPassiveSkillRules[i][2] if breakId >= curBreakId then if breakSkillDataList[curBreakId] then breakSkillDataList[curBreakId] = {index = curBreakId,str = breakSkillDataList[curBreakId].str .. "  "..passiveSkillConfig[heroConfig.OpenPassiveSkillRules[i][3]].Desc..""} else breakSkillDataList[curBreakId] = {index = curBreakId,str =""..titleStr..passiveSkillConfig[heroConfig.OpenPassiveSkillRules[i][3]].Desc..""} end else if breakSkillDataList[curBreakId] then breakSkillDataList[curBreakId] = {index = curBreakId,str =breakSkillDataList[curBreakId].str .. " "..passiveSkillConfig[heroConfig.OpenPassiveSkillRules[i][3]].Desc..""} else breakSkillDataList[curBreakId] = {index = curBreakId,str =""..titleStr..passiveSkillConfig[heroConfig.OpenPassiveSkillRules[i][3]].Desc..""} end end else--升星 local curUpStarId = heroConfig.OpenPassiveSkillRules[i][2] local titleStr = NumToSimplenessFont[heroRankupConfig[curUpStarId].Phase[2]] .. Language[11865] local _passiveSkillId = passiveSkillConfig[heroConfig.OpenPassiveSkillRules[i][3]].Id if upStarId >= curUpStarId then if upStarSkillDataList[curUpStarId] then upStarSkillDataList[curUpStarId] = {passiveSkillId = _passiveSkillId,index = curUpStarId,str = upStarSkillDataList[curUpStarId].str .. "  "..passiveSkillConfig[heroConfig.OpenPassiveSkillRules[i][3]].Desc..""} else upStarSkillDataList[curUpStarId] = {passiveSkillId = _passiveSkillId,index = curUpStarId,str =""..titleStr..passiveSkillConfig[heroConfig.OpenPassiveSkillRules[i][3]].Desc..""} end else if upStarSkillDataList[curUpStarId] then upStarSkillDataList[curUpStarId] = {passiveSkillId = _passiveSkillId,index = curUpStarId,str =upStarSkillDataList[curUpStarId].str .. " "..passiveSkillConfig[heroConfig.OpenPassiveSkillRules[i][3]].Desc..""} else upStarSkillDataList[curUpStarId] = {passiveSkillId = _passiveSkillId,index = curUpStarId,str =""..titleStr..passiveSkillConfig[heroConfig.OpenPassiveSkillRules[i][3]].Desc..""} end end end end end local breakSkillDataList2 = {} for i, v in pairs(breakSkillDataList) do table.insert(breakSkillDataList2,v) end table.sort(breakSkillDataList2, function(a,b) return a.index