【七界试炼】修复无法取消激活

dev_chengFeng
ZhangBiao 2021-10-08 11:53:54 +08:00
parent b6a9cbc1c1
commit eb816dcc89
1 changed files with 17 additions and 9 deletions

View File

@ -28,18 +28,26 @@ end
function QiJieSingleTreasure:BindEvent() function QiJieSingleTreasure:BindEvent()
Util.AddClick(self.activeBtn,function() Util.AddClick(self.activeBtn,function()
if BagManager.GetTotalItemNum(self.data.Cost[1])>=self.data.Cost[2] then local state = self.data.state
local state = self.data.state if state == 2 then
if BagManager.GetTotalItemNum(self.data.Cost[1])>=self.data.Cost[2] then
NetManager.SevenWorldRelicRequest(self.data.Id,function ()
Game.GlobalEvent:DispatchEvent(GameEvent.QiJieShiLian.BuySingleTreasure)
self.parent:ClosePanel()
PopupTipPanel.ShowTip("<color=red>成功解锁遗物并将其激活!</color>")
end)
end
elseif state == 0 then
NetManager.SevenWorldRelicRequest(self.data.Id,function () NetManager.SevenWorldRelicRequest(self.data.Id,function ()
Game.GlobalEvent:DispatchEvent(GameEvent.QiJieShiLian.BuySingleTreasure) Game.GlobalEvent:DispatchEvent(GameEvent.QiJieShiLian.BuySingleTreasure)
self.parent:ClosePanel() self.parent:ClosePanel()
if state == 0 then PopupTipPanel.ShowTip("<color=red>已激活遗物!</color>")
PopupTipPanel.ShowTip("<color=red>已激活遗物!</color>") end)
elseif state == 1 then elseif state == 1 then
PopupTipPanel.ShowTip("<color=red>已取消遗物激活状态!</color>") NetManager.SevenWorldRelicRequest(self.data.Id,function ()
elseif state == 2 then Game.GlobalEvent:DispatchEvent(GameEvent.QiJieShiLian.BuySingleTreasure)
PopupTipPanel.ShowTip("<color=red>成功解锁遗物并将其激活!</color>") self.parent:ClosePanel()
end PopupTipPanel.ShowTip("<color=red>已取消遗物激活状态!</color>")
end) end)
end end
end) end)