Fixed market selling 'amounts'
This commit is contained in:
		
							parent
							
								
									cb42481edd
								
							
						
					
					
						commit
						0b29a4b466
					
				| 
						 | 
					@ -412,7 +412,7 @@ local function openAmountWindow(callback, type, actionText)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  local max = selectedOffer[type]:getAmount(item:getId())
 | 
					  local max = selectedOffer[type]:getAmount(item:getId())
 | 
				
			||||||
  if type == MarketAction.Sell then
 | 
					  if type == MarketAction.Sell then
 | 
				
			||||||
    local depot = Market.depotContains()
 | 
					    local depot = Market.depotContains(item:getId())
 | 
				
			||||||
    if max > depot then
 | 
					    if max > depot then
 | 
				
			||||||
      max = depot
 | 
					      max = depot
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
| 
						 | 
					@ -807,8 +807,10 @@ function Market.enableCreateOffer(enable)
 | 
				
			||||||
  amountEdit:setEnabled(enable)
 | 
					  amountEdit:setEnabled(enable)
 | 
				
			||||||
  anonymous:setEnabled(enable)
 | 
					  anonymous:setEnabled(enable)
 | 
				
			||||||
  createOfferButton:setEnabled(enable)
 | 
					  createOfferButton:setEnabled(enable)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  local prevAmountButton = marketOffersPanel:recursiveGetChildById('prevAmountButton')
 | 
					  local prevAmountButton = marketOffersPanel:recursiveGetChildById('prevAmountButton')
 | 
				
			||||||
  local nextAmountButton = marketOffersPanel:recursiveGetChildById('nextAmountButton')
 | 
					  local nextAmountButton = marketOffersPanel:recursiveGetChildById('nextAmountButton')
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
  prevAmountButton:setEnabled(enable)
 | 
					  prevAmountButton:setEnabled(enable)
 | 
				
			||||||
  nextAmountButton:setEnabled(enable)
 | 
					  nextAmountButton:setEnabled(enable)
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
| 
						 | 
					@ -851,6 +853,7 @@ end
 | 
				
			||||||
function Market.refreshItemsWidget(selectItem)
 | 
					function Market.refreshItemsWidget(selectItem)
 | 
				
			||||||
  local selectItem = selectItem or 0
 | 
					  local selectItem = selectItem or 0
 | 
				
			||||||
  itemsPanel = browsePanel:recursiveGetChildById('itemsPanel')
 | 
					  itemsPanel = browsePanel:recursiveGetChildById('itemsPanel')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  local layout = itemsPanel:getLayout()
 | 
					  local layout = itemsPanel:getLayout()
 | 
				
			||||||
  layout:disableUpdates()
 | 
					  layout:disableUpdates()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1005,6 +1008,7 @@ function Market.createNewOffer()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  local piecePrice = piecePriceEdit:getValue()
 | 
					  local piecePrice = piecePriceEdit:getValue()
 | 
				
			||||||
  local totalPrice = totalPriceEdit:getValue()
 | 
					  local totalPrice = totalPriceEdit:getValue()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  local amount = amountEdit:getValue()
 | 
					  local amount = amountEdit:getValue()
 | 
				
			||||||
  local anonymous = anonymous:isChecked() and 1 or 0
 | 
					  local anonymous = anonymous:isChecked() and 1 or 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue