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 end
function Aux.info.auction_sell_item() function Aux.info.auction_sell_item()
local name, texture, count, quality, usable, vendor_price, vendor_price_per_unit, max_stack, total_count = GetAuctionSellItemInfo() local name, texture, stack_size, quality, usable, vendor_price, vendor_price_per_unit, max_stack, total_count = GetAuctionSellItemInfo()
auction_sell_item = { local base_deposit = CalculateAuctionDeposit(120) / stack_size
auction_sell_item = name and {
name = name, name = name,
texture = texture, texture = texture,
count = count, stack_size = stack_size,
quality = quality, quality = quality,
usable = usable, usable = usable,
vendor_price = vendor_price, vendor_price = vendor_price,
vendor_price_per_unit = vendor_price_per_unit, vendor_price_per_unit = vendor_price_per_unit,
max_stack = max_stack, max_stack = max_stack,
total_count = total_count, total_count = total_count,
base_deposit = base_deposit,
} }
auction_sell_item.tooltip = Aux.info.tooltip(function(tt) tt:SetAuctionSellItem() end) 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' AUX_AUCTION_DURATION = 'long'
end end
return Aux.orig.AuctionsRadioButton_OnClick(index) Aux.orig.AuctionsRadioButton_OnClick(index)
update_recommendation()
end end
----------------------------------------- -----------------------------------------
@@ -177,6 +178,8 @@ function update_recommendation()
Aux_Sell_SetStackSize(current_auction.stackSize) Aux_Sell_SetStackSize(current_auction.stackSize)
Aux_Sell_SetStackCount(current_auction.stackCount) 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 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 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 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) local container_item = Aux.info.container_item(bag, slot)
if container_item then if container_item then
Aux.scan.abort()
ClearCursor() ClearCursor()
PickupContainerItem(bag,slot) PickupContainerItem(bag,slot)
@@ -291,21 +292,28 @@ function Aux.sell.set_auction(bag, slot)
ClickAuctionSellItemButton() ClickAuctionSellItemButton()
ClearCursor() ClearCursor()
current_auction = container_item and { if auction_sell_item then
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 current_auction and not auxSellEntries[current_auction.name] then Aux.scan.abort()
refresh_entries()
end 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() if current_auction and not auxSellEntries[current_auction.name] then
update_recommendation() refresh_entries()
end
select_entry()
update_recommendation()
end
end end
end end