【花虚坛】置换界面空白修复

dev_chengFeng
ZhangBiao 2021-05-08 14:31:35 +08:00
parent 40bc700f65
commit 1c9ae3884b
1 changed files with 2 additions and 17 deletions

View File

@ -56,7 +56,6 @@ function this:BindEvent()
else
NetManager.SaveHeroChangeRequest(curSelectHero.dynamicId,function (msg)
HeroManager.ResetHeroChangeId(curSelectHero.dynamicId,msg.heroTempId)--改变英雄changeId
this.replaceHero:SetActive(true)
this.cancelBtn:SetActive(true)
this.replaceBtn:SetActive(false)
@ -65,9 +64,7 @@ function this:BindEvent()
this.replaceBg:SetActive(false)
this.text:SetActive(false)
this.cost:SetActive(false)
this.ShowCostInfo()
local value = this.RebuildData(msg.heroTempId,curSelectHero)
this.SetHero(this.replaceHero,value)
end)
@ -77,7 +74,6 @@ function this:BindEvent()
Util.AddClick(this.cancelBtn,function()
NetManager.CancelHeroChangeRequest(curSelectHero.dynamicId,function (msg)
HeroManager.ResetHeroChangeId(curSelectHero.dynamicId)--改变英雄changeId
this.replaceHero:SetActive(false)
this.needHero:SetActive(true)
this.cancelBtn:SetActive(false)
@ -87,39 +83,26 @@ function this:BindEvent()
this.replaceBg:SetActive(true)
this.text:SetActive(false)
this.cost:SetActive(true)
this.ShowCostInfo()
end)
end)
--保存置换
Util.AddClick(this.saveBtn,function()
NetManager.DoHeroChangeRequest(curSelectHero.dynamicId,function (msg)
this.replaceHero:SetActive(false)
this.needHero:SetActive(false)
this.needBg:SetActive(true)
this.replaceBg:SetActive(true)
this.text:SetActive(true)
this.cost:SetActive(false)
this.ShowCostInfo()
HeroManager.DeleteHeroDatas({curSelectHero.dynamicId})
for i = 1, #msg.drop.Hero do
HeroManager.UpdateHeroDatas(msg.drop.Hero[i])
ExpeditionManager.InitHeroHpValue(msg.drop.Hero[i].id)
end
curSelectHero = HeroManager.GetSingleHeroData(msg.drop.Hero[1].id)
this.ShowCurrPosHeroReplace(curIndex)
-- for i = 1, #heroDatas do
-- if heroSelectBtn[i] and heroDatas[i] then
-- heroSelectBtn[i]:SetActive(heroDatas[i].dynamicId == curSelectHero.dynamicId)
-- end
-- end
end)
end)
@ -173,6 +156,8 @@ end
--英雄类型按钮点击事件
function this.HeroReplaceBtnClick(_btn,_curIndex)
curIndex = _curIndex
this.needBg:SetActive(true)
this.replaceBg:SetActive(true)
this.SetBtnSelect(_btn)
this.ShowCurrPosHeroReplace(_curIndex)
end