added partial stack posting option
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
AuxVersion = '2.4.9'
|
AuxVersion = '2.4.10'
|
||||||
AuxAuthors = 'shirsig; Zerf; Zirco (Auctionator); Nimeral (Auctionator backport)'
|
AuxAuthors = 'shirsig; Zerf; Zirco (Auctionator); Nimeral (Auctionator backport)'
|
||||||
|
|
||||||
Aux = {
|
Aux = {
|
||||||
|
|||||||
@@ -46,6 +46,8 @@ function public.container_item(bag, slot)
|
|||||||
|
|
||||||
local texture, count, locked, quality, readable, lootable = GetContainerItemInfo(bag, slot) -- quality not working?
|
local texture, count, locked, quality, readable, lootable = GetContainerItemInfo(bag, slot) -- quality not working?
|
||||||
local tooltip = public.tooltip(function(tt) tt:SetBagItem(bag, slot) end)
|
local tooltip = public.tooltip(function(tt) tt:SetBagItem(bag, slot) end)
|
||||||
|
local charges = private.item_charges(tooltip)
|
||||||
|
local aux_quantity = charges or count
|
||||||
|
|
||||||
return {
|
return {
|
||||||
item_id = item_id,
|
item_id = item_id,
|
||||||
@@ -65,6 +67,7 @@ function public.container_item(bag, slot)
|
|||||||
slot = item_info.slot,
|
slot = item_info.slot,
|
||||||
quality = item_info.quality,
|
quality = item_info.quality,
|
||||||
max_stack = item_info.max_stack,
|
max_stack = item_info.max_stack,
|
||||||
|
aux_quantity = aux_quantity,
|
||||||
|
|
||||||
count = count,
|
count = count,
|
||||||
locked = locked,
|
locked = locked,
|
||||||
@@ -72,7 +75,7 @@ function public.container_item(bag, slot)
|
|||||||
lootable = lootable,
|
lootable = lootable,
|
||||||
|
|
||||||
tooltip = tooltip,
|
tooltip = tooltip,
|
||||||
charges = private.item_charges(tooltip),
|
charges = charges,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -11,10 +11,12 @@ end)()
|
|||||||
|
|
||||||
local state
|
local state
|
||||||
|
|
||||||
local post_auction, stop, process
|
function private.process()
|
||||||
|
if state.posted < state.count or state.partial then
|
||||||
|
if state.posted == state.count then
|
||||||
|
state.partial = false
|
||||||
|
end
|
||||||
|
|
||||||
function process()
|
|
||||||
if state.posted < state.count then
|
|
||||||
local stacking_complete
|
local stacking_complete
|
||||||
local stack_slot
|
local stack_slot
|
||||||
|
|
||||||
@@ -28,23 +30,25 @@ function process()
|
|||||||
)
|
)
|
||||||
|
|
||||||
controller().wait(function() return stacking_complete end, function()
|
controller().wait(function() return stacking_complete end, function()
|
||||||
if stack_slot then
|
|
||||||
post_auction(stack_slot, function()
|
if stack_slot and Aux.info.container_item(stack_slot.bag, stack_slot.bag_slot).aux_quantity <= state.stack_size then
|
||||||
state.posted = state.posted + 1
|
private.post_auction(stack_slot, function()
|
||||||
return process()
|
state.posted = state.posted + 1
|
||||||
end)
|
return private.process()
|
||||||
else
|
end)
|
||||||
return stop()
|
else
|
||||||
end
|
return private.stop()
|
||||||
|
end
|
||||||
|
|
||||||
end)
|
end)
|
||||||
else
|
else
|
||||||
return stop()
|
return private.stop()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function public.stop(k)
|
function public.stop(k)
|
||||||
Aux.control.on_next_update(function()
|
Aux.control.on_next_update(function()
|
||||||
stop()
|
private.stop()
|
||||||
|
|
||||||
if k then
|
if k then
|
||||||
return k()
|
return k()
|
||||||
@@ -52,7 +56,7 @@ function public.stop(k)
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function stop()
|
function private.stop()
|
||||||
controller().reset()
|
controller().reset()
|
||||||
if state then
|
if state then
|
||||||
local callback = state.callback
|
local callback = state.callback
|
||||||
@@ -66,36 +70,34 @@ function stop()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function post_auction(slot, k)
|
function private.post_auction(slot, k)
|
||||||
ClearCursor()
|
ClearCursor()
|
||||||
ClickAuctionSellItemButton()
|
ClickAuctionSellItemButton()
|
||||||
ClearCursor()
|
ClearCursor()
|
||||||
PickupContainerItem(slot.bag, slot.bag_slot)
|
PickupContainerItem(slot.bag, slot.bag_slot)
|
||||||
ClickAuctionSellItemButton()
|
ClickAuctionSellItemButton()
|
||||||
ClearCursor()
|
ClearCursor()
|
||||||
StartAuction(state.bid, state.buyout, state.duration)
|
local stack_size = Aux.info.container_item(slot.bag, slot.bag_slot).aux_quantity
|
||||||
|
StartAuction(max(1, state.unit_start_price * stack_size), state.unit_buyout_price * stack_size, state.duration)
|
||||||
controller().wait(function() return not GetContainerItemInfo(slot.bag, slot.bag_slot) end, k)
|
controller().wait(function() return not GetContainerItemInfo(slot.bag, slot.bag_slot) end, k)
|
||||||
end
|
end
|
||||||
|
|
||||||
function public.start(item_key, stack_size, duration, bid, buyout, count, callback)
|
function public.start(item_key, stack_size, duration, unit_start_price, unit_buyout_price, count, allow_partial, callback)
|
||||||
Aux.control.on_next_update(function()
|
Aux.control.on_next_update(function()
|
||||||
stop()
|
private.stop()
|
||||||
|
|
||||||
ClearCursor()
|
|
||||||
ClickAuctionSellItemButton()
|
|
||||||
ClearCursor()
|
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
item_key = item_key,
|
item_key = item_key,
|
||||||
stack_size = stack_size,
|
stack_size = stack_size,
|
||||||
duration = duration,
|
duration = duration,
|
||||||
bid = bid,
|
unit_start_price = unit_start_price,
|
||||||
buyout = buyout,
|
unit_buyout_price = unit_buyout_price,
|
||||||
count = count,
|
count = count,
|
||||||
|
partial = allow_partial,
|
||||||
posted = 0,
|
posted = 0,
|
||||||
callback = callback,
|
callback = callback,
|
||||||
}
|
}
|
||||||
|
|
||||||
return process()
|
return private.process()
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
+102
-56
@@ -18,6 +18,7 @@ function private.load_settings(item_record)
|
|||||||
stack_size = item_record.charges and 5 or item_record.max_stack,
|
stack_size = item_record.charges and 5 or item_record.max_stack,
|
||||||
start_price = 0,
|
start_price = 0,
|
||||||
buyout_price = 0,
|
buyout_price = 0,
|
||||||
|
partial_stacks = true,
|
||||||
hidden = false,
|
hidden = false,
|
||||||
pricing_model = AUTO,
|
pricing_model = AUTO,
|
||||||
}
|
}
|
||||||
@@ -161,7 +162,7 @@ function public.on_load()
|
|||||||
do
|
do
|
||||||
local slider = Aux.gui.slider(AuxSellParameters)
|
local slider = Aux.gui.slider(AuxSellParameters)
|
||||||
slider:SetValueStep(1)
|
slider:SetValueStep(1)
|
||||||
slider:SetPoint('TOPLEFT', 16, -75)
|
slider:SetPoint('TOPLEFT', 16, -74)
|
||||||
slider:SetWidth(190)
|
slider:SetWidth(190)
|
||||||
slider:SetScript('OnValueChanged', function()
|
slider:SetScript('OnValueChanged', function()
|
||||||
private.quantity_update()
|
private.quantity_update()
|
||||||
@@ -231,9 +232,25 @@ function public.on_load()
|
|||||||
slider.label:SetTextHeight(13)
|
slider.label:SetTextHeight(13)
|
||||||
private.stack_count_slider = slider
|
private.stack_count_slider = slider
|
||||||
end
|
end
|
||||||
|
do
|
||||||
|
local checkbox = CreateFrame('CheckButton', nil, AuxSellInventory, 'UICheckButtonTemplate')
|
||||||
|
checkbox:SetWidth(22)
|
||||||
|
checkbox:SetHeight(22)
|
||||||
|
checkbox:SetPoint('TOPLEFT', private.stack_count_slider, 'BOTTOMLEFT', -3, -7)
|
||||||
|
checkbox:SetScript('OnClick', function()
|
||||||
|
local settings = private.load_settings()
|
||||||
|
settings.partial_stacks = this:GetChecked()
|
||||||
|
private.update_recommendation()
|
||||||
|
refresh = true
|
||||||
|
end)
|
||||||
|
local label = Aux.gui.label(checkbox, 13)
|
||||||
|
label:SetPoint('LEFT', checkbox, 'RIGHT', 2, 1)
|
||||||
|
label:SetText('Allow partial stacks')
|
||||||
|
private.partial_stacks_checkbox = checkbox
|
||||||
|
end
|
||||||
do
|
do
|
||||||
local dropdown = Aux.gui.dropdown(AuxSellParameters)
|
local dropdown = Aux.gui.dropdown(AuxSellParameters)
|
||||||
dropdown:SetPoint('TOPLEFT', private.stack_count_slider, 'BOTTOMLEFT', 0, -25)
|
dropdown:SetPoint('TOPLEFT', private.stack_count_slider, 'BOTTOMLEFT', 0, -41)
|
||||||
dropdown:SetWidth(90)
|
dropdown:SetWidth(90)
|
||||||
dropdown:SetHeight(10)
|
dropdown:SetHeight(10)
|
||||||
local label = Aux.gui.label(dropdown, 13)
|
local label = Aux.gui.label(dropdown, 13)
|
||||||
@@ -284,7 +301,6 @@ function public.on_load()
|
|||||||
settings.start_price = Aux.money.from_string(this:GetText())
|
settings.start_price = Aux.money.from_string(this:GetText())
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
private.validate_parameters()
|
|
||||||
end)
|
end)
|
||||||
editbox:SetScript('OnTabPressed', function()
|
editbox:SetScript('OnTabPressed', function()
|
||||||
if IsShiftKeyDown() then
|
if IsShiftKeyDown() then
|
||||||
@@ -321,7 +337,6 @@ function public.on_load()
|
|||||||
settings.buyout_price = Aux.money.from_string(this:GetText())
|
settings.buyout_price = Aux.money.from_string(this:GetText())
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
private.validate_parameters()
|
|
||||||
end)
|
end)
|
||||||
editbox:SetScript('OnTabPressed', function()
|
editbox:SetScript('OnTabPressed', function()
|
||||||
if IsShiftKeyDown() then
|
if IsShiftKeyDown() then
|
||||||
@@ -369,8 +384,6 @@ function public.on_open()
|
|||||||
private.start_price:SetText(Aux.money.to_string(0))
|
private.start_price:SetText(Aux.money.to_string(0))
|
||||||
private.buyout_price:SetText(Aux.money.to_string(0))
|
private.buyout_price:SetText(Aux.money.to_string(0))
|
||||||
|
|
||||||
private.validate_parameters()
|
|
||||||
|
|
||||||
private.update_inventory_records()
|
private.update_inventory_records()
|
||||||
|
|
||||||
refresh = true
|
refresh = true
|
||||||
@@ -383,43 +396,46 @@ function public.on_close()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function private.post_auctions()
|
function private.post_auctions()
|
||||||
local auction = selected_item
|
if selected_item then
|
||||||
if auction then
|
local unit_start_price = Aux.money.from_string(private.start_price:GetText()) / private.stack_size_slider:GetValue()
|
||||||
local key, hyperlink, stack_size, buyout_price, stack_count = auction.key, auction.hyperlink, private.stack_size_slider:GetValue(), Aux.money.from_string(private.buyout_price:GetText()), private.stack_count_slider:GetValue()
|
local unit_buyout_price = Aux.money.from_string(private.buyout_price:GetText()) / private.stack_size_slider:GetValue()
|
||||||
local duration
|
local stack_size = private.stack_size_slider:GetValue()
|
||||||
if UIDropDownMenu_GetSelectedValue(private.duration_dropdown) == DURATION_4 then
|
local stack_count = private.stack_count_slider:GetValue()
|
||||||
duration = 2
|
local duration = UIDropDownMenu_GetSelectedValue(private.duration_dropdown)
|
||||||
elseif UIDropDownMenu_GetSelectedValue(private.duration_dropdown) == DURATION_8 then
|
local key = selected_item.key
|
||||||
duration = 3
|
|
||||||
elseif UIDropDownMenu_GetSelectedValue(private.duration_dropdown) == DURATION_24 then
|
local duration_code
|
||||||
duration = 4
|
if duration == DURATION_4 then
|
||||||
|
duration_code = 2
|
||||||
|
elseif duration == DURATION_8 then
|
||||||
|
duration_code = 3
|
||||||
|
elseif duration == DURATION_24 then
|
||||||
|
duration_code = 4
|
||||||
end
|
end
|
||||||
|
|
||||||
Aux.post.start(
|
Aux.post.start(
|
||||||
key,
|
key,
|
||||||
stack_size,
|
stack_size,
|
||||||
UIDropDownMenu_GetSelectedValue(private.duration_dropdown),
|
duration,
|
||||||
Aux.money.from_string(private.start_price:GetText()),
|
unit_start_price,
|
||||||
buyout_price,
|
unit_buyout_price,
|
||||||
stack_count,
|
stack_count,
|
||||||
function(posted)
|
not selected_item.charges and private.partial_stacks_checkbox:GetChecked(),
|
||||||
|
function(posted, partial)
|
||||||
|
local new_auction_record
|
||||||
for i = 1, posted do
|
for i = 1, posted do
|
||||||
private.record_auction(key, stack_size, buyout_price, duration, UnitName('player'))
|
new_auction_record = private.record_auction(key, stack_size, unit_buyout_price, duration_code, UnitName('player'))
|
||||||
end
|
end
|
||||||
if existing_auctions[key] then
|
if partial then
|
||||||
for _, entry in ipairs(existing_auctions[key]) do
|
new_auction_record = private.record_auction(key, partial, unit_buyout_price, duration_code, UnitName('player'))
|
||||||
if entry.buyout_price == buyout_price and entry.stack_size == stack_size then
|
end
|
||||||
existing_auctions[key].selected = entry
|
if existing_auctions[key] then
|
||||||
refresh = true
|
existing_auctions[key].selected = new_auction_record
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
private.update_inventory_records()
|
private.update_inventory_records()
|
||||||
|
|
||||||
selected_item = nil
|
selected_item = nil
|
||||||
for _, record in ipairs(inventory_records) do
|
for _, record in ipairs(inventory_records) do
|
||||||
if record.key == auction.key then
|
if record.key == key then
|
||||||
private.set_item(record)
|
private.set_item(record)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -454,17 +470,24 @@ function private.select_auction()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function private.validate_parameters()
|
function private.validate_parameters()
|
||||||
private.post_button:Disable()
|
|
||||||
|
|
||||||
if not selected_item then
|
if not selected_item then
|
||||||
|
private.post_button:Disable()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if Aux.money.from_string(private.buyout_price:GetText()) > 0 and Aux.money.from_string(private.start_price:GetText()) > Aux.money.from_string(private.buyout_price:GetText()) then
|
if Aux.money.from_string(private.buyout_price:GetText()) > 0 and Aux.money.from_string(private.start_price:GetText()) > Aux.money.from_string(private.buyout_price:GetText()) then
|
||||||
|
private.post_button:Disable()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if Aux.money.from_string(private.start_price:GetText()) < 1 then
|
if Aux.money.from_string(private.start_price:GetText()) < 1 then
|
||||||
|
private.post_button:Disable()
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
if private.stack_count_slider:GetValue() == 0 and (selected_item.charges or not private.partial_stacks_checkbox:GetChecked()) then
|
||||||
|
private.post_button:Disable()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -485,6 +508,7 @@ function private.update_recommendation()
|
|||||||
private.buyout_price:Hide()
|
private.buyout_price:Hide()
|
||||||
private.stack_size_slider:Hide()
|
private.stack_size_slider:Hide()
|
||||||
private.stack_count_slider:Hide()
|
private.stack_count_slider:Hide()
|
||||||
|
private.partial_stacks_checkbox:Hide()
|
||||||
private.deposit:Hide()
|
private.deposit:Hide()
|
||||||
private.duration_dropdown:Hide()
|
private.duration_dropdown:Hide()
|
||||||
private.pricing_model_dropdown:Hide()
|
private.pricing_model_dropdown:Hide()
|
||||||
@@ -494,6 +518,7 @@ function private.update_recommendation()
|
|||||||
private.buyout_price:Show()
|
private.buyout_price:Show()
|
||||||
private.stack_size_slider:Show()
|
private.stack_size_slider:Show()
|
||||||
private.stack_count_slider:Show()
|
private.stack_count_slider:Show()
|
||||||
|
private.partial_stacks_checkbox:Show()
|
||||||
private.deposit:Show()
|
private.deposit:Show()
|
||||||
private.duration_dropdown:Show()
|
private.duration_dropdown:Show()
|
||||||
private.pricing_model_dropdown:Show()
|
private.pricing_model_dropdown:Show()
|
||||||
@@ -512,8 +537,18 @@ function private.update_recommendation()
|
|||||||
private.stack_size_slider.editbox:SetNumber(private.stack_size_slider:GetValue())
|
private.stack_size_slider.editbox:SetNumber(private.stack_size_slider:GetValue())
|
||||||
private.stack_count_slider.editbox:SetNumber(private.stack_count_slider:GetValue())
|
private.stack_count_slider.editbox:SetNumber(private.stack_count_slider:GetValue())
|
||||||
|
|
||||||
-- TODO neutral AH deposit formula
|
do
|
||||||
private.deposit:SetText('Deposit: '..Aux.money.to_string(floor(selected_item.unit_vendor_price * 0.05 * (selected_item.charges and 1 or private.stack_size_slider:GetValue())) * private.stack_count_slider:GetValue() * UIDropDownMenu_GetSelectedValue(private.duration_dropdown) / 120))
|
-- TODO neutral AH deposit formula
|
||||||
|
local stack_size = private.stack_size_slider:GetValue()
|
||||||
|
local stack_count = private.stack_count_slider:GetValue()
|
||||||
|
local deposit = floor(selected_item.unit_vendor_price * 0.05 * (selected_item.charges and 1 or stack_size)) * stack_count * UIDropDownMenu_GetSelectedValue(private.duration_dropdown) / 120
|
||||||
|
if selected_item.aux_quantity < (stack_size * (stack_count + 1)) and private.partial_stacks_checkbox:GetChecked() and not selected_item.charges then
|
||||||
|
local partial_stack = mod(selected_item.aux_quantity, stack_size)
|
||||||
|
deposit = deposit + floor(selected_item.unit_vendor_price * 0.05 * partial_stack) * UIDropDownMenu_GetSelectedValue(private.duration_dropdown) / 120
|
||||||
|
end
|
||||||
|
|
||||||
|
private.deposit:SetText('Deposit: '..Aux.money.to_string(deposit))
|
||||||
|
end
|
||||||
|
|
||||||
private.refresh_button:Enable()
|
private.refresh_button:Enable()
|
||||||
|
|
||||||
@@ -627,9 +662,10 @@ function private.set_item(item)
|
|||||||
UIDropDownMenu_Initialize(private.pricing_model_dropdown, private.initialize_pricing_model_dropdown)
|
UIDropDownMenu_Initialize(private.pricing_model_dropdown, private.initialize_pricing_model_dropdown)
|
||||||
UIDropDownMenu_SetSelectedValue(private.pricing_model_dropdown, settings.pricing_model)
|
UIDropDownMenu_SetSelectedValue(private.pricing_model_dropdown, settings.pricing_model)
|
||||||
|
|
||||||
private.stack_size_slider:SetMinMaxValues(1, selected_item.charges and 5 or selected_item.max_stack)
|
|
||||||
private.hide_checkbox:SetChecked(settings.hidden)
|
private.hide_checkbox:SetChecked(settings.hidden)
|
||||||
|
private.partial_stacks_checkbox:SetChecked(settings.partial_stacks)
|
||||||
|
|
||||||
|
private.stack_size_slider:SetMinMaxValues(1, selected_item.charges and 5 or selected_item.max_stack)
|
||||||
private.stack_size_slider:SetValue(settings.stack_size)
|
private.stack_size_slider:SetValue(settings.stack_size)
|
||||||
private.quantity_update()
|
private.quantity_update()
|
||||||
private.stack_count_slider:SetValue(selected_item.aux_quantity) -- reduced to max possible
|
private.stack_count_slider:SetValue(selected_item.aux_quantity) -- reduced to max possible
|
||||||
@@ -726,7 +762,13 @@ function private.refresh_entries()
|
|||||||
end,
|
end,
|
||||||
on_read_auction = function(auction_info)
|
on_read_auction = function(auction_info)
|
||||||
if auction_info.item_key == item_key then
|
if auction_info.item_key == item_key then
|
||||||
private.record_auction(auction_info.item_key, auction_info.aux_quantity, auction_info.buyout_price, auction_info.duration, auction_info.owner)
|
private.record_auction(
|
||||||
|
auction_info.item_key,
|
||||||
|
auction_info.aux_quantity,
|
||||||
|
auction_info.buyout_price / auction_info.aux_quantity,
|
||||||
|
auction_info.duration,
|
||||||
|
auction_info.owner
|
||||||
|
)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
on_abort = function()
|
on_abort = function()
|
||||||
@@ -762,31 +804,33 @@ function private.refresh()
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function private.record_auction(key, aux_quantity, buyout_price, duration, owner)
|
function private.record_auction(key, aux_quantity, unit_buyout_price, duration, owner)
|
||||||
if buyout_price > 0 then
|
if unit_buyout_price > 0 then
|
||||||
existing_auctions[key] = existing_auctions[key] or {}
|
existing_auctions[key] = existing_auctions[key] or {}
|
||||||
local entry
|
local entry
|
||||||
for _, existing_entry in ipairs(existing_auctions[key]) do
|
for _, existing_entry in ipairs(existing_auctions[key]) do
|
||||||
if buyout_price == existing_entry.buyout_price and aux_quantity == existing_entry.stack_size and duration == existing_entry.duration then
|
if unit_buyout_price == existing_entry.unit_buyout_price and aux_quantity == existing_entry.stack_size and duration == existing_entry.duration then
|
||||||
entry = existing_entry
|
entry = existing_entry
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if entry then
|
|
||||||
entry.count = entry.count + 1
|
if not entry then
|
||||||
entry.yours = entry.yours + (owner == UnitName('player') and 1 or 0)
|
entry = {
|
||||||
entry.duration = max(entry.duration, duration)
|
|
||||||
else
|
|
||||||
tinsert(existing_auctions[key], {
|
|
||||||
item_key = key,
|
item_key = key,
|
||||||
stack_size = aux_quantity,
|
stack_size = aux_quantity,
|
||||||
buyout_price = buyout_price,
|
unit_buyout_price = unit_buyout_price,
|
||||||
duration = duration,
|
duration = duration,
|
||||||
unit_buyout_price = buyout_price / aux_quantity,
|
count = 0,
|
||||||
duration = duration,
|
yours = 0,
|
||||||
count = 1,
|
}
|
||||||
yours = owner == UnitName('player') and 1 or 0,
|
tinsert(existing_auctions[key], entry)
|
||||||
})
|
end
|
||||||
end
|
|
||||||
|
entry.count = entry.count + 1
|
||||||
|
entry.yours = entry.yours + (owner == UnitName('player') and 1 or 0)
|
||||||
|
entry.duration = max(entry.duration, duration)
|
||||||
|
|
||||||
|
return entry
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -800,6 +844,8 @@ function public.on_update()
|
|||||||
private.update_inventory_listing()
|
private.update_inventory_listing()
|
||||||
private.update_auction_listing()
|
private.update_auction_listing()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private.validate_parameters()
|
||||||
end
|
end
|
||||||
|
|
||||||
function private.initialize_pricing_model_dropdown()
|
function private.initialize_pricing_model_dropdown()
|
||||||
|
|||||||
+2
-2
@@ -31,7 +31,7 @@
|
|||||||
</Anchors>
|
</Anchors>
|
||||||
</Frame>
|
</Frame>
|
||||||
<frame name="AuxSellParameters" inherits="AuxFrameBoxTemplate">
|
<frame name="AuxSellParameters" inherits="AuxFrameBoxTemplate">
|
||||||
<Size><AbsDimension y="187"/></Size>
|
<Size><AbsDimension y="197"/></Size>
|
||||||
<Anchors>
|
<Anchors>
|
||||||
<Anchor point="TOPLEFT" relativePoint="TOPRIGHT" relativeTo="AuxSellInventory"><Offset><AbsDimension x="8" y="0"/></Offset></Anchor>
|
<Anchor point="TOPLEFT" relativePoint="TOPRIGHT" relativeTo="AuxSellInventory"><Offset><AbsDimension x="8" y="0"/></Offset></Anchor>
|
||||||
<Anchor point="TOPRIGHT"><Offset><AbsDimension x="-4" y="0"/></Offset></Anchor>
|
<Anchor point="TOPRIGHT"><Offset><AbsDimension x="-4" y="0"/></Offset></Anchor>
|
||||||
@@ -43,7 +43,7 @@
|
|||||||
</frames>
|
</frames>
|
||||||
</frame>
|
</frame>
|
||||||
<Frame name="AuxSellAuctions" inherits="AuxFrameBoxTemplate">
|
<Frame name="AuxSellAuctions" inherits="AuxFrameBoxTemplate">
|
||||||
<Size><AbsDimension y="207"/></Size>
|
<Size><AbsDimension y="197"/></Size>
|
||||||
<Anchors>
|
<Anchors>
|
||||||
<Anchor point="BOTTOMLEFT" relativePoint="BOTTOMRIGHT" relativeTo="AuxSellInventory"><Offset><AbsDimension x="8" y="0"/></Offset></Anchor>
|
<Anchor point="BOTTOMLEFT" relativePoint="BOTTOMRIGHT" relativeTo="AuxSellInventory"><Offset><AbsDimension x="8" y="0"/></Offset></Anchor>
|
||||||
<Anchor point="BOTTOMRIGHT"><Offset><AbsDimension x="-4" y="0"/></Offset></Anchor>
|
<Anchor point="BOTTOMRIGHT"><Offset><AbsDimension x="-4" y="0"/></Offset></Anchor>
|
||||||
|
|||||||
@@ -41,8 +41,8 @@ end
|
|||||||
function private.move_item(from_slot, to_slot, amount, k)
|
function private.move_item(from_slot, to_slot, amount, k)
|
||||||
local size_before = private.stack_size(to_slot)
|
local size_before = private.stack_size(to_slot)
|
||||||
|
|
||||||
amount = min(private.max_stack(from_slot) - private.stack_size(to_slot), amount)
|
amount = min(private.max_stack(from_slot) - private.stack_size(to_slot), private.stack_size(from_slot), amount)
|
||||||
|
|
||||||
ClearCursor()
|
ClearCursor()
|
||||||
SplitContainerItem(from_slot.bag, from_slot.bag_slot, amount)
|
SplitContainerItem(from_slot.bag, from_slot.bag_slot, amount)
|
||||||
PickupContainerItem(to_slot.bag, to_slot.bag_slot)
|
PickupContainerItem(to_slot.bag, to_slot.bag_slot)
|
||||||
@@ -99,7 +99,8 @@ function private.process()
|
|||||||
state.target_size - private.stack_size(state.target_slot),
|
state.target_size - private.stack_size(state.target_slot),
|
||||||
function()
|
function()
|
||||||
return private.process()
|
return private.process()
|
||||||
end)
|
end
|
||||||
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -124,11 +125,8 @@ end
|
|||||||
function private.stop()
|
function private.stop()
|
||||||
controller().reset()
|
controller().reset()
|
||||||
if state then
|
if state then
|
||||||
local slot
|
|
||||||
if state.target_slot and (private.stack_size(state.target_slot) == state.target_size or private.item_charges(state.target_slot) == state.target_size) then
|
local callback, slot = state.callback, state.target_slot
|
||||||
slot = state.target_slot
|
|
||||||
end
|
|
||||||
local callback = state.callback
|
|
||||||
|
|
||||||
state = nil
|
state = nil
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user