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

915 lines
43 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 = {}
2024-09-06 10:38:56 +08:00
local soulPrintPreList = {} --魂印预设容器
local godPrintPreList = {} --魂印预设容器
local giftList = {} --礼物预设容器
local potencyList = {} --潜能预设容器
2020-05-09 13:31:21 +08:00
local equipConfig = ConfigManager.GetConfig(ConfigName.EquipConfig)
2024-09-06 10:38:56 +08:00
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
2024-09-06 10:38:56 +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
2024-09-06 10:38:56 +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")
this.backBtn = Util.GetGameObject(self.transform, "Panel/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")
2024-09-06 10:38:56 +08:00
this.head_Pro = Util.GetGameObject(this.head, "Pro"):GetComponent("Image")
2020-05-09 13:31:21 +08:00
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")
2024-09-06 10:38:56 +08:00
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")
2020-05-09 13:31:21 +08:00
this.talismanIcon = Util.GetGameObject(this.roleInfo0, "Other/TalismanBtn/Icon")
this.talismanLock = Util.GetGameObject(this.roleInfo0, "Other/TalismanBtn/lockImage")
2024-09-06 10:38:56 +08:00
this.talismanlv = Util.GetGameObject(this.roleInfo0, "Other/TalismanBtn/LvText")
2020-05-09 13:31:21 +08:00
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")
2024-09-06 10:38:56 +08:00
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
--品阶
2024-09-06 10:38:56 +08:00
this.pinjieList = {}
this.pinjieRoot = Util.GetGameObject(this.roleInfo1, "Pinjie")
this.pinjiePre = Util.GetGameObject(this.roleInfo1, "Pre")
2020-06-08 20:18:49 +08:00
2024-09-06 10:38:56 +08:00
this.proBtn = Util.GetGameObject(this.roleInfo1, "ProTitle/Btn") --基础属性
2020-05-09 13:31:21 +08:00
this.equipInfo = Util.GetGameObject(self.transform, "Panel/Scroll View/Viewport/Content/EquipInfo")
2024-09-06 10:38:56 +08:00
this.equipTitle = Util.GetGameObject(this.equipInfo, "BG/EquipTitle")
this.grid = Util.GetGameObject(this.equipInfo, "Grid")
2020-05-09 13:31:21 +08:00
this.selsectEquipImage = Util.GetGameObject(this.equipInfo, "SelsectEquipImage")
--装备
this.equipGrid = Util.GetGameObject(this.grid, "EquipGrid")
this.equipInfo:SetActive(true)
2023-02-18 13:31:36 +08:00
--宝物、 法相
2024-09-06 10:38:56 +08:00
this.specialEquipInfo = Util.GetGameObject(this.transform, "Panel/Scroll View/Viewport/Content/specialEquipInfo")
this.specialEquipInfo:SetActive(true)
2024-09-06 10:38:56 +08:00
Util.GetGameObject(this.specialEquipInfo, "BG/EquipTitle/Text"):GetComponent("Text").text = Language[12194]
this.babyTitle = Util.GetGameObject(this.specialEquipInfo, "BG/BabyTitle")
Util.GetGameObject(this.specialEquipInfo, "BG/BabyTitle")
2020-05-09 13:31:21 +08:00
--宝物
2024-09-06 10:38:56 +08:00
this.babyGrid = Util.GetGameObject(this.specialEquipInfo, "Grid/BabyGrid")
2023-02-18 13:31:36 +08:00
--法相
2024-09-06 10:38:56 +08:00
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")
2024-09-06 10:38:56 +08:00
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")
2024-09-06 10:38:56 +08:00
this.godPrintPre = Util.GetGameObject(this.godPrintGrid, "SoulPrintPre")
2023-09-13 14:57:48 +08:00
--礼物
2024-09-06 10:38:56 +08:00
this.giftInfo = Util.GetGameObject(self.transform, "Panel/Scroll View/Viewport/Content/giftInfo")
2023-09-13 14:57:48 +08:00
this.giftGrid = Util.GetGameObject(this.giftInfo, "Grid")
2024-09-06 10:38:56 +08:00
this.giftPre = Util.GetGameObject(this.giftGrid, "giftPre")
2023-11-28 15:55:32 +08:00
--潜能
2024-09-06 10:38:56 +08:00
this.potentyInfo = Util.GetGameObject(self.transform, "Panel/Scroll View/Viewport/Content/potentyInfo")
2023-11-28 15:55:32 +08:00
this.potentyGrid = Util.GetGameObject(this.potentyInfo, "Grid")
2024-09-06 10:38:56 +08:00
this.potentyPre = Util.GetGameObject(this.potentyGrid, "giftPre")
--技能
this.skillInfo = Util.GetGameObject(self.transform, "Panel/Scroll View/Viewport/Content/skillInfo")
2023-12-01 19:17:16 +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")
2024-09-06 10:38:56 +08:00
this.skillPre = Util.GetGameObject(this.godPrintGrid, "S1")
2021-10-27 12:50:15 +08:00
this.shenhunList = {}
2024-09-06 10:38:56 +08:00
this.shenhunRoot = Util.GetGameObject(this.roleInfo1, "shenhun")
for i = 1, 5 do
2021-10-27 12:50:15 +08:00
if not this.shenhunList[i] then
this.shenhunList[i] = {}
2024-09-06 10:38:56 +08:00
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
2024-09-06 10:38:56 +08:00
this.ShenhunBtn = Util.GetGameObject(this.shenhunRoot, "ShenhunBtn")
2020-05-09 13:31:21 +08:00
end
--绑定事件(用于子类重写)
function RoleInfoPopup:BindEvent()
2024-09-06 10:38:56 +08:00
Util.AddClick(this.ShenhunBtn, function()
2021-10-27 12:50:15 +08:00
local s = function()
local pro = {}
local lv = 0
if this.isOther then
lv = curHeroData.godSoulLv
else
lv = GodSoulManager.GetGodSoulLv(curHeroData.dynamicId)
end
2024-09-06 10:38:56 +08:00
local skillList = GodSoulManager.GetGodSoulDataByLv(curHeroData.heroConfig.Id, 0)
for i = 1, LengthOfTable(skillList) do
2021-10-27 15:24:46 +08:00
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
2024-09-06 10:38:56 +08:00
table.insert(pro, string.format(Language[12240], color, i, skillList[i].skill))
2021-10-27 12:50:15 +08:00
end
return pro
end
local data = {}
local singData = {}
2024-08-29 21:36:51 +08:00
singData.title = Language[12241]
2021-10-27 12:50:15 +08:00
singData.pro = s()
2024-09-06 10:38:56 +08:00
table.insert(data, singData)
UIManager.OpenPanel(UIName.GeneralBigPopup, GENERAL_POPUP_TYPE.ShenHunShuXing, data)
2021-10-27 12:50:15 +08:00
end)
2024-09-06 10:38:56 +08:00
Util.AddClick(this.talentBtn, function()
UIManager.OpenPanel(UIName.RoleTalentPopup, curHeroData.heroConfig, curHeroData.breakId, curHeroData.upStarId)
2020-05-09 13:31:21 +08:00
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)
2024-09-06 10:38:56 +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)
2024-09-06 10:38:56 +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)
2024-09-06 10:38:56 +08:00
Log("===============22222 " .. allSkillDatas[2].skillConfig.Type)
2020-05-09 13:31:21 +08:00
2024-09-06 10:38:56 +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)
2024-09-06 10:38:56 +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)
2024-09-06 10:38:56 +08:00
Util.AddClick(this.trainBtn, function()
UIManager.OpenPanel(UIName.SpecailTrainingInfoPopup, curHeroData, 2)
2023-12-01 19:17:16 +08:00
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-11-28 15:55:32 +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()
2024-09-06 10:38:56 +08:00
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()
2024-09-06 10:38:56 +08:00
soulPrintPreList = {}
this.pinjieList = {}
godPrintPreList = {}
giftList = {}
potencyList = {}
orginLayer2 = 0
2021-10-27 15:24:46 +08:00
this.shenhunList = {}
2024-09-06 10:38:56 +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
2024-09-06 10:38:56 +08:00
2020-05-09 13:31:21 +08:00
--设置装备选中外框
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()
2024-09-06 10:38:56 +08:00
LogBlue(curHeroData.id .. " " .. curHeroData.dynamicId)
this.head_Frame.sprite = this.spLoader:LoadSprite(GetHeroQuantityImageByquality(curHeroData.heroConfig.Quality,
curHeroData.star))
2021-04-21 13:12:04 +08:00
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
2024-09-06 10:38:56 +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)
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
2024-09-06 10:38:56 +08:00
this.radar:SetEdges({ curHeroData.heroConfig.AttackScale / 100, curHeroData.heroConfig.DefenseScale / 100,
curHeroData.heroConfig.AssistScale / 100 })
2020-05-09 13:31:21 +08:00
this.radar.color = Color.New(238 / 255, 211 / 255, 156 / 255, 102 / 255)
--天赋
this.talentBtn:SetActive(curHeroData.heroConfig.OpenPassiveSkillRules ~= nil)
2024-09-06 10:38:56 +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"
2022-01-12 16:41:51 +08:00
else
2024-09-06 10:38:56 +08:00
talentBtnImage = "r_hero_tianfu1_zh"
2022-01-12 16:41:51 +08:00
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)
2024-09-06 10:38:56 +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
2024-09-06 10:38:56 +08:00
local openlists, compoundOpenNum, compoundNum = HeroManager.GetAllPassiveSkillIds(curHeroData.heroConfig,
curHeroData.breakId, curHeroData.upStarId)
this.talentProgress.text = #openlists - compoundOpenNum .. "/" .. #OpenPassiveSkillRules - compoundNum
2020-05-09 13:31:21 +08:00
end
--法宝
this.TalismanInfo()
end
2024-09-06 10:38:56 +08:00
2020-05-09 13:31:21 +08:00
--RoleInfo1
function this.RoleInfo1()
--定位描述相关
2024-09-06 10:38:56 +08:00
this.posBgImage.sprite = this.spLoader:LoadSprite(GetHeroPosBgStr(curHeroData.heroConfig.Profession))
this.posImage.sprite = this.spLoader:LoadSprite(GetHeroPosStr(curHeroData.heroConfig.Profession))
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
2024-09-06 10:38:56 +08:00
local star, starType = curHeroData.GetStar(1)
2021-10-27 12:50:15 +08:00
if starType == 3 then
this.pinjieRoot.gameObject:SetActive(false)
this.shenhunRoot.gameObject:SetActive(true)
2024-09-06 10:38:56 +08:00
for i = 1, #this.shenhunList do
2021-10-27 12:50:15 +08:00
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)
2024-09-06 10:38:56 +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)
--品阶
2024-09-06 10:38:56 +08:00
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]
2021-10-27 12:50:15 +08:00
if not item then
2024-09-06 10:38:56 +08:00
item = newObjToParent(this.pinjiePre, this.pinjieRoot)
item.name = "Pre" .. i
this.pinjieList[i] = item
2021-10-27 12:50:15 +08:00
end
2024-09-06 10:38:56 +08:00
this.pinjieList[i]:GetComponent("Image").sprite = this.spLoader:LoadSprite(i <= pId and pinjieImage[2] or
pinjieImage[1])
2021-10-27 12:50:15 +08:00
end
for n = 1, this.pinjieRoot.transform.childCount - 1 do --超过品阶关闭显示
2024-09-06 10:38:56 +08:00
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)
2024-09-06 10:38:56 +08:00
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]
2024-09-06 10:38:56 +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
2024-09-06 10:38:56 +08:00
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
2024-09-06 10:38:56 +08:00
for i = 1, #this.shenhunList do
Util.SetParticleSortLayer(this.shenhunList[i].fx_shenhun, this.sortingOrder + 1)
2021-11-04 09:27:56 +08:00
end
2020-05-09 13:31:21 +08:00
end
2024-09-06 10:38:56 +08:00
2020-05-09 13:31:21 +08:00
--装备
function this.EquipInfo()
if not this.treasureDatas then
this.treasureDatas = {}
end
2024-09-06 10:38:56 +08:00
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)
2024-09-06 10:38:56 +08:00
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
2024-09-06 10:38:56 +08:00
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]))
2024-09-06 10:38:56 +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)
2024-09-06 10:38:56 +08:00
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
2024-09-06 10:38:56 +08:00
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
2024-09-06 10:38:56 +08:00
local b = #curHeroData.jewels > 0
2023-02-18 13:31:36 +08:00
-- this.babyTitle.gameObject:SetActive(b)
-- this.babyGrid.gameObject:SetActive(b)
2024-09-06 10:38:56 +08:00
local v3 = b and Vector2.New(0, 75) or Vector2.New(0, 75)
this.equipTitle.transform:DOAnchorPos(v3, 0)
2020-05-09 13:31:21 +08:00
for n = 1, #curHeroData.jewels do
2024-09-06 10:38:56 +08:00
local did = curHeroData.jewels[n]
local data = EquipTreasureManager.GetSingleTreasureByIdDyn(did)
if not data then
data = MonsterCampManager.GetSingleTreasureByIdDyn(did)
end
if not data then
2024-09-06 10:38:56 +08:00
data = ExpeditionManager.GetSingleTreasureByIdDyn(did)
end
2024-09-06 10:38:56 +08:00
if not data then
data = GoodFriendManager.GetSingleTreasureByIdDyn(did)
end
2024-09-06 10:38:56 +08:00
local pos = Util.GetGameObject(this.babyGrid, "Pre" .. n .. "/pos")
local btn = Util.GetGameObject(pos, "mask")
if not this.treasureDatas[pos] then
2024-09-06 10:38:56 +08:00
this.treasureDatas[pos] = SubUIManager.Open(SubUIConfig.ItemView, pos.transform)
end
this.treasureDatas[pos].gameObject:SetActive(true)
this.treasureDatas[pos].transform:SetAsFirstSibling()
2024-09-06 10:38:56 +08:00
this.treasureDatas[pos]:OnOpen(false, { data.id, 0 }, 0.8, false, false, false, 0, did)
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)
2024-09-06 10:38:56 +08:00
UIManager.OpenPanel(UIName.RewardTalismanSingleShowPopup2, this, data, 0, false, nil, curHeroData, n + 4)
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
2024-09-06 10:38:56 +08:00
local did = curHeroData.faxiang[n]
2023-02-19 20:08:48 +08:00
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
2024-09-06 10:38:56 +08:00
data = ExpeditionManager.GetSingleTreasureByIdDyn(did)
2023-02-19 20:08:48 +08:00
end
2024-09-06 10:38:56 +08:00
if not data then
data = GoodFriendManager.GetSingleFaXiangByIdDyn(did)
2023-02-19 20:08:48 +08:00
end
2024-09-06 10:38:56 +08:00
local pos = Util.GetGameObject(this.faXiangGrid, "Pre" .. n .. "/pos")
local btn = Util.GetGameObject(pos, "mask")
2023-02-19 20:08:48 +08:00
if not this.treasureDatas[pos] then
2024-09-06 10:38:56 +08:00
this.treasureDatas[pos] = SubUIManager.Open(SubUIConfig.ItemView, pos.transform)
2023-02-19 20:08:48 +08:00
end
this.treasureDatas[pos].gameObject:SetActive(true)
this.treasureDatas[pos].transform:SetAsFirstSibling()
2024-09-06 10:38:56 +08:00
this.treasureDatas[pos]:OnOpen(false, { data.id, 0 }, 0.8, false, false, false, 0, did)
Util.AddOnceClick(btn, function()
2023-02-19 20:08:48 +08:00
if did and data then
-- UIManager.OpenPanel(UIName.RoleEquipTreasureChangePopup,this,2,curHeroData,data,nil,pos,0)
2024-09-06 10:38:56 +08:00
UIManager.OpenPanel(UIName.RewardTalismanSingleShowPopup2, this, data, 0, false, nil, curHeroData, n + 6)
2023-02-19 20:08:48 +08:00
end
end)
end
2020-05-09 13:31:21 +08:00
end
2024-09-06 10:38:56 +08:00
2020-05-09 13:31:21 +08:00
--魂印
2020-07-01 10:54:39 +08:00
2020-05-09 13:31:21 +08:00
function this.SoulPrintInfo()
local curHeroSoulPrintDatas = {}
-- 没有魂印不显示
2024-09-06 10:38:56 +08:00
if #curHeroData.soulPrintList == 0 then
this.soulPrintInfo.gameObject:SetActive(false)
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)
2024-09-06 10:38:56 +08:00
return
end
this.soulPrintInfo.gameObject:SetActive(true)
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
2024-09-06 10:38:56 +08:00
for i, v in pairs(curHeroData.soulPrintList) do --生成预设
2020-05-09 13:31:21 +08:00
if not soulPrintPreList[i] then
2024-09-06 10:38:56 +08:00
soulPrintPreList[i] = newObjToParent(this.soulPrintPre, this.soulPrintGrid)
2020-05-09 13:31:21 +08:00
end
2024-09-06 10:38:56 +08:00
soulPrintPreList[i].name = "Pre" .. i
soulPrintPreList[i]:SetActive(true)
--特效层级重设
2024-09-06 10:38:56 +08:00
for i = 1, #soulPrintPreList do
Util.AddParticleSortLayer(soulPrintPreList[i], this.sortingOrder - orginLayer2)
end
orginLayer2 = this.sortingOrder
2024-09-06 10:38:56 +08:00
orginLayer = this.sortingOrder
local frame = Util.GetGameObject(soulPrintPreList[i], "Frame"):GetComponent("Image")
local icon = Util.GetGameObject(soulPrintPreList[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(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)
Util.AddOnceClick(soulPrintPreList[i], function()
UIManager.OpenPanel(UIName.SoulPrintPopUp, 3, curHeroData.dynamicId, v.equipId)
2020-05-09 13:31:21 +08:00
end)
end
end
function this.SkillInfo()
2024-09-06 10:38:56 +08:00
local skillList = HeroManager.GetCurHeroSidAndCurStarAllSkillDatas2(curHeroData.heroConfig.Id,
curHeroData.heroConfig.MaxRank, curHeroData.star)
2022-05-19 22:24:02 +08:00
local skillList2
2024-09-06 10:38:56 +08:00
if curHeroData.heroConfig.MaxRank > 9 then
skillList2 = HeroManager.GetCurHeroSidAndCurStarAllSkillDatas2(curHeroData.heroConfig.Id, 10, curHeroData.star)
2022-05-19 22:24:02 +08:00
end
2024-03-21 15:20:45 +08:00
--LogError("curHeroData.HeroTraining.trainingLv=="..)
2024-09-06 10:38:56 +08:00
local lv = 1
if curHeroData.HeroTraining and curHeroData.HeroTraining.trainingLv ~= 0 then
lv = curHeroData.HeroTraining.trainingLv
2024-03-21 15:20:45 +08:00
end
2024-09-06 10:38:56 +08:00
this.trainlevel:GetComponent("Text").text = Language[12242] .. NumToComplexFont[lv] .. Language[10065]
for i = 1, this.skillGrid.transform.childCount do
2024-09-06 10:38:56 +08:00
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
2024-09-06 10:38:56 +08:00
local go = this.skillGrid.transform:GetChild(i - 1).gameObject
go:SetActive(true)
2024-09-06 10:38:56 +08:00
Util.GetGameObject(go.transform, "Icon"):GetComponent("Image").sprite = this.spLoader:LoadSprite(
GetResourcePath(skillList[i].skillConfig.Icon))
2024-09-06 10:38:56 +08:00
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
2024-09-06 10:38:56 +08:00
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)
2024-09-06 10:38:56 +08:00
this.selsectSkillImage.transform.position = Util.GetGameObject(go.transform, "Icon").transform.position
local skillData = {}
skillData.skillConfig = skillList[i].skillConfig
2024-09-06 10:38:56 +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)
2024-09-06 10:38:56 +08:00
if skillList2 and skillList2[i] and i > 2 then
nextData = skillList2[i]
nextData.isOpen = skillList2[i].isOpen
nextData.needStar = skillList2[i].needStar
2022-05-19 22:24:02 +08:00
--飞升技能
2024-09-06 10:38:56 +08:00
if i == 6 then
panel = UIManager.OpenPanel(UIName.SkillInfoPopup, skillData, 1, 10, maxLv, i)
2022-05-19 22:24:02 +08:00
else
2024-09-06 10:38:56 +08:00
local training = HeroManager.GetTrainingPasivvSkill(nextData.needStar, curHeroData.heroConfig.Id)
panel = UIManager.OpenPanel(UIName.SkillInfoPopup, nextData, 1, 10, maxLv, i, skillData, nil, nil,
training)
2022-05-19 22:24:02 +08:00
end
else
2024-09-06 10:38:56 +08:00
panel = UIManager.OpenPanel(UIName.SkillInfoPopup, skillData, 1, 10, maxLv, i)
2022-05-19 22:24:02 +08:00
end
this.skillGrid:GetComponent("Canvas").sortingOrder = panel.sortingOrder + 1
2024-09-06 10:38:56 +08:00
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 = {}
-- 没有魂印不显示
2024-09-06 10:38:56 +08:00
if curHeroData.godPrintList == nil or #curHeroData.godPrintList == 0 then
2022-04-22 18:23:01 +08:00
this.godPrintInfo.gameObject:SetActive(false)
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)
2024-09-06 10:38:56 +08:00
return
2022-04-22 18:23:01 +08:00
end
2023-03-10 13:29:22 +08:00
2022-04-22 18:23:01 +08:00
this.godPrintInfo.gameObject:SetActive(true)
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(godPrintPreList) do
if value then
value:SetActive(false)
end
end
2024-09-06 10:38:56 +08:00
for i, v in pairs(curHeroData.godPrintList) do --生成预设
2022-04-22 18:23:01 +08:00
if not godPrintPreList[i] then
2024-09-06 10:38:56 +08:00
godPrintPreList[i] = newObjToParent(this.godPrintPre, this.godPrintGrid)
2022-04-22 18:23:01 +08:00
end
2024-09-06 10:38:56 +08:00
godPrintPreList[i].name = "Pre" .. i
2022-04-22 18:23:01 +08:00
godPrintPreList[i]:SetActive(true)
--特效层级重设
2024-09-06 10:38:56 +08:00
for i = 1, #godPrintPreList do
Util.AddParticleSortLayer(godPrintPreList[i], this.sortingOrder - orginLayer2)
end
2022-04-22 18:23:01 +08:00
orginLayer2 = this.sortingOrder
2024-09-06 10:38:56 +08:00
orginLayer = this.sortingOrder
local frame = Util.GetGameObject(godPrintPreList[i], "Frame"):GetComponent("Image")
local lvTxt = Util.GetGameObject(godPrintPreList[i], "lv"):GetComponent("Text")
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))
lvTxt.gameObject:SetActive(equipConfig[v.equipId].Star > 0)
lvTxt.text = "+" .. equipConfig[v.equipId].Star
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)
2022-04-22 18:23:01 +08:00
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
-- 没有魂印不显示
2024-09-06 10:38:56 +08:00
if curHeroData.giftIds == nil or #curHeroData.giftIds == 0 then
2023-09-13 14:57:48 +08:00
this.giftInfo.gameObject:SetActive(false)
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)
2024-09-06 10:38:56 +08:00
return
2023-09-13 14:57:48 +08:00
end
this.giftInfo.gameObject:SetActive(true)
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(giftList) do
if value then
value:SetActive(false)
end
end
2024-09-06 10:38:56 +08:00
for i = 1, #curHeroData.giftIds do
LogError("curHeroData.giftIds[i]===========" .. curHeroData.giftIds[i])
2023-09-13 14:57:48 +08:00
end
2024-09-06 10:38:56 +08:00
for i = 1, #curHeroData.giftIds do --生成预设
2023-09-13 14:57:48 +08:00
if not giftList[i] then
2024-09-06 10:38:56 +08:00
giftList[i] = newObjToParent(this.giftPre, this.giftGrid)
2023-09-13 14:57:48 +08:00
end
2024-09-06 10:38:56 +08:00
giftList[i].name = "Pre" .. i
2023-09-13 14:57:48 +08:00
giftList[i]:SetActive(true)
--特效层级重设
2024-09-06 10:38:56 +08:00
for i = 1, #giftList do
Util.AddParticleSortLayer(giftList[i], this.sortingOrder - orginLayer2)
end
2023-09-13 14:57:48 +08:00
orginLayer2 = this.sortingOrder
2024-09-06 10:38:56 +08:00
orginLayer = this.sortingOrder
local id = curHeroData.giftIds[i]
2023-09-13 14:57:48 +08:00
--LogError("v==============="..id)
2024-09-06 10:38:56 +08:00
local frame = Util.GetGameObject(giftList[i], "Frame"):GetComponent("Image")
local icon = Util.GetGameObject(giftList[i], "Icon"):GetComponent("Image")
Util.GetGameObject(giftList[i], "Name"):SetActive(false)
frame.sprite = this.spLoader:LoadSprite(GetQuantityImageByquality(equipConfig[id].Quality))
icon.sprite = this.spLoader:LoadSprite(GetResourcePath(itemConfig[id].ResourceID))
Util.AddOnceClick(giftList[i], function()
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-11-28 15:55:32 +08:00
--潜能信息
function this.PotentyInfo()
local curHeroSoulPrintDatas = {}
2024-09-06 10:38:56 +08:00
2023-11-28 15:55:32 +08:00
-- 没有潜能不显示
2024-09-06 10:38:56 +08:00
if curHeroData.potential == nil or #curHeroData.potential == 0 then
2023-11-28 15:55:32 +08:00
this.potentyInfo.gameObject:SetActive(false)
--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)
2024-09-06 10:38:56 +08:00
return
2023-11-28 15:55:32 +08:00
end
-- for i=1,#curHeroData.potential do
-- LogError("curHeroData.potential[i]===========" .. curHeroData.potential[i])
-- end
this.potentyInfo.gameObject:SetActive(true)
--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(potencyList) do
if value then
value:SetActive(false)
end
end
2024-09-06 10:38:56 +08:00
for i = 1, #curHeroData.potential do --生成预设
2023-11-28 15:55:32 +08:00
if not potencyList[i] then
2024-09-06 10:38:56 +08:00
potencyList[i] = newObjToParent(this.potentyPre, this.potentyGrid)
2023-11-28 15:55:32 +08:00
end
2024-09-06 10:38:56 +08:00
potencyList[i].name = "Pre" .. i
2023-11-28 15:55:32 +08:00
potencyList[i]:SetActive(true)
--特效层级重设
2024-09-06 10:38:56 +08:00
for i = 1, #potencyList do
Util.AddParticleSortLayer(potencyList[i], this.sortingOrder - orginLayer2)
end
2023-11-28 15:55:32 +08:00
orginLayer2 = this.sortingOrder
2024-09-06 10:38:56 +08:00
orginLayer = this.sortingOrder
local poten = curHeroData.potential[i]
2023-11-28 15:55:32 +08:00
--LogError("v==============="..id)
2024-09-06 10:38:56 +08:00
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)
2023-11-28 15:55:32 +08:00
--frame.sprite=this.spLoader:LoadSprite(GetQuantityImageByquality(equipConfig[id].Quality))
2024-09-06 10:38:56 +08:00
local config = ConfigManager.GetConfigData(ConfigName.PotentialNewConfig, i)
icon.sprite = this.spLoader:LoadSprite(config.Icon)
LogError("poten.type===============================" .. poten.lv)
2023-11-28 15:55:32 +08:00
--LogError("poten.type==============================="..poten.type.." uplv=="..poten.upLv.." poten.giftLv==="..poten.giftLv)
2024-09-06 10:38:56 +08:00
Util.AddOnceClick(potencyList[i], function()
local data = {}
data.id = id
UIManager.OpenPanel(UIName.HeroPotencyInfoPopup, i, poten.lv, poten.giftLv)
2023-11-28 15:55:32 +08:00
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
2024-09-06 10:38:56 +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)
2024-09-06 10:38:56 +08:00
2020-05-09 13:31:21 +08:00
local isOpen = TalismanManager.GetCurHeroIsOpenTalisman(curHeroData)
this.talismanLock:SetActive(not isOpen)
2024-09-06 10:38:56 +08:00
local data = FaLingManager.GetEquipDataByDid(curHeroData.baublesId)
2023-11-28 18:44:36 +08:00
--他人法宝数据
2024-09-06 10:38:56 +08:00
if data == nil then
data = curHeroData.faLingData
2023-11-28 18:44:36 +08:00
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)
2024-09-06 10:38:56 +08:00
this.talismanIcon:GetComponent("Image").sprite = this.spLoader:LoadSprite(GetResourcePath(ConfigManager
.GetConfigData(ConfigName.ItemConfig, curTalisman.TalismanaId).ResourceID))
2023-11-28 18:44:36 +08:00
end
2020-05-09 13:31:21 +08:00
Util.AddOnceClick(this.talismanBtn.gameObject, function()
2023-11-28 18:44:36 +08:00
-- if isOpen then
-- UIManager.OpenPanel(UIName.TalismanInfoPopup, curHeroData.heroConfig, 1, curHeroData.talismanList)
-- else
2024-08-29 21:36:51 +08:00
-- PopupTipPanel.ShowTip("此神将尚未获得专属法宝!")
2023-11-28 18:44:36 +08:00
-- end
if curHeroData.baublesId then
2024-09-06 10:38:56 +08:00
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()
--特效层级重设
2024-09-06 10:38:56 +08:00
for i = 1, #soulPrintPreList do
Util.AddParticleSortLayer(soulPrintPreList[i], this.sortingOrder - orginLayer)
end
for i = 1, #godPrintPreList do
Util.AddParticleSortLayer(godPrintPreList[i], this.sortingOrder - orginLayer)
end
for i = 1, #giftList do
Util.AddParticleSortLayer(giftList[i], this.sortingOrder - orginLayer)
end
for i = 1, #potencyList do
Util.AddParticleSortLayer(potencyList[i], this.sortingOrder - orginLayer)
end
for i = 1, #this.shenhunList do
Util.SetParticleSortLayer(this.shenhunList[i].fx_shenhun, this.sortingOrder + 1)
end
Util.SetParticleSortLayer(this.head_Star, this.sortingOrder + 1)
2020-07-01 10:54:39 +08:00
orginLayer = this.sortingOrder
end
2024-09-06 10:38:56 +08:00
return RoleInfoPopup