2021-04-21 13:12:04 +08:00
|
|
|
|
require("Base/BasePanel")
|
2021-04-08 17:24:36 +08:00
|
|
|
|
HandBookRoleInfoLayout = Inherit(BasePanel)
|
2021-04-15 19:54:30 +08:00
|
|
|
|
local this = HandBookRoleInfoLayout
|
2021-04-08 17:24:36 +08:00
|
|
|
|
local heroConFigData
|
|
|
|
|
|
|
|
|
|
local propertyConfig = ConfigManager.GetConfig(ConfigName.PropertyConfig)
|
|
|
|
|
local heroLevelConfig = ConfigManager.GetConfig(ConfigName.HeroLevelConfig)
|
|
|
|
|
local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig)
|
|
|
|
|
local allAddProVal = {}
|
2022-01-15 17:12:40 +08:00
|
|
|
|
local allBtns={}
|
2021-04-08 17:24:36 +08:00
|
|
|
|
local breakId,upStarId
|
2022-01-15 17:12:40 +08:00
|
|
|
|
local orginLayer=0
|
2021-04-08 17:24:36 +08:00
|
|
|
|
--初始化组件(用于子类重写)
|
2021-04-15 19:54:30 +08:00
|
|
|
|
|
|
|
|
|
function HandBookRoleInfoLayout:New(gameObject)
|
|
|
|
|
local b = {}
|
|
|
|
|
b.gameObject = gameObject
|
|
|
|
|
b.transform = gameObject.transform
|
|
|
|
|
setmetatable(b, { __index = HandBookRoleInfoLayout })
|
|
|
|
|
return b
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function HandBookRoleInfoLayout:InitComponent()
|
2021-04-21 13:12:04 +08:00
|
|
|
|
this.spLoader = SpriteLoader.New()
|
2021-04-21 16:36:12 +08:00
|
|
|
|
--LogGreen("self.gameObject:"..tostring(self.gameObject))
|
2021-04-08 17:24:36 +08:00
|
|
|
|
--详情
|
2023-09-04 18:27:40 +08:00
|
|
|
|
Util.GetGameObject(self.gameObject,"pro/bg/proPre1/proName"):GetComponent("Text").text = GetLanguageStrById(propertyConfig[2].Info)
|
|
|
|
|
Util.GetGameObject(self.gameObject,"pro/bg/proPre2/proName"):GetComponent("Text").text = GetLanguageStrById(propertyConfig[1].Info)
|
|
|
|
|
Util.GetGameObject(self.gameObject,"pro/bg/proPre3/proName"):GetComponent("Text").text = GetLanguageStrById(propertyConfig[3].Info)
|
|
|
|
|
Util.GetGameObject(self.gameObject,"pro/bg/proPre4/proName"):GetComponent("Text").text = GetLanguageStrById(propertyConfig[4].Info)
|
2021-04-15 19:54:30 +08:00
|
|
|
|
|
2023-09-04 18:27:40 +08:00
|
|
|
|
self.atkPro=Util.GetGameObject(self.gameObject,"pro/bg/proPre1/proValue"):GetComponent("Text")
|
|
|
|
|
self.hpPro=Util.GetGameObject(self.gameObject,"pro/bg/proPre2/proValue"):GetComponent("Text")
|
|
|
|
|
self.phyDef=Util.GetGameObject(self.gameObject,"pro/bg/proPre3/proValue"):GetComponent("Text")
|
|
|
|
|
self.magDef=Util.GetGameObject(self.gameObject,"pro/bg/proPre4/proValue"):GetComponent("Text")
|
|
|
|
|
self.allProButton=Util.GetGameObject(self.gameObject,"pro/allProButton")
|
2021-04-15 19:54:30 +08:00
|
|
|
|
|
2023-09-04 18:27:40 +08:00
|
|
|
|
self.skillGrid=Util.GetGameObject(self.gameObject,"skill")
|
2022-05-19 16:38:52 +08:00
|
|
|
|
self.skillGrid2=Util.GetGameObject(self.gameObject,"skill2")
|
2022-01-14 18:49:49 +08:00
|
|
|
|
self.line1=Util.GetGameObject(self.skillGrid,"line1")
|
2023-09-04 18:27:40 +08:00
|
|
|
|
self.line2=Util.GetGameObject(self.skillGrid,"line2")
|
2022-01-15 17:12:40 +08:00
|
|
|
|
self.line3=Util.GetGameObject(self.gameObject,"skillBtns/line3")
|
|
|
|
|
self.line4=Util.GetGameObject(self.gameObject,"skillBtns/line4")
|
2022-01-11 18:11:13 +08:00
|
|
|
|
self.selsectSkillImage=Util.GetGameObject(self.gameObject,"selsectSkillImage")
|
2022-01-17 14:26:17 +08:00
|
|
|
|
self.posBtn= Util.GetGameObject(self.gameObject,"dingwei")
|
2023-09-04 18:27:40 +08:00
|
|
|
|
self.posTxt=Util.GetGameObject(self.gameObject,"dingwei/PosInfo"):GetComponent("Text")
|
2022-01-14 18:49:49 +08:00
|
|
|
|
self.lvTxt=Util.GetGameObject(self.gameObject,"lvObj/lvTxt"):GetComponent("Text")
|
2024-02-19 18:15:23 +08:00
|
|
|
|
self.proImg=Util.GetGameObject(self.gameObject,"PosImage"):GetComponent("Image")
|
|
|
|
|
self.proTxt=Util.GetGameObject(self.gameObject,"PosText2"):GetComponent("Text")
|
2022-01-15 17:12:40 +08:00
|
|
|
|
self.btnsLayer=Util.GetGameObject(self.gameObject,"skillBtns"):GetComponent("Canvas")
|
|
|
|
|
allBtns={}
|
|
|
|
|
for i = 1, 6 do
|
|
|
|
|
local btn=Util.GetGameObject(self.gameObject,"skillBtns/sBg"..i)
|
|
|
|
|
btn.gameObject:SetActive(false)
|
|
|
|
|
table.insert(allBtns,btn)
|
|
|
|
|
end
|
|
|
|
|
|
2022-01-11 18:11:13 +08:00
|
|
|
|
|
2021-04-08 17:24:36 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--绑定事件(用于子类重写)
|
|
|
|
|
function HandBookRoleInfoLayout:BindEvent()
|
|
|
|
|
Util.AddClick(self.allProButton, function()
|
2021-05-12 17:40:38 +08:00
|
|
|
|
UIManager.OpenPanel(UIName.RoleProInfoPopup,allAddProVal,heroConFigData,false,nil)
|
2021-04-08 17:24:36 +08:00
|
|
|
|
end)
|
2022-01-11 18:11:13 +08:00
|
|
|
|
|
|
|
|
|
|
2021-04-08 17:24:36 +08:00
|
|
|
|
end
|
2022-05-19 16:38:52 +08:00
|
|
|
|
local curStar
|
2021-04-08 17:24:36 +08:00
|
|
|
|
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
|
|
|
|
|
function HandBookRoleInfoLayout:OnShow(sortingOrder,parent,_heroConFigData,_curStar)
|
2021-04-15 19:54:30 +08:00
|
|
|
|
self.gameObject:SetActive(true)
|
|
|
|
|
end
|
|
|
|
|
|
2022-01-11 18:11:13 +08:00
|
|
|
|
function HandBookRoleInfoLayout:SetData(sortingOrder,parent,_heroConFigData,_curStar,_lv)
|
2021-04-08 17:24:36 +08:00
|
|
|
|
self.sortingOrder = sortingOrder
|
2022-01-15 17:12:40 +08:00
|
|
|
|
orginLayer=self.sortingOrder+2
|
|
|
|
|
self.btnsLayer.sortingOrder=orginLayer
|
2021-04-08 17:24:36 +08:00
|
|
|
|
heroConFigData = _heroConFigData
|
2022-05-19 16:38:52 +08:00
|
|
|
|
curStar=_curStar
|
2021-04-08 17:24:36 +08:00
|
|
|
|
if _curStar and _curStar > 5 then
|
2022-01-11 18:11:13 +08:00
|
|
|
|
self:OnShowHeroData(2,_curStar,_lv)
|
2021-04-08 17:24:36 +08:00
|
|
|
|
else
|
2022-01-11 18:11:13 +08:00
|
|
|
|
self:OnShowHeroData(1,heroConFigData.Star,_lv)
|
2021-04-08 17:24:36 +08:00
|
|
|
|
end
|
|
|
|
|
end
|
2021-04-15 19:54:30 +08:00
|
|
|
|
|
|
|
|
|
|
2022-01-15 17:12:40 +08:00
|
|
|
|
local CurrOpenPanel=nil
|
|
|
|
|
local currPanelName=0
|
|
|
|
|
|
2021-04-08 17:24:36 +08:00
|
|
|
|
--展示英雄信息 第一个参数 1初始 2 6星和10星 第三个参数 显示星级
|
2022-01-11 18:11:13 +08:00
|
|
|
|
function HandBookRoleInfoLayout:OnShowHeroData(_starType,star,_lv)
|
|
|
|
|
local lv=0
|
|
|
|
|
local rankUpConfig=ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.HeroRankupConfig,"Type",2,"OpenStar",star)
|
|
|
|
|
if rankUpConfig then
|
|
|
|
|
lv=rankUpConfig.OpenLevel
|
|
|
|
|
else
|
|
|
|
|
if star==1 then
|
|
|
|
|
lv=40
|
|
|
|
|
elseif star==2 then
|
|
|
|
|
lv=50
|
|
|
|
|
elseif star==3 then
|
|
|
|
|
lv=60
|
|
|
|
|
elseif star==4 then
|
|
|
|
|
lv=80
|
|
|
|
|
else
|
|
|
|
|
lv=1
|
|
|
|
|
end
|
|
|
|
|
end
|
2021-04-08 17:24:36 +08:00
|
|
|
|
--计算面板属性
|
2022-01-11 18:11:13 +08:00
|
|
|
|
allAddProVal=self:CalculateHeroAllProValList(_starType,star,lv)
|
2021-04-08 17:24:36 +08:00
|
|
|
|
self.atkPro.text=allAddProVal[HeroProType.Attack]
|
|
|
|
|
self.hpPro.text=allAddProVal[HeroProType.Hp]
|
|
|
|
|
self.phyDef.text=allAddProVal[HeroProType.PhysicalDefence]
|
|
|
|
|
self.magDef.text=allAddProVal[HeroProType.MagicDefence]
|
2022-01-14 18:49:49 +08:00
|
|
|
|
self.lvTxt.text= " "..lv
|
2022-01-11 18:11:13 +08:00
|
|
|
|
self.posTxt.text=star >= HeroManager.awakeNextStarIndex and GetLanguageStrById(heroConFigData.HeroLocationDesc4) or GetLanguageStrById(heroConFigData.HeroLocationDesc1)
|
2022-01-14 18:49:49 +08:00
|
|
|
|
self.proImg.sprite=this.spLoader:LoadSprite(GetHeroPosStr(heroConFigData.Profession))
|
|
|
|
|
self.proTxt.text=GetLanguageStrById(heroConFigData.HeroLocation)
|
2021-04-08 17:24:36 +08:00
|
|
|
|
--技能点击特殊处理
|
2022-01-14 18:49:49 +08:00
|
|
|
|
self.posTxt.gameObject:SetActive(heroConFigData.ShowHeroLocation==1)
|
|
|
|
|
self.posBtn.gameObject:SetActive(heroConFigData.ShowHeroLocation==1)
|
2021-04-08 17:24:36 +08:00
|
|
|
|
self.selsectSkillImage:SetActive(false)
|
2023-09-04 18:27:40 +08:00
|
|
|
|
-- self.skillGrid:GetComponent("Canvas").sortingOrder = self.sortingOrder + 1
|
2021-04-08 17:24:36 +08:00
|
|
|
|
local triggerCallBack
|
2022-01-14 18:49:49 +08:00
|
|
|
|
local skillList = HeroManager.GetCurHeroSkillDatasAndEquip(heroConFigData.Id,star)
|
|
|
|
|
--local awakeSkillList=HeroManager.GetCurHeroAllAwakeSkillDatas(heroConFigData.Id,star)
|
2021-04-08 17:24:36 +08:00
|
|
|
|
for i = 1, self.skillGrid.transform.childCount do
|
|
|
|
|
self.skillGrid.transform:GetChild(i-1).gameObject:SetActive(false)
|
|
|
|
|
end
|
2022-01-15 17:12:40 +08:00
|
|
|
|
for i = 1, 6 do
|
|
|
|
|
allBtns[i].gameObject:SetActive(false)
|
|
|
|
|
end
|
2022-01-14 18:49:49 +08:00
|
|
|
|
local len=#skillList
|
|
|
|
|
local btnCount=len
|
|
|
|
|
if heroConFigData.OpenPassiveSkillRules then
|
|
|
|
|
btnCount=btnCount+1
|
|
|
|
|
local passObj=Util.GetGameObject(self.skillGrid,"sBg"..len+1)--self.skillGrid.transform:GetChild(len).gameObject
|
|
|
|
|
passObj:SetActive(true)
|
2022-01-15 17:12:40 +08:00
|
|
|
|
allBtns[len+1].gameObject:SetActive(true)
|
2023-09-04 18:27:40 +08:00
|
|
|
|
Util.GetGameObject(passObj,"icon"):GetComponent("Image").sprite=this.spLoader:LoadSprite(GetTianFuIcon(star))
|
2022-01-18 11:44:36 +08:00
|
|
|
|
Util.GetGameObject(passObj,"frame"):SetActive(false)
|
2022-01-14 18:49:49 +08:00
|
|
|
|
local aaa=5
|
2022-01-18 11:44:36 +08:00
|
|
|
|
if star>=9 then
|
2022-01-14 18:49:49 +08:00
|
|
|
|
if star>=11 then
|
2022-01-18 11:44:36 +08:00
|
|
|
|
Util.GetGameObject(passObj,"frame"):SetActive(true)
|
2022-01-14 18:49:49 +08:00
|
|
|
|
aaa=7
|
|
|
|
|
else
|
2022-01-18 11:44:36 +08:00
|
|
|
|
aaa=star-3
|
2022-01-14 18:49:49 +08:00
|
|
|
|
end
|
|
|
|
|
end
|
2022-01-15 17:12:40 +08:00
|
|
|
|
|
2023-09-04 18:27:40 +08:00
|
|
|
|
Util.GetGameObject(passObj,"pos/icon"):GetComponent("Image").sprite=this.spLoader:LoadSprite(SkillIconType[aaa])
|
|
|
|
|
Util.GetGameObject(passObj,"pos/icon"):GetComponent("Image"):SetNativeSize()
|
2022-01-14 18:49:49 +08:00
|
|
|
|
local OpenPassiveSkillRules = star >= HeroManager.awakeNextStarIndex and heroConFigData.Awaken or heroConFigData.OpenPassiveSkillRules
|
2022-02-10 17:52:40 +08:00
|
|
|
|
OpenPassiveSkillRules=GetPassiveByMaxStar(heroConFigData,OpenPassiveSkillRules)
|
2022-01-14 18:49:49 +08:00
|
|
|
|
local openlists,compoundOpenNum,compoundNum = HeroManager.GetAllPassiveSkillIds(heroConFigData,breakId,upStarId)
|
2022-01-21 13:55:17 +08:00
|
|
|
|
if star==11 then
|
|
|
|
|
Util.GetGameObject(passObj,"Text"):GetComponent("Text").text = #openlists - compoundOpenNum .."/"..10
|
|
|
|
|
else
|
|
|
|
|
Util.GetGameObject(passObj,"Text"):GetComponent("Text").text = #openlists - compoundOpenNum .."/"..#OpenPassiveSkillRules - compoundNum
|
|
|
|
|
end
|
2022-01-15 17:12:40 +08:00
|
|
|
|
Util.AddOnceClick(allBtns[len+1],function()
|
|
|
|
|
|
|
|
|
|
UIManager.ClosePanel(currPanelName)
|
2022-01-14 18:49:49 +08:00
|
|
|
|
if star==11 then
|
2022-01-15 17:12:40 +08:00
|
|
|
|
CurrOpenPanel=UIManager.OpenPanel(UIName.RoleAwakeTalentPopup,heroConFigData)
|
|
|
|
|
currPanelName=UIName.RoleAwakeTalentPopup
|
2022-01-14 18:49:49 +08:00
|
|
|
|
else
|
2022-01-15 17:12:40 +08:00
|
|
|
|
CurrOpenPanel=UIManager.OpenPanel(UIName.RoleTalentPopup,heroConFigData,breakId,upStarId)
|
|
|
|
|
currPanelName=UIName.RoleTalentPopup
|
2022-01-14 18:49:49 +08:00
|
|
|
|
end
|
2022-01-15 17:12:40 +08:00
|
|
|
|
self.selsectSkillImage:SetActive(true)
|
|
|
|
|
self.selsectSkillImage.transform.position=Util.GetGameObject(self.skillGrid,"sBg"..len+1 .."/s").transform.position
|
|
|
|
|
self.selsectSkillImage.transform:SetParent(Util.GetGameObject(self.skillGrid,"sBg"..len+1 .."/s").transform)
|
|
|
|
|
self:SetBtnsLayer()
|
2022-01-14 18:49:49 +08:00
|
|
|
|
end)
|
|
|
|
|
end
|
2022-01-17 14:26:17 +08:00
|
|
|
|
if ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.shenhun) and heroConFigData.IsSoulOpen == 1 and star > 10 then
|
2022-01-14 18:49:49 +08:00
|
|
|
|
btnCount=btnCount+1
|
|
|
|
|
local passObj=Util.GetGameObject(self.skillGrid,"sBg"..len+2)--self.skillGrid.transform:GetChild(len+1).gameObject
|
|
|
|
|
passObj:SetActive(true)
|
2022-01-15 17:12:40 +08:00
|
|
|
|
allBtns[len+2].gameObject:SetActive(true)
|
2022-01-14 18:49:49 +08:00
|
|
|
|
Util.GetGameObject(passObj,"s"):GetComponent("Image").sprite=this.spLoader:LoadSprite("r_tongyong_shenhun_icon")
|
2023-09-04 18:27:40 +08:00
|
|
|
|
Util.GetGameObject(passObj,"skillName"):SetActive(false)
|
|
|
|
|
Util.GetGameObject(passObj,"pos/icon"):GetComponent("Image").sprite=this.spLoader:LoadSprite(SkillIconType[9])
|
|
|
|
|
Util.GetGameObject(passObj,"pos/icon"):GetComponent("Image"):SetNativeSize()
|
2022-01-15 17:12:40 +08:00
|
|
|
|
Util.AddOnceClick(allBtns[len+2],function()
|
|
|
|
|
UIManager.ClosePanel(currPanelName)
|
|
|
|
|
|
|
|
|
|
CurrOpenPanel=UIManager.OpenPanel(UIName.RoleGodSoulLayout,heroConFigData,star)
|
|
|
|
|
self.selsectSkillImage:SetActive(true)
|
|
|
|
|
self.selsectSkillImage.transform.position=Util.GetGameObject(self.skillGrid,"sBg"..len+2 .."/s").transform.position
|
|
|
|
|
self.selsectSkillImage.transform:SetParent(Util.GetGameObject(self.skillGrid,"sBg"..len+2 .."/s").transform)
|
|
|
|
|
currPanelName=UIName.RoleGodSoulLayout
|
|
|
|
|
self:SetBtnsLayer()
|
2022-01-14 18:49:49 +08:00
|
|
|
|
end)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
for i = 1, len do
|
2022-01-11 18:11:13 +08:00
|
|
|
|
--and GetLanguageStrById(skillList[i].skillConfig.Name)
|
|
|
|
|
if skillList[i] and skillList[i].skillConfig then
|
2022-01-14 18:49:49 +08:00
|
|
|
|
local go = Util.GetGameObject(self.skillGrid,"sBg"..i) --self.skillGrid.transform:GetChild(i-1).gameObject
|
2021-04-08 17:24:36 +08:00
|
|
|
|
go:SetActive(true)
|
2022-01-15 17:12:40 +08:00
|
|
|
|
allBtns[i].gameObject:SetActive(true)
|
2023-09-04 18:27:40 +08:00
|
|
|
|
--local line=Util.GetGameObject(go.transform,"line")
|
|
|
|
|
--line:SetActive(false)
|
|
|
|
|
--local bg=Util.GetGameObject(go.transform,"Image"):GetComponent("Image")
|
2022-01-18 11:44:36 +08:00
|
|
|
|
Util.GetGameObject(go.transform,"frame"):SetActive(false)
|
2023-09-04 18:27:40 +08:00
|
|
|
|
Util.GetGameObject(go.transform,"icon"):GetComponent("Image").sprite=this.spLoader:LoadSprite(GetResourcePath(skillList[i].skillConfig.Icon))
|
|
|
|
|
--Util.GetGameObject(go.transform,"skillName"):SetActive(false)
|
2022-01-14 18:49:49 +08:00
|
|
|
|
local index=i
|
|
|
|
|
if index==3 then
|
2023-09-04 18:27:40 +08:00
|
|
|
|
Util.GetGameObject(go.transform,"pos/icon"):GetComponent("Image").sprite=this.spLoader:LoadSprite(SkillIconType[4])
|
2021-04-08 17:24:36 +08:00
|
|
|
|
else
|
2023-09-04 18:27:40 +08:00
|
|
|
|
Util.GetGameObject(go.transform,"pos/icon"):GetComponent("Image").sprite=this.spLoader:LoadSprite(GetSkillType(skillList[i]))
|
2021-04-08 17:24:36 +08:00
|
|
|
|
end
|
2023-09-04 18:27:40 +08:00
|
|
|
|
Util.GetGameObject(go.transform,"pos/icon"):GetComponent("Image"):SetNativeSize()
|
2022-01-14 18:49:49 +08:00
|
|
|
|
local di=Util.GetGameObject(go.transform,"pro"):GetComponent("Image")
|
|
|
|
|
local diTxt=Util.GetGameObject(go.transform,"pro/Text"):GetComponent("Text")
|
|
|
|
|
if skillList[i].skillConfig.Skilltips and skillList[i].skillConfig.Skilltips > 0 then
|
|
|
|
|
if skillList[i].skillConfig.Skilltips == 6 then
|
|
|
|
|
di.sprite=this.spLoader:LoadSprite("r_hero_lvdi")--被动技
|
|
|
|
|
else
|
|
|
|
|
di.sprite=this.spLoader:LoadSprite("r_hero_hongdi")--被动技
|
2021-04-08 17:24:36 +08:00
|
|
|
|
end
|
2022-01-14 18:49:49 +08:00
|
|
|
|
di.gameObject:SetActive(true)
|
|
|
|
|
di:SetNativeSize()
|
|
|
|
|
diTxt.text=SkillProType[skillList[i].skillConfig.Skilltips]
|
|
|
|
|
else
|
|
|
|
|
di.gameObject:SetActive(false)
|
|
|
|
|
end
|
2022-01-15 17:12:40 +08:00
|
|
|
|
Util.AddOnceClick(allBtns[i], function()
|
2021-04-08 17:24:36 +08:00
|
|
|
|
local skillData = {}
|
|
|
|
|
skillData.skillConfig = skillList[i].skillConfig
|
|
|
|
|
local maxLv= HeroManager.GetHeroSkillMaxLevel(heroConFigData.Id,skillData.skillConfig.Type)
|
2022-01-14 18:49:49 +08:00
|
|
|
|
|
2022-01-15 14:32:55 +08:00
|
|
|
|
if index~=3 then
|
2022-01-14 18:49:49 +08:00
|
|
|
|
if Game.GlobalEvent:HasEvent(GameEvent.UI.OnClose, triggerCallBack) then
|
2021-04-08 17:24:36 +08:00
|
|
|
|
Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnClose, triggerCallBack)
|
|
|
|
|
end
|
2022-01-15 17:12:40 +08:00
|
|
|
|
-- if currPanelName~= UIName.SkillInfoPopup then
|
|
|
|
|
UIManager.ClosePanel(currPanelName)
|
|
|
|
|
-- end
|
|
|
|
|
|
|
|
|
|
self.selsectSkillImage.transform.position=Util.GetGameObject(go.transform,"s").transform.position
|
|
|
|
|
self.selsectSkillImage.transform:SetParent(Util.GetGameObject(go.transform,"s").transform)
|
2022-01-14 18:49:49 +08:00
|
|
|
|
local panel = UIManager.OpenPanel(UIName.SkillInfoPopup,skillData,1,10,maxLv,i)
|
2022-01-15 17:12:40 +08:00
|
|
|
|
self.selsectSkillImage:SetActive(true)
|
|
|
|
|
CurrOpenPanel=panel
|
|
|
|
|
currPanelName=UIName.SkillInfoPopup
|
|
|
|
|
self:SetBtnsLayer()
|
|
|
|
|
--self.skillGrid:GetComponent("Canvas").sortingOrder = panel.sortingOrder + 1
|
|
|
|
|
|
2022-01-14 18:49:49 +08:00
|
|
|
|
else
|
2022-01-15 17:12:40 +08:00
|
|
|
|
UIManager.ClosePanel(currPanelName)
|
|
|
|
|
currPanelName=UIName.TalismanInfoPopup
|
|
|
|
|
CurrOpenPanel=UIManager.OpenPanel(UIName.TalismanInfoPopup,heroConFigData,1,1)
|
|
|
|
|
self.selsectSkillImage.transform.position=Util.GetGameObject(go.transform,"s").transform.position
|
|
|
|
|
self.selsectSkillImage.transform:SetParent(Util.GetGameObject(go.transform,"s").transform)
|
|
|
|
|
self.selsectSkillImage:SetActive(true)
|
|
|
|
|
self:SetBtnsLayer()
|
2021-04-08 17:24:36 +08:00
|
|
|
|
end
|
2022-01-14 18:49:49 +08:00
|
|
|
|
|
|
|
|
|
|
2021-04-08 17:24:36 +08:00
|
|
|
|
end)
|
2022-01-15 17:12:40 +08:00
|
|
|
|
triggerCallBack = function (panelType, p)
|
|
|
|
|
if panelType == UIName.SkillInfoPopup or panelType==currPanelName then --监听到SkillInfoPopup关闭,把层级设回去
|
|
|
|
|
--self.skillGrid:GetComponent("Canvas").sortingOrder = self.sortingOrder + 1
|
|
|
|
|
self.btnsLayer.sortingOrder=orginLayer+2
|
|
|
|
|
Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnClose, triggerCallBack)
|
|
|
|
|
--self.selsectSkillImage:SetActive(false)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
self:SetBtnsLayer()
|
|
|
|
|
Game.GlobalEvent:AddEvent(GameEvent.UI.OnClose, triggerCallBack)
|
2021-04-08 17:24:36 +08:00
|
|
|
|
end
|
|
|
|
|
end
|
2022-01-14 18:49:49 +08:00
|
|
|
|
if btnCount>2 then
|
|
|
|
|
self.line1:SetActive(true)
|
2022-01-15 17:12:40 +08:00
|
|
|
|
self.line3:SetActive(true)
|
2022-01-14 18:49:49 +08:00
|
|
|
|
else
|
|
|
|
|
self.line1:SetActive(false)
|
2022-01-15 17:12:40 +08:00
|
|
|
|
self.line3:SetActive(false)
|
2022-01-14 18:49:49 +08:00
|
|
|
|
end
|
|
|
|
|
if btnCount>4 then
|
|
|
|
|
self.line2:SetActive(true)
|
2022-01-15 17:12:40 +08:00
|
|
|
|
self.line4:SetActive(true)
|
2022-01-14 18:49:49 +08:00
|
|
|
|
else
|
|
|
|
|
self.line2:SetActive(false)
|
2022-01-15 17:12:40 +08:00
|
|
|
|
self.line4:SetActive(false)
|
2022-01-14 18:49:49 +08:00
|
|
|
|
end
|
|
|
|
|
Util.AddClick(self.posBtn, function()
|
2022-01-11 18:11:13 +08:00
|
|
|
|
UIManager.OpenPanel(UIName.RolePosInfoPopup,heroConFigData,star)
|
2021-04-08 17:24:36 +08:00
|
|
|
|
end)
|
2022-05-19 16:38:52 +08:00
|
|
|
|
self:SkillInfo()
|
2021-04-08 17:24:36 +08:00
|
|
|
|
end
|
|
|
|
|
|
2022-01-15 17:12:40 +08:00
|
|
|
|
function HandBookRoleInfoLayout:SetBtnsLayer()
|
|
|
|
|
if CurrOpenPanel then
|
|
|
|
|
self.btnsLayer.sortingOrder=CurrOpenPanel.sortingOrder + 1
|
|
|
|
|
end
|
|
|
|
|
end
|
2022-01-11 18:11:13 +08:00
|
|
|
|
|
2021-04-08 17:24:36 +08:00
|
|
|
|
--计算英雄属性 1 初始 2 指定星级 _starNum星级变化
|
2022-01-11 18:11:13 +08:00
|
|
|
|
function HandBookRoleInfoLayout:CalculateHeroAllProValList(_starType,_starNum,curLvNum)
|
2021-04-08 17:24:36 +08:00
|
|
|
|
local allAddProVal = {}
|
|
|
|
|
for i, v in ConfigPairs(propertyConfig) do
|
|
|
|
|
allAddProVal[i] = 0
|
|
|
|
|
end
|
|
|
|
|
breakId = 0
|
|
|
|
|
upStarId = 0
|
|
|
|
|
if _starType == 2 then
|
|
|
|
|
--等级
|
|
|
|
|
--解锁天赋
|
|
|
|
|
for i, v in ConfigPairs(ConfigManager.GetConfig(ConfigName.HeroRankupConfig)) do
|
|
|
|
|
if v.OpenStar == _starNum and v.Star==heroConFigData.Star then
|
|
|
|
|
if v.Type == 1 then
|
|
|
|
|
breakId = v.Id
|
|
|
|
|
end
|
|
|
|
|
if v.Type == 2 then
|
|
|
|
|
upStarId = v.Id
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
if breakId==0 then
|
|
|
|
|
breakId=6
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local allOpenPassiveSkillIds = HeroManager.GetAllPassiveSkillIds(heroConFigData, breakId, upStarId)
|
|
|
|
|
--单体加成 --单体等级限制加成 --团体加成 --减乘
|
|
|
|
|
local singleHeroProVal, lvProVal, allHeroProVal, specialProVal =
|
|
|
|
|
HeroManager.CalculatePassiveSkillsValList(WarPowerType.Hero, allOpenPassiveSkillIds)
|
|
|
|
|
|
|
|
|
|
HeroManager.DoubleTableCompound(allAddProVal, singleHeroProVal)
|
|
|
|
|
HeroManager.DoubleTableCompound(allAddProVal, lvProVal)
|
|
|
|
|
HeroManager.DoubleTableCompound(allAddProVal, allHeroProVal)
|
|
|
|
|
for k, v in pairs(allAddProVal) do
|
|
|
|
|
allAddProVal[k] = allAddProVal[k] / 100
|
|
|
|
|
end
|
|
|
|
|
allAddProVal[HeroProType.Attack]=HeroManager.CalculateProVal(heroConFigData.Attack, curLvNum, breakId,upStarId,HeroProType.Attack) + allAddProVal[HeroProType.Attack]
|
|
|
|
|
allAddProVal[HeroProType.Hp]=HeroManager.CalculateProVal(heroConFigData.Hp, curLvNum, breakId,upStarId,HeroProType.Hp) + allAddProVal[HeroProType.Hp]
|
|
|
|
|
allAddProVal[HeroProType.PhysicalDefence]=HeroManager.CalculateProVal(heroConFigData.PhysicalDefence, curLvNum, breakId,upStarId,HeroProType.PhysicalDefence) + allAddProVal[HeroProType.PhysicalDefence]
|
|
|
|
|
allAddProVal[HeroProType.MagicDefence]=HeroManager.CalculateProVal(heroConFigData.MagicDefence, curLvNum, breakId,upStarId,HeroProType.MagicDefence) + allAddProVal[HeroProType.MagicDefence]
|
|
|
|
|
--allAddProVal[HeroProType.Speed]= math.floor(((curSpeedFormulaData[1] * math.pow(breakId, 3) + curSpeedFormulaData[2] * math.pow(breakId, 2) + curSpeedFormulaData[3] * breakId + curSpeedFormulaData[4]) + heroConFigData.Speed * speedNum))
|
|
|
|
|
--for i = 1, #heroConFigData.SecondaryFactor do
|
|
|
|
|
-- local proId = heroConFigData.SecondaryFactor[i][1]
|
|
|
|
|
-- if propertyConfig[proId].Style ==2 then
|
|
|
|
|
-- allAddProVal[heroConFigData.SecondaryFactor[i][1]] = heroConFigData.SecondaryFactor[i][2]/10000
|
|
|
|
|
-- else
|
|
|
|
|
-- allAddProVal[heroConFigData.SecondaryFactor[i][1]] = heroConFigData.SecondaryFactor[i][2]
|
|
|
|
|
-- end
|
|
|
|
|
--end
|
|
|
|
|
|
|
|
|
|
|
2022-01-11 18:11:13 +08:00
|
|
|
|
|
2021-04-08 17:24:36 +08:00
|
|
|
|
for key, value in pairs(allAddProVal) do
|
|
|
|
|
allAddProVal[key] = math.floor(value)
|
|
|
|
|
end
|
|
|
|
|
return allAddProVal
|
|
|
|
|
end
|
|
|
|
|
function HandBookRoleInfoLayout:OnHide()
|
2021-04-15 19:54:30 +08:00
|
|
|
|
self.gameObject:SetActive(false)
|
2021-04-08 17:24:36 +08:00
|
|
|
|
end
|
|
|
|
|
|
2022-05-19 16:38:52 +08:00
|
|
|
|
function HandBookRoleInfoLayout:SkillInfo()
|
|
|
|
|
self.skillGrid2:GetComponent("Canvas").sortingOrder = self.sortingOrder + 1
|
2022-05-19 20:43:41 +08:00
|
|
|
|
local skillList = HeroManager.GetCurHeroSidAndCurStarAllSkillDatas2(heroConFigData.Id,heroConFigData.MaxRank)
|
|
|
|
|
local skillList2
|
|
|
|
|
local maxStar=heroConFigData.MaxRank
|
|
|
|
|
if maxStar>9 then
|
|
|
|
|
skillList2 = HeroManager.GetCurHeroSidAndCurStarAllSkillDatas2(heroConFigData.Id,10)
|
|
|
|
|
else
|
|
|
|
|
|
|
|
|
|
end
|
2022-05-19 16:38:52 +08:00
|
|
|
|
for i = 1, self.skillGrid2.transform.childCount do
|
|
|
|
|
self.skillGrid2.transform:GetChild(i-1).gameObject:SetActive(false)
|
|
|
|
|
end
|
|
|
|
|
for i = 1, #skillList do
|
|
|
|
|
if skillList[i] and skillList[i].skillConfig and GetLanguageStrById(skillList[i].skillConfig.Name) then
|
|
|
|
|
local go = self.skillGrid2.transform:GetChild(i-1).gameObject
|
|
|
|
|
go:SetActive(true)
|
2023-09-04 18:27:40 +08:00
|
|
|
|
Util.GetGameObject(go.transform,"icon"):GetComponent("Image").sprite=this.spLoader:LoadSprite(GetResourcePath(skillList[i].skillConfig.Icon))
|
2022-05-19 16:38:52 +08:00
|
|
|
|
|
2024-01-15 10:59:00 +08:00
|
|
|
|
-- local typeImg=Util.GetGameObject(go.transform,"pos/icon")
|
|
|
|
|
-- typeImg:GetComponent("Image").sprite=this.spLoader:LoadSprite(GetSkillType(skillList[i]))
|
|
|
|
|
local typeName=Util.GetGameObject(go.transform,"pos/icon/Text")
|
|
|
|
|
typeName:GetComponent("Text").text= GetSkillTypeDes(skillList[i])
|
2023-09-04 18:27:40 +08:00
|
|
|
|
local sText = Util.GetGameObject(go.transform,"skillName"):GetComponent("Text")
|
|
|
|
|
sText.text=GetLanguageStrById(skillList[i].skillConfig.Name)
|
|
|
|
|
-- sText.fontSize = GetCurLanguage() ~= 2 and 30 or 25
|
2022-05-19 16:38:52 +08:00
|
|
|
|
Util.SetGray(go,skillList[i].isOpen)
|
|
|
|
|
if skillList[i].isOpen then
|
|
|
|
|
LogError("skillList[i].needStar=="..skillList[i].needStar)
|
2022-06-13 16:35:30 +08:00
|
|
|
|
if skillList[i].needStar==13 then
|
|
|
|
|
sText.text="飞升2解锁"
|
2022-05-19 20:43:41 +08:00
|
|
|
|
else
|
|
|
|
|
sText.text=NumToSimplenessFont[skillList[i].needStar].."星解锁"
|
|
|
|
|
end
|
|
|
|
|
|
2022-05-19 16:38:52 +08:00
|
|
|
|
end
|
|
|
|
|
local pro=Util.GetGameObject(go.transform,"pro")
|
|
|
|
|
local proText=Util.GetGameObject(go.transform,"pro/Text"):GetComponent("Text")
|
|
|
|
|
if skillList[i].skillConfig.Skilltips and skillList[i].skillConfig.Skilltips~=0 then
|
|
|
|
|
pro:SetActive(true)
|
2022-05-19 20:43:41 +08:00
|
|
|
|
LogError("skillList[i].skillConfig.Skilltips="..skillList[i].skillConfig.Skilltips)
|
2022-05-19 16:38:52 +08:00
|
|
|
|
proText.text=SkillProType[skillList[i].skillConfig.Skilltips]
|
|
|
|
|
else
|
|
|
|
|
pro:SetActive(false)
|
|
|
|
|
end
|
|
|
|
|
|
2023-10-13 11:24:19 +08:00
|
|
|
|
Util.AddOnceClick(go, function()
|
2022-05-19 16:38:52 +08:00
|
|
|
|
if Game.GlobalEvent:HasEvent(GameEvent.UI.OnClose, triggerCallBack) then
|
|
|
|
|
Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnClose, triggerCallBack)
|
|
|
|
|
end
|
|
|
|
|
self.selsectSkillImage:SetActive(true)
|
2023-10-13 11:24:19 +08:00
|
|
|
|
self.selsectSkillImage.transform.position=Util.GetGameObject(go.transform,"icon").transform.position
|
2022-05-19 16:38:52 +08:00
|
|
|
|
local skillData = {}
|
|
|
|
|
skillData.skillConfig = skillList[i].skillConfig
|
2022-05-19 21:33:38 +08:00
|
|
|
|
skillData.isOpen=skillList[i].isOpen
|
|
|
|
|
skillData.needStar=skillList[i].needStar
|
2022-05-19 16:38:52 +08:00
|
|
|
|
local nextData=nil
|
2022-05-19 20:43:41 +08:00
|
|
|
|
-- if curStar<11 and i>2 then
|
|
|
|
|
-- nextData=skillList2[i]
|
|
|
|
|
-- end
|
2022-05-19 16:38:52 +08:00
|
|
|
|
local maxLv= HeroManager.GetHeroSkillMaxLevel(heroConFigData.Id,skillData.skillConfig.Type)
|
2023-10-13 11:24:19 +08:00
|
|
|
|
local panel = UIManager.OpenPanel(UIName.SkillInfoPopup,skillData,1,10,maxLv,i,nextData)
|
2022-05-19 22:12:14 +08:00
|
|
|
|
if skillList2 and skillList2[i] and i>2 then
|
2022-05-19 20:43:41 +08:00
|
|
|
|
nextData=skillList2[i]
|
|
|
|
|
nextData.isOpen=skillList2[i].isOpen
|
|
|
|
|
nextData.needStar=skillList2[i].needStar
|
|
|
|
|
--飞升技能
|
|
|
|
|
if i==6 then
|
|
|
|
|
panel = UIManager.OpenPanel(UIName.SkillInfoPopup,skillData,1,10,maxLv,i)
|
|
|
|
|
else
|
2023-12-21 18:29:35 +08:00
|
|
|
|
|
|
|
|
|
local training=HeroManager.GetTrainingPasivvSkill(nextData.needStar,heroConFigData.Id)
|
|
|
|
|
panel = UIManager.OpenPanel(UIName.SkillInfoPopup,nextData,1,10,maxLv,i,skillData,nil,nil,training)
|
2022-05-19 20:43:41 +08:00
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
panel = UIManager.OpenPanel(UIName.SkillInfoPopup,skillData,1,10,maxLv,i)
|
|
|
|
|
end
|
2023-09-04 18:27:40 +08:00
|
|
|
|
-- self.skillGrid2:GetComponent("Canvas").sortingOrder = panel.sortingOrder + 1
|
2022-05-19 16:38:52 +08:00
|
|
|
|
triggerCallBack = function (panelType, p)
|
|
|
|
|
if panelType == UIName.SkillInfoPopup and panel == p then --监听到SkillInfoPopup关闭,把层级设回去
|
2023-09-04 18:27:40 +08:00
|
|
|
|
-- self.skillGrid2:GetComponent("Canvas").sortingOrder = self.sortingOrder + 1
|
2022-05-19 16:38:52 +08:00
|
|
|
|
Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnClose, triggerCallBack)
|
|
|
|
|
self.selsectSkillImage:SetActive(false)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
Game.GlobalEvent:AddEvent(GameEvent.UI.OnClose, triggerCallBack)
|
|
|
|
|
end)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-04-08 17:24:36 +08:00
|
|
|
|
--界面关闭时调用(用于子类重写)
|
|
|
|
|
function HandBookRoleInfoLayout:OnClose()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--界面销毁时调用(用于子类重写)
|
|
|
|
|
function HandBookRoleInfoLayout:OnDestroy()
|
2021-04-21 13:12:04 +08:00
|
|
|
|
this.spLoader:Destroy()
|
2021-04-08 17:24:36 +08:00
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
return HandBookRoleInfoLayout
|