deposit calculation as total for all stacks implemented

This commit is contained in:
Manuel Simon Hirsig
2015-10-05 23:56:53 +02:00
parent 660762f5a6
commit 30448813df
2 changed files with 29 additions and 19 deletions
+5 -3
View File
@@ -26,17 +26,19 @@ function Aux.info.container_item(bag, slot)
end
function Aux.info.auction_sell_item()
local name, texture, count, quality, usable, vendor_price, vendor_price_per_unit, max_stack, total_count = GetAuctionSellItemInfo()
auction_sell_item = {
local name, texture, stack_size, quality, usable, vendor_price, vendor_price_per_unit, max_stack, total_count = GetAuctionSellItemInfo()
local base_deposit = CalculateAuctionDeposit(120) / stack_size
auction_sell_item = name and {
name = name,
texture = texture,
count = count,
stack_size = stack_size,
quality = quality,
usable = usable,
vendor_price = vendor_price,
vendor_price_per_unit = vendor_price_per_unit,
max_stack = max_stack,
total_count = total_count,
base_deposit = base_deposit,
}
auction_sell_item.tooltip = Aux.info.tooltip(function(tt) tt:SetAuctionSellItem() end)
+24 -16
View File
@@ -47,7 +47,8 @@ function Aux_Sell_AuctionsRadioButton_OnClick(index)
AUX_AUCTION_DURATION = 'long'
end
return Aux.orig.AuctionsRadioButton_OnClick(index)
Aux.orig.AuctionsRadioButton_OnClick(index)
update_recommendation()
end
-----------------------------------------
@@ -177,6 +178,8 @@ function update_recommendation()
Aux_Sell_SetStackSize(current_auction.stackSize)
Aux_Sell_SetStackCount(current_auction.stackCount)
MoneyFrame_Update("AuctionsDepositMoneyFrame", current_auction.base_deposit * current_auction.stackCount * (current_auction.has_charges and 1 or current_auction.stackSize) * AuctionFrameAuctions.duration / 120)
if auxSellEntries[current_auction.name] and auxSellEntries[current_auction.name].selected then
if not auxSellEntries[current_auction.name].created or GetTime() - auxSellEntries[current_auction.name].created > 1800 then
AuxRecommendStaleText:SetText("STALE DATA") -- data older than half an hour marked as stale
@@ -281,8 +284,6 @@ function Aux.sell.set_auction(bag, slot)
local container_item = Aux.info.container_item(bag, slot)
if container_item then
Aux.scan.abort()
ClearCursor()
PickupContainerItem(bag,slot)
@@ -291,21 +292,28 @@ function Aux.sell.set_auction(bag, slot)
ClickAuctionSellItemButton()
ClearCursor()
current_auction = container_item and {
name = container_item.name,
texture = container_item.texture,
stackSize = container_item.charges or container_item.count,
stackCount = 1,
class = container_item.type,
subclass = container_item.subtype,
}
if auction_sell_item then
if current_auction and not auxSellEntries[current_auction.name] then
refresh_entries()
end
Aux.scan.abort()
current_auction = {
name = container_item.name,
texture = container_item.texture,
stackSize = container_item.charges or container_item.count,
stackCount = 1,
class = container_item.type,
subclass = container_item.subtype,
base_deposit = auction_sell_item.base_deposit,
has_charges = container_item.charges ~= nil,
}
select_entry()
update_recommendation()
if current_auction and not auxSellEntries[current_auction.name] then
refresh_entries()
end
select_entry()
update_recommendation()
end
end
end