miduo_client/Assets/ManagedResources/~Lua/Modules/Popup/RoleInfoPopup.lua

883 lines
41 KiB
Lua
Raw Normal View History

2020-08-25 15:46:38 +08:00
--- 猎妖师详情弹窗(滚动条版本) ---
2020-05-09 13:31:21 +08:00
require("Base/BasePanel")
RoleInfoPopup = Inherit(BasePanel)
local this = RoleInfoPopup
local curHeroData
local triggerCallBack
local allSkillDatas = {}
local soulPrintPreList={}--魂印预设容器
2022-04-22 18:23:01 +08:00
local godPrintPreList={}--魂印预设容器
2023-09-13 14:57:48 +08:00
local giftList={} --礼物预设容器
2023-10-16 15:12:47 +08:00
local potencyList={} --潜能预设容器
2020-05-09 13:31:21 +08:00
local equipConfig = ConfigManager.GetConfig(ConfigName.EquipConfig)
local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig)
local heroRankupConfig=ConfigManager.GetConfig(ConfigName.HeroRankupConfig)
local jewelConfig=ConfigManager.GetConfig(ConfigName.JewelConfig)
2021-01-22 16:53:50 +08:00
local formationId
2020-05-09 13:31:21 +08:00
local pinjieImage={"r_hero_pinjiebiao_01","r_hero_pinjiebiao_02"} --该死的品阶图片 1是未激活 2是激活
2022-04-02 17:47:30 +08:00
local choosedList
2020-07-01 10:54:39 +08:00
local orginLayer2 = 0
local orginLayer = 0
2020-11-02 10:59:17 +08:00
local formationHeroNum = nil
2020-05-09 13:31:21 +08:00
--初始化组件(用于子类重写)
function RoleInfoPopup:InitComponent()
2021-04-21 13:12:04 +08:00
this.spLoader = SpriteLoader.New()
2020-05-09 13:31:21 +08:00
this.content = Util.GetGameObject(self.transform, "Panel/Scroll View/Viewport/Content"):GetComponent("RectTransform")
2023-11-07 15:56:30 +08:00
this.backBtn = Util.GetGameObject(self.transform, "Panel/BG/BackBtn")
this.maskBtn = Util.GetGameObject(self.transform, "Mask")
this.bg = Util.GetGameObject(self.transform, "Panel/BG")
this.sc = Util.GetGameObject(self.transform, "Panel/Scroll View")
2020-05-09 13:31:21 +08:00
this.roleInfo0 = Util.GetGameObject(self.transform, "Panel/Scroll View/Viewport/Content/RoleInfo0")
this.head = Util.GetGameObject(this.roleInfo0, "Head")
this.head_Frame = Util.GetGameObject(this.roleInfo0, "Frame"):GetComponent("Image")
this.head_Icon = Util.GetGameObject(this.head, "Icon"):GetComponent("Image")
this.head_Pro=Util.GetGameObject(this.head,"Pro"):GetComponent("Image")
this.head_Lv = Util.GetGameObject(this.head, "Lv/Text"):GetComponent("Text")
this.head_Star = Util.GetGameObject(this.head, "Star")
this.roleName = Util.GetGameObject(this.roleInfo0, "RoleName"):GetComponent("Text")
this.power = Util.GetGameObject(this.roleInfo0, "Power/PowerValue"):GetComponent("Text")
this.radar = Util.GetGameObject(this.roleInfo0, "ProRadarImage/Radar"):GetComponent("RadarChart")
this.talentBtn=Util.GetGameObject(this.roleInfo0,"Other/TalentBtn")
this.talentProgress=Util.GetGameObject(this.roleInfo0,"Other/TalentBtn/Progress"):GetComponent("Text")
this.talismanBtn=Util.GetGameObject(this.roleInfo0,"Other/TalismanBtn")
this.talismanIcon = Util.GetGameObject(this.roleInfo0, "Other/TalismanBtn/Icon")
this.talismanLock = Util.GetGameObject(this.roleInfo0, "Other/TalismanBtn/lockImage")
this.talismanlv=Util.GetGameObject(this.roleInfo0,"Other/TalismanBtn/LvText")
this.talismanlvText = Util.GetGameObject(this.roleInfo0, "Other/TalismanBtn/LvText/Text"):GetComponent("Text")
this.roleInfo1 = Util.GetGameObject(self.transform, "Panel/Scroll View/Viewport/Content/RoleInfo1")
this.atk = Util.GetGameObject(this.roleInfo1, "Pro/Atk/ProValue"):GetComponent("Text")
this.hp = Util.GetGameObject(this.roleInfo1, "Pro/Hp/ProValue"):GetComponent("Text")
this.phyDef = Util.GetGameObject(this.roleInfo1, "Pro/PhyDef/ProValue"):GetComponent("Text")
this.magDef = Util.GetGameObject(this.roleInfo1, "Pro/MagDef/ProValue"):GetComponent("Text")
this.skillGrid = Util.GetGameObject(this.roleInfo1, "Skill")
this.skill1 = Util.GetGameObject(this.skillGrid, "S1")
this.skill2 = Util.GetGameObject(this.skillGrid, "S2")
this.selsectSkillImage = Util.GetGameObject(this.skillGrid, "SelsectSkillImage")
this.posBgImage=Util.GetGameObject(this.roleInfo1,"Pos"):GetComponent("Image")
this.posImage=Util.GetGameObject(this.roleInfo1,"Pos/PosImage"):GetComponent("Image")
this.posText=Util.GetGameObject(this.roleInfo1,"Pos/PosText"):GetComponent("Text")
2020-06-08 20:18:49 +08:00
--品阶
2020-05-09 13:31:21 +08:00
this.pinjieList={}
2020-06-08 20:18:49 +08:00
this.pinjieRoot=Util.GetGameObject(this.roleInfo1,"Pinjie")
this.pinjiePre=Util.GetGameObject(this.roleInfo1,"Pre")
2020-05-09 13:31:21 +08:00
this.proBtn=Util.GetGameObject(this.roleInfo1,"ProTitle/Btn")--基础属性
this.equipInfo = Util.GetGameObject(self.transform, "Panel/Scroll View/Viewport/Content/EquipInfo")
this.equipTitle=Util.GetGameObject(this.equipInfo,"BG/EquipTitle")
this.grid=Util.GetGameObject(this.equipInfo, "Grid")
this.selsectEquipImage = Util.GetGameObject(this.equipInfo, "SelsectEquipImage")
--装备
this.equipGrid = Util.GetGameObject(this.grid, "EquipGrid")
2023-02-18 13:31:36 +08:00
--宝物、 法相
this.specialEquipInfo=Util.GetGameObject(this.transform, "Panel/Scroll View/Viewport/Content/specialEquipInfo")
this.babyTitle=Util.GetGameObject(this.specialEquipInfo,"BG/BabyTitle")
2020-05-09 13:31:21 +08:00
--宝物
2023-02-18 13:31:36 +08:00
this.babyGrid=Util.GetGameObject(this.specialEquipInfo, "Grid/BabyGrid")
--法相
this.faXiangGrid=Util.GetGameObject(this.specialEquipInfo, "Grid/faXiangGrid")
2020-05-09 13:31:21 +08:00
--魂印
this.soulPrintInfo = Util.GetGameObject(self.transform, "Panel/Scroll View/Viewport/Content/SoulPrintInfo")
this.soulPrintGrid = Util.GetGameObject(this.soulPrintInfo, "Grid")
this.soulPrintPre=Util.GetGameObject(this.soulPrintGrid,"SoulPrintPre")
2021-10-27 12:50:15 +08:00
2022-04-22 18:23:01 +08:00
--神印
this.godPrintInfo = Util.GetGameObject(self.transform, "Panel/Scroll View/Viewport/Content/GodPrintInfo")
this.godPrintGrid = Util.GetGameObject(this.godPrintInfo, "Grid")
this.godPrintPre=Util.GetGameObject(this.godPrintGrid,"SoulPrintPre")
2023-09-13 14:57:48 +08:00
--礼物
this.giftInfo=Util.GetGameObject(self.transform, "Panel/Scroll View/Viewport/Content/giftInfo")
this.giftGrid = Util.GetGameObject(this.giftInfo, "Grid")
this.giftPre=Util.GetGameObject(this.giftGrid,"giftPre")
2023-10-16 15:12:47 +08:00
--潜能
this.potentyInfo=Util.GetGameObject(self.transform, "Panel/Scroll View/Viewport/Content/potentyInfo")
this.potentyGrid = Util.GetGameObject(this.potentyInfo, "Grid")
this.potentyPre=Util.GetGameObject(this.potentyGrid,"giftPre")
--技能
this.skillInfo = Util.GetGameObject(self.transform, "Panel/Scroll View/Viewport/Content/skillInfo")
2023-11-29 17:00:29 +08:00
this.trainlevel = Util.GetGameObject(this.skillInfo, "TitleBG/traininglv")
this.trainBtn = Util.GetGameObject(this.skillInfo, "TitleBG/training")
this.skillGrid = Util.GetGameObject(this.skillInfo, "Grid")
this.skillPre=Util.GetGameObject(this.godPrintGrid,"S1")
2021-10-27 12:50:15 +08:00
this.shenhunList = {}
this.shenhunRoot = Util.GetGameObject(this.roleInfo1,"shenhun")
2021-10-27 15:24:46 +08:00
for i = 1,5 do
2021-10-27 12:50:15 +08:00
if not this.shenhunList[i] then
this.shenhunList[i] = {}
end
this.shenhunList[i].go = Util.GetGameObject(this.shenhunRoot, "shenhunPre"..i)
2021-11-04 09:27:56 +08:00
this.shenhunList[i].goItem = Util.GetGameObject(this.shenhunList[i].go, "godItem")
this.shenhunList[i].fx_shenhun = Util.GetGameObject(this.shenhunList[i].go, "fx_shenhun")
2021-10-27 12:50:15 +08:00
end
this.ShenhunBtn = Util.GetGameObject(this.shenhunRoot,"ShenhunBtn")
2020-05-09 13:31:21 +08:00
end
--绑定事件(用于子类重写)
function RoleInfoPopup:BindEvent()
2021-10-27 12:50:15 +08:00
Util.AddClick(this.ShenhunBtn,function()
local s = function()
local pro = {}
local lv = 0
if this.isOther then
lv = curHeroData.godSoulLv
else
lv = GodSoulManager.GetGodSoulLv(curHeroData.dynamicId)
end
2021-10-27 12:50:15 +08:00
local skillList = GodSoulManager.GetGodSoulDataByLv(curHeroData.heroConfig.Id,0)
2021-10-27 15:24:46 +08:00
for i = 1,LengthOfTable(skillList) do
local color = "B9AC97"
2021-10-27 12:50:15 +08:00
if lv >= i then
2021-10-27 15:24:46 +08:00
color = "00FF00"
2021-10-27 12:50:15 +08:00
end
2021-11-03 10:13:44 +08:00
table.insert(pro,string.format("<color=#%s>神魂%s%s</color>",color,i,skillList[i].skill))
2021-10-27 12:50:15 +08:00
end
return pro
end
local data = {}
local singData = {}
singData.title = "神魂效果"
singData.pro = s()
table.insert(data,singData)
2021-10-27 15:24:46 +08:00
UIManager.OpenPanel(UIName.GeneralBigPopup,GENERAL_POPUP_TYPE.ShenHunShuXing,data)
2021-10-27 12:50:15 +08:00
end)
2020-05-09 13:31:21 +08:00
Util.AddClick(this.talentBtn,function()
UIManager.OpenPanel(UIName.RoleTalentPopup,curHeroData.heroConfig,curHeroData.breakId,curHeroData.upStarId)
end)
Util.AddClick(this.backBtn, function()
PlaySoundWithoutClick(SoundConfig.Sound_UICancel)
self:ClosePanel()
end)
Util.AddClick(this.maskBtn, function()
PlaySoundWithoutClick(SoundConfig.Sound_UICancel)
self:ClosePanel()
end)
2020-05-09 13:31:21 +08:00
Util.AddClick(this.skill1, function()
if Game.GlobalEvent:HasEvent(GameEvent.UI.OnClose, triggerCallBack) then
Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnClose, triggerCallBack)
end
this:SetSkillSelectImage(this.skill1.transform, true)
2021-11-05 17:21:18 +08:00
local star,starType = curHeroData.GetStar(1)
if starType~=3 then--非神魂
star=nil
end
2020-05-09 13:31:21 +08:00
local maxLv = HeroManager.GetHeroSkillMaxLevel(curHeroData.heroConfig.Id, allSkillDatas[1].skillConfig.Type)
2021-11-05 17:21:18 +08:00
local panel = UIManager.OpenPanel(UIName.SkillInfoPopup, allSkillDatas[1], 4, 10, maxLv, 1,nil,star)
2020-05-09 13:31:21 +08:00
--this.skillGrid:GetComponent("Canvas").overrideSorting=true
--this.skillGrid:GetComponent("Canvas").sortingOrder = panel.sortingOrder + 1
triggerCallBack = function(panelType, p)
if panelType == UIName.SkillInfoPopup and p == panel then
--监听到SkillInfoPopup关闭把层级设回去
--this.skillGrid:GetComponent("Canvas").overrideSorting=false
--this.skillGrid:GetComponent("Canvas").sortingOrder = this.sortingOrder + 1
Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnClose, triggerCallBack)
this:SetSkillSelectImage(self.transform, false)
end
end
Game.GlobalEvent:AddEvent(GameEvent.UI.OnClose, triggerCallBack)
end)
Util.AddClick(this.skill2, function()
if Game.GlobalEvent:HasEvent(GameEvent.UI.OnClose, triggerCallBack) then
Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnClose, triggerCallBack)
end
this:SetSkillSelectImage(this.skill2.transform, true)
Log("===============22222 "..allSkillDatas[2].skillConfig.Type)
2021-11-05 17:21:18 +08:00
local star,starType = curHeroData.GetStar(1)
if starType~=3 then--非神魂
star=nil
end
2020-05-09 13:31:21 +08:00
local maxLv = HeroManager.GetHeroSkillMaxLevel(curHeroData.heroConfig.Id, allSkillDatas[2].skillConfig.Type)
2021-11-05 17:21:18 +08:00
local panel = UIManager.OpenPanel(UIName.SkillInfoPopup, allSkillDatas[2], 4, 10, maxLv, 2,nil,star)
2020-05-09 13:31:21 +08:00
--this.skillGrid:GetComponent("Canvas").overrideSorting=true
--this.skillGrid:GetComponent("Canvas").sortingOrder = panel.sortingOrder + 1
triggerCallBack = function(panelType, p)
if panelType == UIName.SkillInfoPopup and p == panel then
--监听到SkillInfoPopup关闭把层级设回去
-- this.skillGrid:GetComponent("Canvas").overrideSorting=false
--this.skillGrid:GetComponent("Canvas").sortingOrder = this.sortingOrder + 1
Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnClose, triggerCallBack)
this:SetSkillSelectImage(self.transform, false)
end
end
Game.GlobalEvent:AddEvent(GameEvent.UI.OnClose, triggerCallBack)
end)
2023-11-29 17:00:29 +08:00
Util.AddClick(this.trainBtn,function ()
UIManager.OpenPanel(UIName.SpecailTrainingInfoPopup,curHeroData,2)
end)
2020-05-09 13:31:21 +08:00
end
--添加事件监听(用于子类重写)
function RoleInfoPopup:AddListener()
end
--移除事件监听(用于子类重写)
function RoleInfoPopup:RemoveListener()
end
--界面打开时调用(用于子类重写)
function RoleInfoPopup:OnOpen(...)
this.selsectEquipImage:SetActive(false)
this.selsectSkillImage:SetActive(false)
local arg = { ... }
curHeroData = arg[1]
this.isOther = arg[2]
2020-06-30 18:59:44 +08:00
choosedList = arg[3] or nil
2020-11-02 10:59:17 +08:00
formationHeroNum = arg[4] or nil
2020-05-09 13:31:21 +08:00
end
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
function RoleInfoPopup:OnShow()
this.content:DOAnchorPosY(566, 0)
this.RoleInfo0()
this.RoleInfo1()
this.EquipInfo()
this.SoulPrintInfo()
2023-09-13 14:57:48 +08:00
this.GiftInfo()
2023-10-16 15:12:47 +08:00
this.PotentyInfo()
2022-04-22 18:23:01 +08:00
this.GodPrintInfo()
this.SkillInfo()
2020-05-09 13:31:21 +08:00
end
--界面关闭时调用(用于子类重写)
function RoleInfoPopup:OnClose()
end
--界面销毁时调用(用于子类重写)
function RoleInfoPopup:OnDestroy()
for k,v in pairs(this.treasureDatas) do
SubUIManager.Close(v)
end
this.treasureDatas = {}
2021-04-21 13:12:04 +08:00
this.spLoader:Destroy()
2020-05-25 19:16:23 +08:00
soulPrintPreList={}
2020-06-08 20:18:49 +08:00
this.pinjieList={}
2022-04-22 18:23:01 +08:00
godPrintPreList={}
2023-09-13 14:57:48 +08:00
giftList={}
2023-10-16 15:12:47 +08:00
potencyList={}
2020-07-01 10:54:39 +08:00
orginLayer2=0
2021-10-27 15:24:46 +08:00
this.shenhunList = {}
2020-07-01 10:54:39 +08:00
orginLayer=0
2020-05-09 13:31:21 +08:00
end
--设置技能选中外框
function this:SetSkillSelectImage(_goTran, _type)
--_goTran父级 _type==true 显示 =false 隐藏
this.selsectSkillImage:SetActive(_type)
--this.selsectSkillImage.transform:SetParent(_goTran)
--this.selsectSkillImage.transform.localScale = Vector3.one
--this.selsectSkillImage.transform.localPosition=Vector3.zero
this.selsectSkillImage.transform.position = _goTran.position
end
--设置装备选中外框
function this:SetEquipSelectImage(_goTran, _type)
--_goTran父级 _type==true 显示 =false 隐藏
this.selsectEquipImage:SetActive(_type)
this.selsectEquipImage.transform:SetParent(_goTran)
this.selsectEquipImage.transform.localScale = Vector3.one
this.selsectEquipImage.transform.localPosition = Vector3.zero
end
--RoleInfo0
function this.RoleInfo0()
2020-07-14 14:49:15 +08:00
LogBlue(curHeroData.id.." "..curHeroData.dynamicId)
2021-04-21 13:12:04 +08:00
this.head_Frame.sprite = this.spLoader:LoadSprite(GetHeroQuantityImageByquality(curHeroData.heroConfig.Quality, curHeroData.star))
this.head_Icon.sprite = this.spLoader:LoadSprite(curHeroData.icon)
this.head_Pro.sprite = this.spLoader:LoadSprite(GetProStrImageByProNum(curHeroData.changeProId))
2020-05-09 13:31:21 +08:00
this.head_Lv.text = curHeroData.lv
2021-10-26 16:00:31 +08:00
local star,starType = curHeroData.GetStar(1)
SetHeroStars(this.spLoader, this.head_Star, star,starType)
SetHeroFlyEffect(this.head,this.spLoader,curHeroData.star,this.sortingOrder+1,1,2)
2021-11-05 10:18:10 +08:00
Util.SetParticleSortLayer(this.head_Star,this.sortingOrder + 1)
2020-05-09 13:31:21 +08:00
this.roleName.text = curHeroData.name
2020-06-30 18:59:44 +08:00
local allAddProVal = {}
2020-05-09 13:31:21 +08:00
if this.isOther then
this.power.text = curHeroData.actionPower
else
2021-01-22 16:53:50 +08:00
this.power.text = HeroPowerManager.GetHeroPower(curHeroData.dynamicId, formationId)
2020-05-09 13:31:21 +08:00
end
this.radar:SetEdges({ curHeroData.heroConfig.AttackScale / 100, curHeroData.heroConfig.DefenseScale / 100, curHeroData.heroConfig.AssistScale / 100 })
this.radar.color = Color.New(238 / 255, 211 / 255, 156 / 255, 102 / 255)
--天赋
this.talentBtn:SetActive(curHeroData.heroConfig.OpenPassiveSkillRules ~= nil)
2022-01-12 16:41:51 +08:00
local talentBtnImage=""
if curHeroData.star==HeroManager.awakeNextStarIndex then
talentBtnImage="r_hero_tianfu2_zh"
elseif curHeroData.star==12 then
talentBtnImage="r_tongyong_tianfufeisheng1"
elseif curHeroData.star==13 then
talentBtnImage="r_tongyong_tianfufeisheng2"
elseif curHeroData.star==14 then
talentBtnImage="r_tongyong_tianfufeisheng3"
else
talentBtnImage="r_hero_tianfu1_zh"
end
--local talentBtnImage = curHeroData.star == HeroManager.awakeNextStarIndex and "r_hero_tianfu2_zh" or "r_hero_tianfu1_zh"
2021-04-21 13:12:04 +08:00
this.talentBtn:GetComponent("Image").sprite = this.spLoader:LoadSprite(talentBtnImage)
2022-01-12 16:41:51 +08:00
local OpenPassiveSkillRules = curHeroData.star >= HeroManager.awakeNextStarIndex and curHeroData.heroConfig.Awaken or curHeroData.heroConfig.OpenPassiveSkillRules
OpenPassiveSkillRules=GetPassiveByMaxStar(curHeroData.heroConfig,OpenPassiveSkillRules)
2020-11-11 20:19:54 +08:00
if OpenPassiveSkillRules then
2020-05-09 13:31:21 +08:00
local openlists,compoundOpenNum,compoundNum = HeroManager.GetAllPassiveSkillIds(curHeroData.heroConfig,curHeroData.breakId,curHeroData.upStarId)
2020-11-11 20:19:54 +08:00
this.talentProgress.text = #openlists - compoundOpenNum .."/"..#OpenPassiveSkillRules - compoundNum
2020-05-09 13:31:21 +08:00
end
--法宝
this.TalismanInfo()
end
--RoleInfo1
function this.RoleInfo1()
--定位描述相关
2021-04-21 13:12:04 +08:00
this.posBgImage.sprite=this.spLoader:LoadSprite(GetHeroPosBgStr(curHeroData.heroConfig.Profession))
this.posImage.sprite=this.spLoader:LoadSprite(GetHeroPosStr(curHeroData.heroConfig.Profession))
2021-01-26 17:08:39 +08:00
this.posText.text=GetLanguageStrById(curHeroData.heroConfig.HeroLocation)
SetTextVerTial(this.posText.gameObject,Vector3.New(64,0,0),"MiddleLeft")
2021-10-27 12:50:15 +08:00
local star,starType = curHeroData.GetStar(1)
if starType == 3 then
this.pinjieRoot.gameObject:SetActive(false)
this.shenhunRoot.gameObject:SetActive(true)
for i = 1,#this.shenhunList do
if i > star then
2021-11-04 09:27:56 +08:00
this.shenhunList[i].fx_shenhun.gameObject:SetActive(false)
this.shenhunList[i].goItem.gameObject:SetActive(true)
2021-10-27 12:50:15 +08:00
else
2021-11-04 09:27:56 +08:00
this.shenhunList[i].goItem.gameObject:SetActive(false)
this.shenhunList[i].fx_shenhun.gameObject:SetActive(true)
2021-11-05 10:18:10 +08:00
Util.SetParticleScale(this.shenhunList[i].fx_shenhun,1/this.shenhunList[i].fx_shenhun.transform.localScale.x)
Util.SetParticleScale(this.shenhunList[i].fx_shenhun,1.2)
2021-10-27 12:50:15 +08:00
end
end
else
this.shenhunRoot.gameObject:SetActive(false)
this.pinjieRoot.gameObject:SetActive(true)
--品阶
local pId=0
if curHeroData.breakId~=0 then
pId= heroRankupConfig[curHeroData.breakId].Phase[2]
end
local hruConfig= ConfigManager.GetAllConfigsDataByDoubleKey(ConfigName.HeroRankupConfig,"Star",curHeroData.heroConfig.Star,"Show",1) --动态获取不同英雄最大突破等阶
for i = 1, #hruConfig do --动态生成
local item=this.pinjieList[i]
if not item then
item= newObjToParent(this.pinjiePre,this.pinjieRoot)
item.name="Pre"..i
this.pinjieList[i]=item
end
this.pinjieList[i]:GetComponent("Image").sprite=this.spLoader:LoadSprite(i<=pId and pinjieImage[2] or pinjieImage[1])
end
for n = 1, this.pinjieRoot.transform.childCount - 1 do --超过品阶关闭显示
this.pinjieRoot.transform:GetChild(n).gameObject:SetActive(n<=#hruConfig)
2020-06-08 20:18:49 +08:00
end
end
2020-05-09 13:31:21 +08:00
--基础属性
local allAddProVal = {}
if (this.isOther) then
2020-06-18 20:39:29 +08:00
--this.atk.text = curHeroData.attack
--this.hp.text = curHeroData.hp
--this.phyDef.text = curHeroData.pDef
--this.magDef.text = curHeroData.mDef
2020-06-19 20:19:35 +08:00
allAddProVal = curHeroData.allAddProVal
2020-05-09 13:31:21 +08:00
else
2021-01-22 16:53:50 +08:00
-- allAddProVal = HeroPropManager.GetHeroProp(curHeroData.dynamicId, formationId)
2020-06-30 18:59:44 +08:00
if choosedList then
-- local allHeroTeamAddProVal = HeroManager.GetAllHeroTeamAddProVal(choosedList,curHeroData.dynamicId)
-- allAddProVal = HeroManager.CalculateHeroAllProValList(1, curHeroData.dynamicId, false,nil,nil,true,allHeroTeamAddProVal,formationHeroNum)
allAddProVal = HeroPropManager.GetHeroProp(curHeroData.dynamicId,FormationTypeDef.FORMATION_NORMAL)
2020-06-30 18:59:44 +08:00
else
-- allAddProVal = HeroManager.CalculateHeroAllProValList(1, curHeroData.dynamicId, false,nil,nil,false,{},formationHeroNum)
allAddProVal = HeroPropManager.GetHeroProp(curHeroData.dynamicId)
2020-06-30 18:59:44 +08:00
end
2020-05-09 13:31:21 +08:00
end
2020-06-18 20:39:29 +08:00
this.atk.text = allAddProVal[HeroProType.Attack]
this.hp.text = allAddProVal[HeroProType.Hp]
this.phyDef.text = allAddProVal[HeroProType.PhysicalDefence]
this.magDef.text = allAddProVal[HeroProType.MagicDefence]
2020-05-09 13:31:21 +08:00
Util.AddOnceClick(this.proBtn,function()
2020-06-18 20:39:29 +08:00
local guildSkill = nil
if this.isOther then guildSkill = curHeroData.guildSkill end
UIManager.OpenPanel(UIName.RoleProInfoPopup,allAddProVal,curHeroData.heroConfig,true,guildSkill)
2020-05-09 13:31:21 +08:00
end)
--this.skillGrid:GetComponent("Canvas").sortingOrder = this.sortingOrder + 1
-- allSkillDatas = HeroManager.GetCurHeroSidAndCurStarAllSkillDatas(curHeroData.id,curHeroData.star)
-- if allSkillDatas[1] and allSkillDatas[1].skillConfig and allSkillDatas[1].skillConfig.Name then
-- this.skill1:SetActive(true)
-- Util.GetGameObject(this.skill1.transform,"Icon"):GetComponent("Image").sprite = this.spLoader:LoadSprite(GetResourcePath(allSkillDatas[1].skillConfig.Icon))
-- Util.GetGameObject(this.skill1.transform, "Text"):GetComponent("Text").text = GetLanguageStrById(allSkillDatas[1].skillConfig.Name)--"lv." .. (allSkillDatas[1].skillId % 10)
-- Util.GetGameObject(this.skill1.transform,"SkillTypeImage"):GetComponent("Image").sprite=this.spLoader:LoadSprite(GetSkillType(allSkillDatas[1]))
-- else
-- this.skill1:SetActive(false)
-- end
-- if allSkillDatas[2] and allSkillDatas[2].skillConfig and allSkillDatas[2].skillConfig.Name then
-- this.skill2:SetActive(true)
-- Util.GetGameObject(this.skill2.transform,"Icon"):GetComponent("Image").sprite = this.spLoader:LoadSprite(GetResourcePath(allSkillDatas[2].skillConfig.Icon))
-- Util.GetGameObject(this.skill2.transform, "Text"):GetComponent("Text").text = GetLanguageStrById(allSkillDatas[2].skillConfig.Name)--"lv." .. (allSkillDatas[2].skillId % 10)
-- Util.GetGameObject(this.skill2.transform,"SkillTypeImage"):GetComponent("Image").sprite= this.spLoader:LoadSprite(GetSkillType(allSkillDatas[2]))
-- else
-- this.skill2:SetActive(false)
-- end
2021-11-04 09:27:56 +08:00
for i = 1,#this.shenhunList do
Util.SetParticleSortLayer(this.shenhunList[i].fx_shenhun,this.sortingOrder + 1)
end
2020-05-09 13:31:21 +08:00
end
--装备
function this.EquipInfo()
if not this.treasureDatas then
this.treasureDatas = {}
end
for k,v in pairs(this.treasureDatas) do
v.gameObject:SetActive(false)
end
2020-05-09 13:31:21 +08:00
local curHeroEquipDatas = {}
for i = 1, #curHeroData.equipIdList do
2023-02-19 20:08:48 +08:00
--LogError("equip-----------------"..i)
local equipData = GoodFriendManager.GetSingleEquipData(curHeroData.equipIdList[i]) or EquipManager.GetSingleEquipData(curHeroData.equipIdList[i])
2020-05-09 13:31:21 +08:00
if equipData ~= nil then
curHeroEquipDatas[equipData.equipConfig.Position] = equipData
end
end
for i = 1, this.equipGrid.transform.childCount do
local go = this.equipGrid.transform:GetChild(i - 1).gameObject
local pos = Util.GetGameObject(go.transform, "pos")
2020-05-09 13:31:21 +08:00
local curEquipData
if curHeroEquipDatas[i] then
curEquipData = curHeroEquipDatas[i]
if not this.treasureDatas[pos] then
this.treasureDatas[pos] = SubUIManager.Open(SubUIConfig.ItemView,pos.transform)
end
this.treasureDatas[pos].gameObject:SetActive(true)
this.treasureDatas[pos].transform:SetAsFirstSibling()
2022-01-05 19:12:54 +08:00
-- LogRed(tostring(curEquipData.homeEquipLv[1]).." "..tostring(curEquipData.homeEquipLv[2]))
2022-06-15 10:31:10 +08:00
this.treasureDatas[pos]:OnOpen(false, {curEquipData.id,0}, 0.8, false, false, false,orginLayer,nil,curEquipData)
2020-05-09 13:31:21 +08:00
end
local frameBtn = Util.GetGameObject(pos, "mask")
2020-05-09 13:31:21 +08:00
Util.AddOnceClick(frameBtn, function()
if curEquipData then
2021-11-09 10:22:16 +08:00
-- UIManager.OpenPanel(UIName.RoleEquipChangePopup, this, 2, curHeroData, curHeroEquipDatas[i],0,nil,0)
UIManager.OpenPanel(UIName.RewardEquipSingleShowPopup2,self, curHeroEquipDatas[i],5,false,false,curHeroData)
2020-05-09 13:31:21 +08:00
end
end)
end
2020-05-09 13:31:21 +08:00
--宝器
for m = 1, 2 do
Util.GetGameObject(this.babyGrid,"Pre"..m.."/Text"):GetComponent("RectTransform").sizeDelta = GetCurLanguage() == 0 and Vector2.New(48, 95) or Vector2.New(95, 95)
2020-05-09 13:31:21 +08:00
end
local b = #curHeroData.jewels>0
2023-02-18 13:31:36 +08:00
-- this.babyTitle.gameObject:SetActive(b)
-- this.babyGrid.gameObject:SetActive(b)
local v3 = b and Vector2.New(0,75) or Vector2.New(0,75)
2020-05-09 13:31:21 +08:00
this.equipTitle.transform:DOAnchorPos(v3,0)
2020-05-09 13:31:21 +08:00
for n = 1, #curHeroData.jewels do
local did=curHeroData.jewels[n]
local data = EquipTreasureManager.GetSingleTreasureByIdDyn(did)
if not data then
data = MonsterCampManager.GetSingleTreasureByIdDyn(did)
end
if not data then
data = ExpeditionManager.GetSingleTreasureByIdDyn(did)
end
if not data then
2021-08-31 11:08:12 +08:00
data = GoodFriendManager.GetSingleTreasureByIdDyn(did)
end
local pos = Util.GetGameObject(this.babyGrid,"Pre"..n.."/pos")
local btn = Util.GetGameObject(pos,"mask")
if not this.treasureDatas[pos] then
this.treasureDatas[pos] = SubUIManager.Open(SubUIConfig.ItemView,pos.transform)
end
this.treasureDatas[pos].gameObject:SetActive(true)
this.treasureDatas[pos].transform:SetAsFirstSibling()
this.treasureDatas[pos]:OnOpen(false, {data.id,0}, 0.8, false, false, false, 0,did)
2020-05-09 13:31:21 +08:00
Util.AddOnceClick(btn,function()
if did and data then
2021-11-09 17:06:47 +08:00
-- UIManager.OpenPanel(UIName.RoleEquipTreasureChangePopup,this,2,curHeroData,data,nil,pos,0)
2023-02-18 15:52:52 +08:00
UIManager.OpenPanel(UIName.RewardTalismanSingleShowPopup2,this,data,0,false,nil,curHeroData,5)
end
2020-05-09 13:31:21 +08:00
end)
end
2023-02-19 20:08:48 +08:00
for n = 1, #curHeroData.faxiang do
local did=curHeroData.faxiang[n]
local data = FaXiangManager.GetSingleTreasureByIdDyn(did)
if not data then
2023-03-10 13:29:22 +08:00
data = MonsterCampManager.GetSingleFaXiangByIdDyn(did)
2023-02-19 20:08:48 +08:00
end
if not data then
data = ExpeditionManager.GetSingleTreasureByIdDyn(did)
end
if not data then
data = GoodFriendManager.GetSingleFaXiangByIdDyn(did)
end
local pos = Util.GetGameObject(this.faXiangGrid,"Pre"..n.."/pos")
local btn = Util.GetGameObject(pos,"mask")
if not this.treasureDatas[pos] then
this.treasureDatas[pos] = SubUIManager.Open(SubUIConfig.ItemView,pos.transform)
end
this.treasureDatas[pos].gameObject:SetActive(true)
this.treasureDatas[pos].transform:SetAsFirstSibling()
this.treasureDatas[pos]:OnOpen(false, {data.id,0}, 0.8, false, false, false, 0,did)
Util.AddOnceClick(btn,function()
if did and data then
-- UIManager.OpenPanel(UIName.RoleEquipTreasureChangePopup,this,2,curHeroData,data,nil,pos,0)
UIManager.OpenPanel(UIName.RewardTalismanSingleShowPopup2,this,data,0,false,nil,curHeroData,n+6)
end
end)
end
2020-05-09 13:31:21 +08:00
end
--魂印
2020-07-01 10:54:39 +08:00
2020-05-09 13:31:21 +08:00
function this.SoulPrintInfo()
local curHeroSoulPrintDatas = {}
-- 没有魂印不显示
if #curHeroData.soulPrintList==0 then
this.soulPrintInfo.gameObject:SetActive(false)
2023-11-07 15:56:30 +08:00
--this.backBtn.transform.localPosition = Vector2.New(432.5, 590)
this.bg.transform.sizeDelta = Vector2.New(935, 1250)
this.sc.transform.sizeDelta = Vector2.New(935, 1132)
return
end
this.soulPrintInfo.gameObject:SetActive(true)
2023-11-07 15:56:30 +08:00
--this.backBtn.transform.localPosition = Vector2.New(432.5, 690)
this.bg.transform.sizeDelta = Vector2.New(935, 1450)
this.sc.transform.sizeDelta = Vector2.New(935, 1332)
for key, value in pairs(soulPrintPreList) do
if value then
value:SetActive(false)
end
end
2020-05-25 19:16:23 +08:00
for i,v in pairs(curHeroData.soulPrintList) do --生成预设
2020-05-09 13:31:21 +08:00
if not soulPrintPreList[i] then
soulPrintPreList[i]=newObjToParent(this.soulPrintPre,this.soulPrintGrid)
end
soulPrintPreList[i].name="Pre"..i
soulPrintPreList[i]:SetActive(true)
--特效层级重设
for i=1,#soulPrintPreList do
Util.AddParticleSortLayer(soulPrintPreList[i], this.sortingOrder- orginLayer2)
end
orginLayer2 = this.sortingOrder
orginLayer=this.sortingOrder
2020-07-01 10:54:39 +08:00
2020-05-09 13:31:21 +08:00
local frame=Util.GetGameObject(soulPrintPreList[i],"Frame"):GetComponent("Image")
2020-06-23 18:36:24 +08:00
local icon=Util.GetGameObject(soulPrintPreList[i],"circleFrameBg/Icon"):GetComponent("Image")
2021-04-21 13:12:04 +08:00
frame.sprite=this.spLoader:LoadSprite(GetQuantityImageByquality(equipConfig[v.equipId].Quality))
icon.sprite=this.spLoader:LoadSprite(GetResourcePath(itemConfig[v.equipId].ResourceID))
Util.GetGameObject(soulPrintPreList[i],"circleFrameBg"):GetComponent("Image").sprite=this.spLoader:LoadSprite(SoulPrintSpriteByQuantity[itemConfig[v.equipId].Quantity].circleBg2)
Util.GetGameObject(soulPrintPreList[i],"circleFrameBg/circleFrame"):GetComponent("Image").sprite=this.spLoader:LoadSprite(SoulPrintSpriteByQuantity[itemConfig[v.equipId].Quantity].circle)
2020-05-09 13:31:21 +08:00
Util.AddOnceClick(soulPrintPreList[i],function()
2020-05-25 19:16:23 +08:00
UIManager.OpenPanel(UIName.SoulPrintPopUp,3,curHeroData.dynamicId,v.equipId)
2020-05-09 13:31:21 +08:00
end)
end
end
function this.SkillInfo()
2022-05-19 22:24:02 +08:00
local skillList = HeroManager.GetCurHeroSidAndCurStarAllSkillDatas2(curHeroData.heroConfig.Id,curHeroData.heroConfig.MaxRank, curHeroData.star)
local skillList2
if curHeroData.heroConfig.MaxRank>9 then
skillList2 = HeroManager.GetCurHeroSidAndCurStarAllSkillDatas2(curHeroData.heroConfig.Id,10,curHeroData.star)
end
2023-11-29 17:00:29 +08:00
this.trainlevel:GetComponent("Text").text=Language[12326]..NumToComplexFont[curHeroData.HeroTraining.trainingLv]..Language[10065]
for i = 1, this.skillGrid.transform.childCount do
this.skillGrid.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 = this.skillGrid.transform:GetChild(i-1).gameObject
go:SetActive(true)
Util.GetGameObject(go.transform,"Icon"):GetComponent("Image").sprite=this.spLoader:LoadSprite(GetResourcePath(skillList[i].skillConfig.Icon))
local typeImg=Util.GetGameObject(go.transform,"SkillTypeImage")
typeImg:GetComponent("Image").sprite=this.spLoader:LoadSprite(GetSkillType(skillList[i]))
local sText = Util.GetGameObject(go.transform,"Text"):GetComponent("Text")
sText.text=GetLanguageStrById(skillList[i].skillConfig.Name)
sText.fontSize = GetCurLanguage() ~= 2 and 30 or 25
Util.SetGray(go,skillList[i].isOpen)
Util.AddOnceClick(go, function()
if Game.GlobalEvent:HasEvent(GameEvent.UI.OnClose, triggerCallBack) then
Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnClose, triggerCallBack)
end
this.selsectSkillImage:SetActive(true)
this.selsectSkillImage.transform.position=Util.GetGameObject(go.transform,"Icon").transform.position
local skillData = {}
skillData.skillConfig = skillList[i].skillConfig
2022-05-19 22:12:14 +08:00
skillData.isOpen=skillList[i].isOpen
skillData.needStar=skillList[i].needStar
local maxLv= HeroManager.GetHeroSkillMaxLevel(curHeroData.heroConfig.Id,skillData.skillConfig.Type)
2022-05-19 22:24:02 +08:00
--local panel = UIManager.OpenPanel(UIName.SkillInfoPopup,skillData,1,10,maxLv,i)
if skillList2 and skillList2[i] and i>2 then
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
panel = UIManager.OpenPanel(UIName.SkillInfoPopup,nextData,1,10,maxLv,i,skillData)
end
else
panel = UIManager.OpenPanel(UIName.SkillInfoPopup,skillData,1,10,maxLv,i)
end
this.skillGrid:GetComponent("Canvas").sortingOrder = panel.sortingOrder + 1
triggerCallBack = function (panelType, p)
if panelType == UIName.SkillInfoPopup and panel == p then --监听到SkillInfoPopup关闭把层级设回去
2022-05-20 11:16:54 +08:00
this.skillGrid:GetComponent("Canvas").sortingOrder = this.sortingOrder + 1
Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnClose, triggerCallBack)
this.selsectSkillImage:SetActive(false)
end
end
Game.GlobalEvent:AddEvent(GameEvent.UI.OnClose, triggerCallBack)
end)
end
end
end
2022-04-22 18:23:01 +08:00
--神印
function this.GodPrintInfo()
local curHeroSoulPrintDatas = {}
-- 没有魂印不显示
if curHeroData.godPrintList==nil or #curHeroData.godPrintList==0 then
this.godPrintInfo.gameObject:SetActive(false)
2023-11-07 15:56:30 +08:00
--this.backBtn.transform.localPosition = Vector2.New(432.5, 590)
2022-04-22 18:23:01 +08:00
this.bg.transform.sizeDelta = Vector2.New(935, 1250)
this.sc.transform.sizeDelta = Vector2.New(935, 1132)
return
end
2023-03-10 13:29:22 +08:00
2022-04-22 18:23:01 +08:00
this.godPrintInfo.gameObject:SetActive(true)
2023-11-07 15:56:30 +08:00
--this.backBtn.transform.localPosition = Vector2.New(432.5, 690)
2022-04-22 18:23:01 +08:00
this.bg.transform.sizeDelta = Vector2.New(935, 1450)
this.sc.transform.sizeDelta = Vector2.New(935, 1332)
for key, value in pairs(godPrintPreList) do
if value then
value:SetActive(false)
end
end
for i,v in pairs(curHeroData.godPrintList) do --生成预设
if not godPrintPreList[i] then
godPrintPreList[i]=newObjToParent(this.godPrintPre,this.godPrintGrid)
end
godPrintPreList[i].name="Pre"..i
godPrintPreList[i]:SetActive(true)
--特效层级重设
for i=1,#godPrintPreList do
Util.AddParticleSortLayer(godPrintPreList[i], this.sortingOrder- orginLayer2)
end
orginLayer2 = this.sortingOrder
orginLayer=this.sortingOrder
local frame=Util.GetGameObject(godPrintPreList[i],"Frame"):GetComponent("Image")
local icon=Util.GetGameObject(godPrintPreList[i],"circleFrameBg/Icon"):GetComponent("Image")
frame.sprite=this.spLoader:LoadSprite(GetQuantityImageByquality(equipConfig[v.equipId].Quality))
icon.sprite=this.spLoader:LoadSprite(GetResourcePath(itemConfig[v.equipId].ResourceID))
Util.GetGameObject(godPrintPreList[i],"circleFrameBg"):GetComponent("Image").sprite=this.spLoader:LoadSprite(SoulPrintSpriteByQuantity[itemConfig[v.equipId].Quantity].circleBg2)
Util.GetGameObject(godPrintPreList[i],"circleFrameBg/circleFrame"):GetComponent("Image").sprite=this.spLoader:LoadSprite(SoulPrintSpriteByQuantity[itemConfig[v.equipId].Quantity].circle)
Util.AddOnceClick(godPrintPreList[i],function()
UIManager.OpenPanel(UIName.GodPrintPopUp,0,curHeroData.dynamicId,v.equipId)
end)
end
end
2023-09-13 14:57:48 +08:00
function this.GiftInfo()
local curHeroSoulPrintDatas = {}
2022-04-22 18:23:01 +08:00
2023-09-13 14:57:48 +08:00
-- 没有魂印不显示
if curHeroData.giftIds==nil or #curHeroData.giftIds==0 then
this.giftInfo.gameObject:SetActive(false)
2023-11-07 15:56:30 +08:00
--this.backBtn.transform.localPosition = Vector2.New(432.5, 590)
2023-09-13 14:57:48 +08:00
this.bg.transform.sizeDelta = Vector2.New(935, 1250)
this.sc.transform.sizeDelta = Vector2.New(935, 1132)
return
end
this.giftInfo.gameObject:SetActive(true)
2023-11-07 15:56:30 +08:00
--this.backBtn.transform.localPosition = Vector2.New(432.5, 690)
2023-09-13 14:57:48 +08:00
this.bg.transform.sizeDelta = Vector2.New(935, 1450)
this.sc.transform.sizeDelta = Vector2.New(935, 1332)
for key, value in pairs(giftList) do
if value then
value:SetActive(false)
end
end
for i=1,#curHeroData.giftIds do
LogError("curHeroData.giftIds[i]==========="..curHeroData.giftIds[i])
end
for i=1,#curHeroData.giftIds do --生成预设
if not giftList[i] then
giftList[i]=newObjToParent(this.giftPre,this.giftGrid)
end
giftList[i].name="Pre"..i
giftList[i]:SetActive(true)
--特效层级重设
for i=1,#giftList do
Util.AddParticleSortLayer(giftList[i], this.sortingOrder- orginLayer2)
end
orginLayer2 = this.sortingOrder
orginLayer=this.sortingOrder
local id=curHeroData.giftIds[i]
--LogError("v==============="..id)
local frame=Util.GetGameObject(giftList[i],"Frame"):GetComponent("Image")
local icon=Util.GetGameObject(giftList[i],"Icon"):GetComponent("Image")
2023-09-13 15:44:06 +08:00
Util.GetGameObject(giftList[i],"Name"):SetActive(false)
2023-09-13 14:57:48 +08:00
frame.sprite=this.spLoader:LoadSprite(GetQuantityImageByquality(equipConfig[id].Quality))
icon.sprite=this.spLoader:LoadSprite(GetResourcePath(itemConfig[id].ResourceID))
Util.AddOnceClick(giftList[i],function()
2023-09-13 15:44:06 +08:00
local data={}
data.id=id
UIManager.OpenPanel(UIName.RewardEquipSingleShowPopup2,this,data,0)
2023-09-13 14:57:48 +08:00
end)
end
end
2022-04-22 18:23:01 +08:00
2023-10-16 15:12:47 +08:00
--潜能信息
function this.PotentyInfo()
local curHeroSoulPrintDatas = {}
-- 没有潜能不显示
if curHeroData.potential==nil or #curHeroData.potential==0 then
this.potentyInfo.gameObject:SetActive(false)
2023-11-07 15:56:30 +08:00
--this.backBtn.transform.localPosition = Vector2.New(432.5, 590)
2023-10-16 15:12:47 +08:00
this.bg.transform.sizeDelta = Vector2.New(935, 1250)
this.sc.transform.sizeDelta = Vector2.New(935, 1132)
return
end
-- for i=1,#curHeroData.potential do
-- LogError("curHeroData.potential[i]===========" .. curHeroData.potential[i])
-- end
this.potentyInfo.gameObject:SetActive(true)
2023-11-07 15:56:30 +08:00
--this.backBtn.transform.localPosition = Vector2.New(432.5, 690)
2023-10-16 15:12:47 +08:00
this.bg.transform.sizeDelta = Vector2.New(935, 1450)
this.sc.transform.sizeDelta = Vector2.New(935, 1332)
for key, value in pairs(potencyList) do
if value then
value:SetActive(false)
end
end
for i=1,#curHeroData.potential do --生成预设
if not potencyList[i] then
potencyList[i]=newObjToParent(this.potentyPre,this.potentyGrid)
end
potencyList[i].name="Pre"..i
potencyList[i]:SetActive(true)
--特效层级重设
for i=1,#potencyList do
Util.AddParticleSortLayer(potencyList[i], this.sortingOrder- orginLayer2)
end
orginLayer2 = this.sortingOrder
orginLayer=this.sortingOrder
local poten=curHeroData.potential[i]
--LogError("v==============="..id)
local frame=Util.GetGameObject(potencyList[i],"Frame"):GetComponent("Image")
local icon=Util.GetGameObject(potencyList[i],"Icon"):GetComponent("Image")
Util.GetGameObject(potencyList[i],"Name"):SetActive(false)
--frame.sprite=this.spLoader:LoadSprite(GetQuantityImageByquality(equipConfig[id].Quality))
local config=ConfigManager.GetConfigData(ConfigName.PotentialNewConfig,i)
icon.sprite=this.spLoader:LoadSprite(config.Icon)
LogError("poten.type==============================="..poten.lv)
--LogError("poten.type==============================="..poten.type.." uplv=="..poten.upLv.." poten.giftLv==="..poten.giftLv)
Util.AddOnceClick(potencyList[i],function()
local data={}
data.id=id
UIManager.OpenPanel(UIName.HeroPotencyInfoPopup,i,poten.lv,poten.giftLv)
end)
end
end
2020-05-09 13:31:21 +08:00
--法宝
function this.TalismanInfo()
--法宝表数据
if not curHeroData.heroConfig.EquipTalismana or curHeroData.talismanList == 0 then
this.talismanBtn:SetActive(false)
this.talismanLock:SetActive(true)
this.talismanlvText.text = ""
return
end
2023-10-26 17:16:10 +08:00
local curTalisman = ConfigManager.GetConfigDataByDoubleKey(ConfigName.EquipTalismana,"TalismanaId",curHeroData.heroConfig.EquipTalismana[2],"Level",10)
2020-05-09 13:31:21 +08:00
if curTalisman ~= nil then
this.talismanBtn:SetActive(true)
2023-10-26 17:16:10 +08:00
2020-05-09 13:31:21 +08:00
local isOpen = TalismanManager.GetCurHeroIsOpenTalisman(curHeroData)
this.talismanLock:SetActive(not isOpen)
2023-10-26 17:16:10 +08:00
local data=FaLingManager.GetEquipDataByDid(curHeroData.baublesId)
--他人法宝数据
if data==nil then
data=curHeroData.faLingData
end
if data then
this.talismanIcon:GetComponent("Image").sprite = this.spLoader:LoadSprite(data.icon)
this.talismanlv.gameObject:SetActive(true)
this.talismanlvText.text = data.lv
else
this.talismanlv.gameObject:SetActive(false)
this.talismanIcon:GetComponent("Image").sprite = this.spLoader:LoadSprite(GetResourcePath(ConfigManager.GetConfigData(ConfigName.ItemConfig,curTalisman.TalismanaId).ResourceID))
end
2020-05-09 13:31:21 +08:00
Util.AddOnceClick(this.talismanBtn.gameObject, function()
2023-10-26 17:16:10 +08:00
-- if isOpen then
-- UIManager.OpenPanel(UIName.TalismanInfoPopup, curHeroData.heroConfig, 1, curHeroData.talismanList)
-- else
-- PopupTipPanel.ShowTip(Language[11523])
-- end
if curHeroData.baublesId then
if data then
UIManager.OpenPanel(UIName.FaLingSingleShowPopup,this,data,0,false,false,curHeroData)
end
2020-05-09 13:31:21 +08:00
end
end)
end
end
2020-07-01 10:54:39 +08:00
function this.OnSortingOrderChange()
--特效层级重设
for i=1,#soulPrintPreList do
Util.AddParticleSortLayer(soulPrintPreList[i], this.sortingOrder- orginLayer)
2022-04-22 18:23:01 +08:00
end
for i=1,#godPrintPreList do
Util.AddParticleSortLayer(godPrintPreList[i], this.sortingOrder- orginLayer)
2023-09-13 14:57:48 +08:00
end
for i=1,#giftList do
Util.AddParticleSortLayer(giftList[i], this.sortingOrder- orginLayer)
end
2023-10-16 15:12:47 +08:00
for i=1,#potencyList do
Util.AddParticleSortLayer(potencyList[i], this.sortingOrder- orginLayer)
end
2021-11-04 09:27:56 +08:00
for i = 1,#this.shenhunList do
Util.SetParticleSortLayer(this.shenhunList[i].fx_shenhun,this.sortingOrder + 1)
end
2021-11-05 10:18:10 +08:00
Util.SetParticleSortLayer(this.head_Star,this.sortingOrder + 1)
2020-07-01 10:54:39 +08:00
orginLayer = this.sortingOrder
end
2021-04-21 13:12:04 +08:00
return RoleInfoPopup