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

89 lines
4.2 KiB
Lua

require("Base/BasePanel")
RoleUpLvBreakSuccessPanel = Inherit(BasePanel)
local this=RoleUpLvBreakSuccessPanel
--初始化组件(用于子类重写)
function RoleUpLvBreakSuccessPanel:InitComponent()
this.spLoader = SpriteLoader.New()
this.BtnBack = Util.GetGameObject(self.transform, "mask")
this.lvEndInfo=Util.GetGameObject(self.transform, "proInfo/lvEndText"):GetComponent("Text")
this.upLvMaskPanleProAtk=Util.GetGameObject(self.transform,"proInfo/curPros/mainPro/curProVale"):GetComponent("Text")
this.upLvMaskPanleProHp=Util.GetGameObject(self.transform,"proInfo/curPros/otherPro1/curProVale"):GetComponent("Text")
this.upLvMaskPanleProPhyDef=Util.GetGameObject(self.transform,"proInfo/curPros/otherPro2/curProVale"):GetComponent("Text")
this.upLvMaskPanleProMagDef=Util.GetGameObject(self.transform,"proInfo/curPros/otherPro3/curProVale"):GetComponent("Text")
-- this.upLvMaskPanleProSpeed=Util.GetGameObject(self.transform,"proInfo/curPros/otherPro4/curProVale"):GetComponent("Text")
this.upLvMaskPanleNextProAtk=Util.GetGameObject(self.transform,"proInfo/nextPros/mainPro/nextProVale"):GetComponent("Text")
this.upLvMaskPanleNextProHp=Util.GetGameObject(self.transform,"proInfo/nextPros/otherPro1/nextProVale"):GetComponent("Text")
this.upLvMaskPanleNextProPhyDef=Util.GetGameObject(self.transform,"proInfo/nextPros/otherPro2/nextProVale"):GetComponent("Text")
this.upLvMaskPanleNextProMagDef=Util.GetGameObject(self.transform,"proInfo/nextPros/otherPro3/nextProVale"):GetComponent("Text")
-- this.upLvMaskPanleNextProSpeed=Util.GetGameObject(self.transform,"proInfo/nextPros/otherPro4/nextProVale"):GetComponent("Text")
end
--绑定事件(用于子类重写)
function RoleUpLvBreakSuccessPanel:BindEvent()
Util.AddClick(this.BtnBack, function()
PlaySoundWithoutClick(SoundConfig.Sound_UICancel)
self:ClosePanel()
end)
end
--添加事件监听(用于子类重写)
function RoleUpLvBreakSuccessPanel:AddListener()
end
--移除事件监听(用于子类重写)
function RoleUpLvBreakSuccessPanel:RemoveListener()
end
--界面打开时调用(用于子类重写)
function RoleUpLvBreakSuccessPanel:OnOpen(...)
local args = {...}
local curHeroData=args[1]
local nextHeroBreakId=args[2]
local curHeroRankUpConfigOpenLevel=args[3]
this.lvEndInfo.text=string.format(Language[11791],curHeroRankUpConfigOpenLevel)
--计算面板属性old
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]
--计算面板属性cur
-- local curLvAllAddProVal=HeroManager.CalculateHeroAllProValList(2,curHeroData.dynamicId,false,nextHeroBreakId,curHeroData.upStarId)
-- local curLvAllAddProVal,curPower = HeroPowerManager.GetNextHeroPower(curHeroData.dynamicId, nil,nextHeroBreakId ,curHeroData.upStarId)
-- 生成一个临时英雄数据,使用完成后需主动清理
local tempDId, tempData = HeroTempPropManager.CreateTempHero(curHeroData.dynamicId)
tempData.upStarId = curHeroData.upStarId
tempData.breakId = nextHeroBreakId
local curLvAllAddProVal = HeroTempPropManager.GetTempHeroProp(tempDId)
HeroTempPropManager.ClearTempHero(tempDId)-- 清理
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]
end
--界面关闭时调用(用于子类重写)
function RoleUpLvBreakSuccessPanel:OnClose()
end
--界面销毁时调用(用于子类重写)
function RoleUpLvBreakSuccessPanel:OnDestroy()
this.spLoader:Destroy()
end
return RoleUpLvBreakSuccessPanel