From eb816dcc895b6a61c5c902f0d56723e20012dd10 Mon Sep 17 00:00:00 2001 From: ZhangBiao Date: Fri, 8 Oct 2021 11:53:54 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=B8=83=E7=95=8C=E8=AF=95=E7=82=BC?= =?UTF-8?q?=E3=80=91=E4=BF=AE=E5=A4=8D=E6=97=A0=E6=B3=95=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E6=BF=80=E6=B4=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../View/GeneralPopup_QiJieSingleTreasure.lua | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Popup/View/GeneralPopup_QiJieSingleTreasure.lua b/Assets/ManagedResources/~Lua/Modules/Popup/View/GeneralPopup_QiJieSingleTreasure.lua index c30919e707..e4cd29152d 100644 --- a/Assets/ManagedResources/~Lua/Modules/Popup/View/GeneralPopup_QiJieSingleTreasure.lua +++ b/Assets/ManagedResources/~Lua/Modules/Popup/View/GeneralPopup_QiJieSingleTreasure.lua @@ -28,18 +28,26 @@ end function QiJieSingleTreasure:BindEvent() 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("成功解锁遗物并将其激活!") + end) + end + elseif state == 0 then NetManager.SevenWorldRelicRequest(self.data.Id,function () Game.GlobalEvent:DispatchEvent(GameEvent.QiJieShiLian.BuySingleTreasure) self.parent:ClosePanel() - if state == 0 then - PopupTipPanel.ShowTip("已激活遗物!") - elseif state == 1 then - PopupTipPanel.ShowTip("已取消遗物激活状态!") - elseif state == 2 then - PopupTipPanel.ShowTip("成功解锁遗物并将其激活!") - end + PopupTipPanel.ShowTip("已激活遗物!") + end) + elseif state == 1 then + NetManager.SevenWorldRelicRequest(self.data.Id,function () + Game.GlobalEvent:DispatchEvent(GameEvent.QiJieShiLian.BuySingleTreasure) + self.parent:ClosePanel() + PopupTipPanel.ShowTip("已取消遗物激活状态!") end) end end)