From c03e46432fde1a77c8f5ac983a7baef95670b531 Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Tue, 19 Sep 2023 11:20:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/ui/common/common_exchange_ui.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lua/app/ui/common/common_exchange_ui.lua b/lua/app/ui/common/common_exchange_ui.lua index 2db735ce..e9ec3202 100644 --- a/lua/app/ui/common/common_exchange_ui.lua +++ b/lua/app/ui/common/common_exchange_ui.lua @@ -19,9 +19,9 @@ function CommonExchangeUI:ctor(params) local num = DataManager.BagData.ItemData:getItemNumById(costId) local maxBuyCount = num // costNum self.remainNum = math.min(self.remainNum, maxBuyCount) - if self.remainNum <= 0 then - self.remainNum = 1 - end + -- if self.remainNum <= 0 then + -- self.remainNum = 1 + -- end end function CommonExchangeUI:getPrefabPath() @@ -75,6 +75,10 @@ end function CommonExchangeUI:_addListeners() local uiMap = self.root:genAllChildren() uiMap["exchange_ui.bg.ok_btn"]:addClickListener(function() + if self.defaultNum <= 0 then + return + end + if self.callback then self.callback(self.defaultNum) end