This commit is contained in:
xiekaidong 2023-09-19 11:20:48 +08:00
parent 630326bda3
commit c03e46432f

View File

@ -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