miduo_client/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleFlyUpSuccessPanel.lua

241 lines
12 KiB
Lua
Raw Normal View History

2025-03-14 11:58:20 +08:00
require("Base/BasePanel")
2021-12-28 16:20:07 +08:00
RoleFlyUpSuccessPanel = Inherit(BasePanel)
2024-09-06 10:38:56 +08:00
local this = RoleFlyUpSuccessPanel
this.skillConfig = ConfigManager.GetConfig(ConfigName.SkillConfig)
local passiveSkillConfig = ConfigManager.GetConfig(ConfigName.PassiveSkillConfig)
2021-12-28 16:20:07 +08:00
local orginLayer = 20
local callBack = nil
local heroRankupConfig = ConfigManager.GetConfig(ConfigName.HeroRankupConfig)
local heroConfig = ConfigManager.GetConfig(ConfigName.HeroConfig)
--初始化组件(用于子类重写)
function RoleFlyUpSuccessPanel:InitComponent()
this.spLoader = SpriteLoader.New()
orginLayer = 20
this.BtnBack = Util.GetGameObject(self.transform, "backBtn")
this.mask = Util.GetGameObject(self.transform, "mask")
2024-09-06 10:38:56 +08:00
this.live2dRoot = Util.GetGameObject(self.transform, "live2dRoot")
2021-12-28 16:20:07 +08:00
this.heroName = Util.GetGameObject(self.transform, "heroInfo/nameAndPossLayout/heroName"):GetComponent("Text")
this.profession = Util.GetGameObject(self.transform, "Pos/PosImage"):GetComponent("Image")
2024-09-06 10:38:56 +08:00
this.proImage = Util.GetGameObject(self.transform, "heroInfo/nameAndPossLayout/proImage/proImage"):GetComponent(
"Image")
2021-12-28 16:20:07 +08:00
--this.posText = Util.GetGameObject(self.transform, "heroInfo/nameAndPossLayout/posText/posText"):GetComponent("Text")
this.starGrid = Util.GetGameObject(self.transform, "heroInfo/sartAndLvLayout")
--this.qualityImage=Util.GetGameObject(self.transform,"quality"):GetComponent("Image")
--this.quality=Util.GetGameObject(self.transform,"quality/qualityText")
--this.doubleQuality=Util.GetGameObject(self.transform,"quality/qualityDoubleText")
2024-09-06 10:38:56 +08:00
this.posBgImage = Util.GetGameObject(self.transform, "Pos"):GetComponent("Image")
2021-12-28 16:20:07 +08:00
-- this.posImage=Util.GetGameObject(self.transform,"Pos/PosImage"):GetComponent("Image")
2024-09-06 10:38:56 +08:00
this.posText = Util.GetGameObject(self.transform, "Pos/PosText"):GetComponent("Text")
this.flyImage = Util.GetGameObject(self.transform, "heroInfo/flyUpImg"):GetComponent("Image")
this.upLvMaskPanleProAtk = Util.GetGameObject(self.transform, "proInfo/GameObject/proInfo/curPros/mainPro/curProVale")
:GetComponent("Text")
this.upLvMaskPanleProHp = Util.GetGameObject(self.transform,
"proInfo/GameObject/proInfo/curPros/otherPro1/curProVale"):GetComponent("Text")
this.upLvMaskPanleProPhyDef = Util.GetGameObject(self.transform,
"proInfo/GameObject/proInfo/curPros/otherPro2/curProVale"):GetComponent("Text")
this.upLvMaskPanleProMagDef = Util.GetGameObject(self.transform,
"proInfo/GameObject/proInfo/curPros/otherPro3/curProVale"):GetComponent("Text")
this.upLvMaskPanleProSpeed = Util.GetGameObject(self.transform,
"proInfo/GameObject/proInfo/curPros/otherPro4/curProVale"):GetComponent("Text")
this.upLvMaskPanleNextProAtk = Util.GetGameObject(self.transform,
"proInfo/GameObject/proInfo/nextPros/mainPro/curProVale"):GetComponent("Text")
this.upLvMaskPanleNextProHp = Util.GetGameObject(self.transform,
"proInfo/GameObject/proInfo/nextPros/otherPro1/curProVale"):GetComponent("Text")
this.upLvMaskPanleNextProPhyDef = Util.GetGameObject(self.transform,
"proInfo/GameObject/proInfo/nextPros/otherPro2/curProVale"):GetComponent("Text")
this.upLvMaskPanleNextProMagDef = Util.GetGameObject(self.transform,
"proInfo/GameObject/proInfo/nextPros/otherPro3/curProVale"):GetComponent("Text")
this.upLvMaskPanleNextProSpeed = Util.GetGameObject(self.transform,
"proInfo/GameObject/proInfo/nextPros/otherPro4/curProVale"):GetComponent("Text")
this.upLvShowGoText = Util.GetGameObject(self.transform, "proInfo/GameObject/proInfo/Text"):GetComponent("Text")
this.talentInfoText = Util.GetGameObject(self.transform, "proInfo/GameObject/talentInfo/Text"):GetComponent("Text")
this.curTalentVale = Util.GetGameObject(self.transform, "proInfo/GameObject/talentInfo/curTalentVale"):GetComponent(
"Text")
this.talentInfoShowGo = Util.GetGameObject(self.transform, "proInfo/GameObject/talentInfo")
2021-12-28 16:20:07 +08:00
-- this.s1=Util.GetGameObject(self.transform,"proInfo/skillGrid/skillInfo1")
-- this.s1MiddleImage=Util.GetGameObject(self.transform,"proInfo/skillGrid/skillInfo1/Image (2)")
-- this.s1nextSkill=Util.GetGameObject(self.transform,"proInfo/skillGrid/skillInfo1/nextSkill")
-- this.s2=Util.GetGameObject(self.transform,"proInfo/skillGrid/skillInfo2")
-- this.s2MiddleImage=Util.GetGameObject(self.transform,"proInfo/skillGrid/skillInfo2/Image (2)")
-- this.s2nextSkill=Util.GetGameObject(self.transform,"proInfo/skillGrid/skillInfo2/nextSkill")
2024-09-06 10:38:56 +08:00
this.lvEndInfo = Util.GetGameObject(self.transform, "proInfo/lvEndText"):GetComponent("Text")
2021-12-28 16:20:07 +08:00
this.lvEndInfo.gameObject:SetActive(false)
this.UI_Effect_choukaSSR = Util.GetGameObject(self.transform, "UI_Effect_chouka_SSR")
this.UI_Effect_choukaSR = Util.GetGameObject(self.transform, "UI_Effect_chouka_SR")
this.UI_Effect_choukaR = Util.GetGameObject(self.transform, "UI_Effect_chouka_R")
-- this.skillTiShi = Util.GetGameObject(self.transform,"proInfo/skillTiShi"):GetComponent("Text")
end
--绑定事件(用于子类重写)
function RoleFlyUpSuccessPanel:BindEvent()
Util.AddClick(this.BtnBack, function()
PlaySoundWithoutClick(SoundConfig.Sound_UICancel)
self:ClosePanel()
end)
end
--添加事件监听(用于子类重写)
function RoleFlyUpSuccessPanel:AddListener()
end
--移除事件监听(用于子类重写)
function RoleFlyUpSuccessPanel:RemoveListener()
end
function RoleFlyUpSuccessPanel:OnSortingOrderChange()
Util.AddParticleSortLayer(this.UI_Effect_choukaSSR, self.sortingOrder - orginLayer)
Util.AddParticleSortLayer(this.UI_Effect_choukaSR, self.sortingOrder - orginLayer)
Util.AddParticleSortLayer(this.UI_Effect_choukaR, self.sortingOrder - orginLayer)
this.mask:GetComponent("Canvas").overrideSorting = true
this.mask:GetComponent("Canvas").sortingOrder = self.sortingOrder - 30
orginLayer = self.sortingOrder
end
--界面打开时调用(用于子类重写)
function RoleFlyUpSuccessPanel:OnOpen(...)
2024-09-06 10:38:56 +08:00
Util.GetGameObject(self.transform, "proInfo/GameObject/proInfo/curPros/mainPro/curProName"):GetComponent("Text").text =
Language[10980]
Util.GetGameObject(self.transform, "proInfo/GameObject/proInfo/nextPros/mainPro/curProName"):GetComponent("Text").text =
Language[10980]
2024-08-29 21:36:51 +08:00
this.upLvShowGoText.text = Language[12071]
2021-12-28 16:20:07 +08:00
2024-09-06 10:38:56 +08:00
local args = { ... }
local curHeroData = args[1]
local nextHeroUpStarId = args[2]
local curHeroRankUpConfigOpenLevel = args[3]
2021-12-28 16:20:07 +08:00
callBack = args[4]
--this.OnShowPanelData()
this.UI_Effect_choukaSSR:SetActive(curHeroData.heroConfig.Quality == 5)
this.UI_Effect_choukaSR:SetActive(curHeroData.heroConfig.Quality == 4)
this.UI_Effect_choukaR:SetActive(curHeroData.heroConfig.Quality == 3)
this.LiveName = curHeroData.live
this.LiveGO = poolManager:LoadLive(this.LiveName, this.live2dRoot.transform,
2024-09-06 10:38:56 +08:00
Vector3.one * curHeroData.heroConfig.Scale,
Vector3.New(curHeroData.heroConfig.Position[1], curHeroData.heroConfig.Position[2], 0))
SetHEeroLiveToward(this.LiveGO, curHeroData.heroConfig.Toward)
2021-12-28 16:20:07 +08:00
this.profession.sprite = this.spLoader:LoadSprite(GetHeroPosStr(curHeroData.heroConfig.Profession))
2024-09-06 10:38:56 +08:00
LogPink("curHeroData.changeProId" .. curHeroData.changeProId)
this.proImage.sprite = this.spLoader:LoadSprite(GetProStrImageByProNum(curHeroData.changeProId))
local upStar = curHeroData.star + 1
local flyImg = ""
if upStar == 11 then
flyImg = "r_tongyong_tianfufeishengxiao1"
elseif upStar == 12 then
flyImg = "r_tongyong_tianfufeishengxiao2"
elseif upStar == 13 then
flyImg = "r_tongyong_tianfufeishengxiao3"
2022-11-03 14:33:09 +08:00
else
2024-09-06 10:38:56 +08:00
flyImg = "r_tongyong_tianfufeishengxiao3"
2021-12-28 16:20:07 +08:00
end
2024-09-06 10:38:56 +08:00
this.flyImage.sprite = this.spLoader:LoadSprite(flyImg)
this.heroName.text = GetLanguageStrById(curHeroData.heroConfig.ReadingName)
2021-12-28 16:20:07 +08:00
--定位描述相关
2024-09-06 10:38:56 +08:00
this.posBgImage.sprite = this.spLoader:LoadSprite(GetHeroPosBgStr(curHeroData.heroConfig.Profession))
2021-12-28 16:20:07 +08:00
-- this.posImage.sprite=this.spLoader:LoadSprite(GetHeroPosStr(curHeroData.heroConfig.Profession))
2024-09-06 10:38:56 +08:00
this.posText.text = GetLanguageStrById(curHeroData.heroConfig.HeroLocation)
SetTextVerTial(this.posText.gameObject, Vector3.New(64, 0, 0), "MiddleLeft")
this.lvEndInfo.text = string.format(Language[12700], curHeroRankUpConfigOpenLevel)
2021-12-28 16:20:07 +08:00
--计算面板属性old
2024-09-06 10:38:56 +08:00
local oldLvAllAddProVal = HeroPropManager.GetHeroProp(curHeroData.dynamicId)
this.upLvMaskPanleProAtk.text = oldLvAllAddProVal[HeroProType.Attack]
this.upLvMaskPanleProHp.text = oldLvAllAddProVal[HeroProType.Hp]
this.upLvMaskPanleProPhyDef.text = oldLvAllAddProVal[HeroProType.PhysicalDefence]
this.upLvMaskPanleProMagDef.text = oldLvAllAddProVal[HeroProType.MagicDefence]
this.upLvMaskPanleProSpeed.text = oldLvAllAddProVal[HeroProType.Speed]
2021-12-28 16:20:07 +08:00
--计算面板属性cur
-- local curLvAllAddProVal=HeroManager.CalculateHeroAllProValList(2,curHeroData.dynamicId,false,curHeroData.breakId,nextHeroUpStarId)
-- 生成一个临时英雄数据,使用完成后需主动清理
local tempDId, tempData = HeroTempPropManager.CreateTempHero(curHeroData.dynamicId)
tempData.upStarId = nextHeroUpStarId
tempData.breakId = curHeroData.breakId
2024-09-06 10:38:56 +08:00
local curLvAllAddProVal = HeroTempPropManager.GetTempHeroProp(tempDId) --HeroPowerManager.GetNextHeroPower(curHeroData.dynamicId, nil,curHeroData.breakId,nextHeroUpStarId)
HeroTempPropManager.ClearTempHero(tempDId) -- 清理
2021-12-28 16:20:07 +08:00
2024-09-06 10:38:56 +08:00
this.upLvMaskPanleNextProAtk.text = curLvAllAddProVal[HeroProType.Attack]
this.upLvMaskPanleNextProHp.text = curLvAllAddProVal[HeroProType.Hp]
this.upLvMaskPanleNextProPhyDef.text = curLvAllAddProVal[HeroProType.PhysicalDefence]
this.upLvMaskPanleNextProMagDef.text = curLvAllAddProVal[HeroProType.MagicDefence]
this.upLvMaskPanleNextProSpeed.text = curLvAllAddProVal[HeroProType.Speed]
2021-12-28 16:20:07 +08:00
--天赋2#7#127107
2024-09-06 10:38:56 +08:00
LogPink("curHeroData.upStarId " .. nextHeroUpStarId)
local talentSKillsConFig = ConfigManager.GetConfigData(ConfigName.HeroConfig, curHeroData.id).Awaken
2021-12-28 16:20:07 +08:00
local upStarSkillDataList = {}
for i = 1, #talentSKillsConFig do
2024-09-06 10:38:56 +08:00
if talentSKillsConFig[i][1] == 2 then --升星
LogPink("talentSKillsConFig[i][2] " .. talentSKillsConFig[i][2])
if nextHeroUpStarId == talentSKillsConFig[i][2] then
local _titleStr = NumToSimplenessFont[heroRankupConfig[nextHeroUpStarId].Phase[2]] ..
Language[12701]
2021-12-28 16:20:07 +08:00
local _passiveSkillId = passiveSkillConfig[talentSKillsConFig[i][3]].Id
if upStarSkillDataList[nextHeroUpStarId] then
2024-09-06 10:38:56 +08:00
upStarSkillDataList[nextHeroUpStarId] = {
titleStr = _titleStr,
str = upStarSkillDataList
[nextHeroUpStarId].str ..
"  " .. GetLanguageStrById(passiveSkillConfig[talentSKillsConFig[i][3]].Desc)
}
2021-12-28 16:20:07 +08:00
else
2024-09-06 10:38:56 +08:00
upStarSkillDataList[nextHeroUpStarId] = {
titleStr = _titleStr,
str = GetLanguageStrById(
passiveSkillConfig[talentSKillsConFig[i][3]].Desc)
}
2021-12-28 16:20:07 +08:00
end
end
end
end
2024-09-06 10:38:56 +08:00
this.curTalentVale = Util.GetGameObject(self.transform, "proInfo/GameObject/talentInfo/curTalentVale"):GetComponent(
"Text")
this.talentInfoShowGo = Util.GetGameObject(self.transform, "proInfo/GameObject/talentInfo")
2021-12-28 16:20:07 +08:00
2024-09-06 10:38:56 +08:00
if upStarSkillDataList and LengthOfTable(upStarSkillDataList) > 0 then
2021-12-28 16:20:07 +08:00
this.talentInfoShowGo:SetActive(true)
2024-08-29 21:36:51 +08:00
this.talentInfoText.text = Language[12728]
2021-12-28 16:20:07 +08:00
this.curTalentVale.text = upStarSkillDataList[nextHeroUpStarId].str
else
this.talentInfoShowGo:SetActive(false)
end
2024-09-06 10:38:56 +08:00
2021-12-28 16:20:07 +08:00
if curHeroData.heroConfig.Quality == 5 and curHeroData.heroConfig.Natural >= 13 then
2024-09-06 10:38:56 +08:00
if curHeroData.star + 1 >= 5 and curHeroData.star + 1 < 15 then
HeroManager.DetectionOpenFiveStarActivity(curHeroData.star + 1)
2021-12-28 16:20:07 +08:00
end
end
end
function RoleFlyUpSuccessPanel:GetEquipSkillData(skillId)
return this.skillConfig[skillId]
end
--界面关闭时调用(用于子类重写)
function RoleFlyUpSuccessPanel:OnClose()
if this.LiveName then
poolManager:UnLoadLive(this.LiveName, this.LiveGO)
this.LiveName = nil
end
if callBack then
callBack()
callBack = nil
end
end
--界面销毁时调用(用于子类重写)
function RoleFlyUpSuccessPanel:OnDestroy()
this.spLoader:Destroy()
end
2024-09-06 10:38:56 +08:00
return RoleFlyUpSuccessPanel