post simplifications
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
## Interface: 11200
|
## Interface: 11200
|
||||||
## Title: Aux
|
## Title: Aux
|
||||||
## SavedVariablesPerCharacter: aux_ignore_owner, aux_recent_searches, aux_favorite_searches, aux_post_mode, aux_price_per_unit, aux_tooltip_daily, aux_tooltip_vendor_buy, aux_tooltip_vendor_sell, aux_tooltip_disenchant_value, aux_tooltip_disenchant_distribution, aux_tooltip_disenchant_source
|
## SavedVariablesPerCharacter: aux_ignore_owner, aux_recent_searches, aux_favorite_searches, aux_price_per_unit, aux_tooltip_daily, aux_tooltip_vendor_buy, aux_tooltip_vendor_sell, aux_tooltip_disenchant_value, aux_tooltip_disenchant_distribution, aux_tooltip_disenchant_source
|
||||||
## SavedVariables: aux_datasets, aux_items, aux_item_ids, aux_auctionable_items, aux_merchant_buy, aux_merchant_sell
|
## SavedVariables: aux_datasets, aux_items, aux_item_ids, aux_auctionable_items, aux_merchant_buy, aux_merchant_sell
|
||||||
|
|
||||||
slash.lua
|
slash.lua
|
||||||
|
|||||||
@@ -4,10 +4,7 @@ Aux.post = public
|
|||||||
local state
|
local state
|
||||||
|
|
||||||
function private.process()
|
function private.process()
|
||||||
if state.posted < state.count or state.allow_partial then
|
if state.posted < state.count then
|
||||||
if state.posted == state.count then
|
|
||||||
state.allow_partial = false
|
|
||||||
end
|
|
||||||
|
|
||||||
local stacking_complete, target_slot
|
local stacking_complete, target_slot
|
||||||
|
|
||||||
@@ -22,7 +19,7 @@ function private.process()
|
|||||||
|
|
||||||
return Aux.control.wait_until(function() return stacking_complete end, function()
|
return Aux.control.wait_until(function() return stacking_complete end, function()
|
||||||
if target_slot then
|
if target_slot then
|
||||||
return private.post_auction(target_slot, state.posted == state.count, private.process)
|
return private.post_auction(target_slot, private.process)
|
||||||
else
|
else
|
||||||
return public.stop()
|
return public.stop()
|
||||||
end
|
end
|
||||||
@@ -32,9 +29,9 @@ function private.process()
|
|||||||
return public.stop()
|
return public.stop()
|
||||||
end
|
end
|
||||||
|
|
||||||
function private.post_auction(slot, partial, k)
|
function private.post_auction(slot, k)
|
||||||
local item_info = Aux.info.container_item(unpack(slot))
|
local item_info = Aux.info.container_item(unpack(slot))
|
||||||
if item_info.item_key == state.item_key and Aux.info.auctionable(item_info.tooltip) and (item_info.aux_quantity == state.stack_size or partial and item_info.aux_quantity < state.stack_size) then
|
if item_info.item_key == state.item_key and Aux.info.auctionable(item_info.tooltip) and item_info.aux_quantity == state.stack_size then
|
||||||
|
|
||||||
ClearCursor()
|
ClearCursor()
|
||||||
ClickAuctionSellItemButton()
|
ClickAuctionSellItemButton()
|
||||||
@@ -45,9 +42,6 @@ function private.post_auction(slot, partial, k)
|
|||||||
|
|
||||||
StartAuction(max(1, Aux.round(state.unit_start_price * item_info.aux_quantity)), Aux.round(state.unit_buyout_price * item_info.aux_quantity), state.duration)
|
StartAuction(max(1, Aux.round(state.unit_start_price * item_info.aux_quantity)), Aux.round(state.unit_buyout_price * item_info.aux_quantity), state.duration)
|
||||||
Aux.control.wait_until(function() return not GetContainerItemInfo(unpack(slot)) end, function()
|
Aux.control.wait_until(function() return not GetContainerItemInfo(unpack(slot)) end, function()
|
||||||
if state.posted == state.count then
|
|
||||||
state.partial_stack = item_info.aux_quantity
|
|
||||||
end
|
|
||||||
state.posted = state.posted + 1
|
state.posted = state.posted + 1
|
||||||
return k()
|
return k()
|
||||||
end)
|
end)
|
||||||
@@ -63,17 +57,16 @@ function public.stop()
|
|||||||
|
|
||||||
local callback = state.callback
|
local callback = state.callback
|
||||||
local posted = state.posted
|
local posted = state.posted
|
||||||
local partial_stack = state.partial_stack
|
|
||||||
|
|
||||||
state = nil
|
state = nil
|
||||||
|
|
||||||
if callback then
|
if callback then
|
||||||
callback(posted, partial_stack)
|
callback(posted)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function public.start(item_key, stack_size, duration, unit_start_price, unit_buyout_price, count, allow_partial, callback)
|
function public.start(item_key, stack_size, duration, unit_start_price, unit_buyout_price, count, callback)
|
||||||
public.stop()
|
public.stop()
|
||||||
|
|
||||||
local thread_id = Aux.control.new_thread(private.process)
|
local thread_id = Aux.control.new_thread(private.process)
|
||||||
@@ -86,7 +79,6 @@ function public.start(item_key, stack_size, duration, unit_start_price, unit_buy
|
|||||||
unit_start_price = unit_start_price,
|
unit_start_price = unit_start_price,
|
||||||
unit_buyout_price = unit_buyout_price,
|
unit_buyout_price = unit_buyout_price,
|
||||||
count = count,
|
count = count,
|
||||||
allow_partial = allow_partial,
|
|
||||||
posted = 0,
|
posted = 0,
|
||||||
callback = callback,
|
callback = callback,
|
||||||
}
|
}
|
||||||
|
|||||||
+32
-149
@@ -7,12 +7,9 @@ local inventory_records
|
|||||||
local selected_item
|
local selected_item
|
||||||
local scan_id
|
local scan_id
|
||||||
|
|
||||||
local settings_schema = {'record', '#', {stack_size='number'}, {duration='number'}, {start_price='number'}, {buyout_price='number'}, {post_all='boolean'}, {hidden='boolean'}}
|
local settings_schema = {'record', '#', {stack_size='number'}, {duration='number'}, {start_price='number'}, {buyout_price='number'}, {hidden='boolean'}}
|
||||||
|
|
||||||
local DURATION_4, DURATION_8, DURATION_24 = 120, 480, 1440
|
local DURATION_4, DURATION_8, DURATION_24 = 120, 480, 1440
|
||||||
local BUYOUT_MODE, BID_MODE, FULL_MODE = 1, 2, 3
|
|
||||||
|
|
||||||
aux_post_mode = FULL_MODE
|
|
||||||
|
|
||||||
function private.default_settings()
|
function private.default_settings()
|
||||||
return {
|
return {
|
||||||
@@ -20,7 +17,6 @@ function private.default_settings()
|
|||||||
stack_size = 1,
|
stack_size = 1,
|
||||||
start_price = 0,
|
start_price = 0,
|
||||||
buyout_price = 0,
|
buyout_price = 0,
|
||||||
post_all = true,
|
|
||||||
hidden = false,
|
hidden = false,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
@@ -49,31 +45,21 @@ function private.write_settings(settings, item_key)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function private.get_unit_start_price()
|
function private.get_unit_start_price()
|
||||||
if aux_post_mode == BUYOUT_MODE then
|
local money_text = private.unit_start_price:GetText()
|
||||||
return Aux.money.from_string(private.unit_buyout_price:GetText()) or 0
|
return Aux.money.from_string(money_text) or (tonumber(money_text) and tonumber(money_text) * 10000) or 0
|
||||||
else
|
|
||||||
return Aux.money.from_string(private.unit_start_price:GetText()) or 0
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function private.set_unit_start_price(amount)
|
function private.set_unit_start_price(amount)
|
||||||
if aux_post_mode ~= BUYOUT_MODE then
|
private.unit_start_price:SetText(Aux.money.to_string(amount, true, nil, 3))
|
||||||
private.unit_start_price:SetText(Aux.money.to_string(amount, true, nil, 3))
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function private.get_unit_buyout_price()
|
function private.get_unit_buyout_price()
|
||||||
if aux_post_mode == BUYOUT_MODE or aux_post_mode == FULL_MODE then
|
local money_text = private.unit_buyout_price:GetText()
|
||||||
return Aux.money.from_string(private.unit_buyout_price:GetText()) or 0
|
return Aux.money.from_string(money_text) or (tonumber(money_text) and tonumber(money_text) * 10000) or 0
|
||||||
else
|
|
||||||
return 0
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function private.set_unit_buyout_price(amount)
|
function private.set_unit_buyout_price(amount)
|
||||||
if aux_post_mode ~= BID_MODE then
|
private.unit_buyout_price:SetText(Aux.money.to_string(amount, true, nil, 3))
|
||||||
private.unit_buyout_price:SetText(Aux.money.to_string(amount, true, nil, 3))
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function private.update_inventory_listing()
|
function private.update_inventory_listing()
|
||||||
@@ -252,7 +238,7 @@ function public.on_load()
|
|||||||
private.status_bar = status_bar
|
private.status_bar = status_bar
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn = Aux.gui.button(AuxSellParameters, 16, '$parentPostButton')
|
local btn = Aux.gui.button(AuxSellParameters, 16)
|
||||||
btn:SetPoint('TOPLEFT', private.status_bar, 'TOPRIGHT', 5, 0)
|
btn:SetPoint('TOPLEFT', private.status_bar, 'TOPRIGHT', 5, 0)
|
||||||
btn:SetWidth(80)
|
btn:SetWidth(80)
|
||||||
btn:SetHeight(24)
|
btn:SetHeight(24)
|
||||||
@@ -261,7 +247,7 @@ function public.on_load()
|
|||||||
private.post_button = btn
|
private.post_button = btn
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn = Aux.gui.button(AuxSellParameters, 16, '$parentRefreshButton')
|
local btn = Aux.gui.button(AuxSellParameters, 16)
|
||||||
btn:SetPoint('TOPLEFT', private.post_button, 'TOPRIGHT', 5, 0)
|
btn:SetPoint('TOPLEFT', private.post_button, 'TOPRIGHT', 5, 0)
|
||||||
btn:SetWidth(80)
|
btn:SetWidth(80)
|
||||||
btn:SetHeight(24)
|
btn:SetHeight(24)
|
||||||
@@ -272,7 +258,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, -74)
|
slider:SetPoint('TOPLEFT', 16, -75)
|
||||||
slider:SetWidth(190)
|
slider:SetWidth(190)
|
||||||
slider:SetScript('OnValueChanged', function()
|
slider:SetScript('OnValueChanged', function()
|
||||||
private.quantity_update()
|
private.quantity_update()
|
||||||
@@ -311,26 +297,10 @@ function public.on_load()
|
|||||||
slider.label:SetTextHeight(13)
|
slider.label:SetTextHeight(13)
|
||||||
private.stack_size_slider = slider
|
private.stack_size_slider = slider
|
||||||
end
|
end
|
||||||
do
|
|
||||||
local checkbox = CreateFrame('CheckButton', nil, AuxSellInventory, 'UICheckButtonTemplate')
|
|
||||||
checkbox:SetWidth(22)
|
|
||||||
checkbox:SetHeight(22)
|
|
||||||
checkbox:SetPoint('TOPLEFT', private.stack_size_slider, 'BOTTOMLEFT', -3, -7)
|
|
||||||
checkbox:SetScript('OnClick', function()
|
|
||||||
local settings = private.read_settings()
|
|
||||||
settings.post_all = this:GetChecked()
|
|
||||||
private.write_settings(settings)
|
|
||||||
refresh = true
|
|
||||||
end)
|
|
||||||
local label = Aux.gui.label(checkbox, 13)
|
|
||||||
label:SetPoint('LEFT', checkbox, 'RIGHT', 2, 1)
|
|
||||||
label:SetText('Post all')
|
|
||||||
private.post_all_checkbox = checkbox
|
|
||||||
end
|
|
||||||
do
|
do
|
||||||
local slider = Aux.gui.slider(AuxSellParameters)
|
local slider = Aux.gui.slider(AuxSellParameters)
|
||||||
slider:SetValueStep(1)
|
slider:SetValueStep(1)
|
||||||
slider:SetPoint('TOPLEFT', private.stack_size_slider, 'BOTTOMLEFT', 0, -51)
|
slider:SetPoint('TOPLEFT', private.stack_size_slider, 'BOTTOMLEFT', 0, -30)
|
||||||
slider:SetWidth(190)
|
slider:SetWidth(190)
|
||||||
slider:SetScript('OnValueChanged', function()
|
slider:SetScript('OnValueChanged', function()
|
||||||
private.quantity_update()
|
private.quantity_update()
|
||||||
@@ -394,22 +364,9 @@ function public.on_load()
|
|||||||
label:SetText('Hide this item')
|
label:SetText('Hide this item')
|
||||||
private.hide_checkbox = checkbox
|
private.hide_checkbox = checkbox
|
||||||
end
|
end
|
||||||
do
|
|
||||||
local dropdown = Aux.gui.dropdown(AuxSellParameters)
|
|
||||||
dropdown:SetPoint('TOPRIGHT', -15, -42)
|
|
||||||
dropdown:SetWidth(120)
|
|
||||||
dropdown:SetHeight(10)
|
|
||||||
local label = Aux.gui.label(dropdown, 13)
|
|
||||||
label:SetPoint('BOTTOMLEFT', dropdown, 'TOPLEFT', -2, -4)
|
|
||||||
label:SetText('Mode')
|
|
||||||
UIDropDownMenu_Initialize(dropdown, private.initialize_mode_dropdown)
|
|
||||||
dropdown:SetScript('OnShow', function()
|
|
||||||
UIDropDownMenu_Initialize(this, private.initialize_mode_dropdown)
|
|
||||||
end)
|
|
||||||
private.mode_dropdown = dropdown
|
|
||||||
end
|
|
||||||
do
|
do
|
||||||
local editbox = Aux.gui.editbox(AuxSellParameters)
|
local editbox = Aux.gui.editbox(AuxSellParameters)
|
||||||
|
editbox:SetPoint('TOPRIGHT', -65, -66)
|
||||||
editbox:SetJustifyH('RIGHT')
|
editbox:SetJustifyH('RIGHT')
|
||||||
editbox:SetWidth(150)
|
editbox:SetWidth(150)
|
||||||
editbox:SetScript('OnTextChanged', function()
|
editbox:SetScript('OnTextChanged', function()
|
||||||
@@ -434,7 +391,7 @@ function public.on_load()
|
|||||||
this:HighlightText()
|
this:HighlightText()
|
||||||
end)
|
end)
|
||||||
editbox:SetScript('OnEditFocusLost', function()
|
editbox:SetScript('OnEditFocusLost', function()
|
||||||
this:SetText(Aux.money.to_string(Aux.money.from_string(this:GetText()) or 0, true, nil, 3))
|
this:SetText(Aux.money.to_string(private.get_unit_start_price(), true, nil, 3))
|
||||||
end)
|
end)
|
||||||
do
|
do
|
||||||
local label = Aux.gui.label(editbox, 13)
|
local label = Aux.gui.label(editbox, 13)
|
||||||
@@ -452,6 +409,7 @@ function public.on_load()
|
|||||||
end
|
end
|
||||||
do
|
do
|
||||||
local editbox = Aux.gui.editbox(AuxSellParameters)
|
local editbox = Aux.gui.editbox(AuxSellParameters)
|
||||||
|
editbox:SetPoint('TOPRIGHT', private.unit_start_price, 'BOTTOMRIGHT', 0, -18)
|
||||||
editbox:SetJustifyH('RIGHT')
|
editbox:SetJustifyH('RIGHT')
|
||||||
editbox:SetWidth(150)
|
editbox:SetWidth(150)
|
||||||
editbox:SetScript('OnTextChanged', function()
|
editbox:SetScript('OnTextChanged', function()
|
||||||
@@ -474,7 +432,7 @@ function public.on_load()
|
|||||||
this:HighlightText()
|
this:HighlightText()
|
||||||
end)
|
end)
|
||||||
editbox:SetScript('OnEditFocusLost', function()
|
editbox:SetScript('OnEditFocusLost', function()
|
||||||
this:SetText(Aux.money.to_string(Aux.money.from_string(this:GetText()) or 0, true, nil, 3))
|
this:SetText(Aux.money.to_string(private.get_unit_buyout_price(), true, nil, 3))
|
||||||
end)
|
end)
|
||||||
do
|
do
|
||||||
local label = Aux.gui.label(editbox, 13)
|
local label = Aux.gui.label(editbox, 13)
|
||||||
@@ -491,8 +449,8 @@ function public.on_load()
|
|||||||
private.unit_buyout_price = editbox
|
private.unit_buyout_price = editbox
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn = Aux.gui.button(AuxSellParameters, 16, '$parentPostButton')
|
local btn = Aux.gui.button(AuxSellParameters, 16)
|
||||||
btn:SetPoint('TOPRIGHT', -15, -163)
|
btn:SetPoint('TOPRIGHT', -15, -143)
|
||||||
btn:SetWidth(150)
|
btn:SetWidth(150)
|
||||||
btn:SetHeight(20)
|
btn:SetHeight(20)
|
||||||
btn:GetFontString():SetTextHeight(15)
|
btn:GetFontString():SetTextHeight(15)
|
||||||
@@ -515,19 +473,15 @@ function private.price_update()
|
|||||||
if selected_item then
|
if selected_item then
|
||||||
local settings = private.read_settings()
|
local settings = private.read_settings()
|
||||||
|
|
||||||
if aux_post_mode == BID_MODE or aux_post_mode == FULL_MODE then
|
local start_price_input = private.get_unit_start_price()
|
||||||
local start_price_input = private.get_unit_start_price()
|
settings.start_price = start_price_input
|
||||||
settings.start_price = start_price_input
|
local historical_value = Aux.history.value(selected_item.key)
|
||||||
local historical_value = Aux.history.value(selected_item.key)
|
private.start_price_percentage:SetText(historical_value and Aux.auction_listing.percentage_historical(Aux.round(start_price_input / historical_value * 100)) or '---')
|
||||||
private.start_price_percentage:SetText(historical_value and Aux.auction_listing.percentage_historical(Aux.round(start_price_input / historical_value * 100)) or '---')
|
|
||||||
end
|
|
||||||
|
|
||||||
if aux_post_mode == BUYOUT_MODE or aux_post_mode == FULL_MODE then
|
local buyout_price_input = private.get_unit_buyout_price()
|
||||||
local buyout_price_input = private.get_unit_buyout_price()
|
settings.buyout_price = buyout_price_input
|
||||||
settings.buyout_price = buyout_price_input
|
local historical_value = Aux.history.value(selected_item.key)
|
||||||
local historical_value = Aux.history.value(selected_item.key)
|
private.buyout_price_percentage:SetText(historical_value and Aux.auction_listing.percentage_historical(Aux.round(buyout_price_input / historical_value * 100)) or '---')
|
||||||
private.buyout_price_percentage:SetText(historical_value and Aux.auction_listing.percentage_historical(Aux.round(buyout_price_input / historical_value * 100)) or '---')
|
|
||||||
end
|
|
||||||
|
|
||||||
private.write_settings(settings)
|
private.write_settings(settings)
|
||||||
end
|
end
|
||||||
@@ -554,11 +508,7 @@ function private.post_auctions()
|
|||||||
local unit_buyout_price = private.get_unit_buyout_price()
|
local unit_buyout_price = private.get_unit_buyout_price()
|
||||||
local stack_size = private.stack_size_slider:GetValue()
|
local stack_size = private.stack_size_slider:GetValue()
|
||||||
local stack_count
|
local stack_count
|
||||||
if private.post_all_checkbox:GetChecked() and not selected_item.max_charges then
|
stack_count = private.stack_count_slider:GetValue()
|
||||||
stack_count = floor(selected_item.aux_quantity / stack_size)
|
|
||||||
else
|
|
||||||
stack_count = private.stack_count_slider:GetValue()
|
|
||||||
end
|
|
||||||
local duration = UIDropDownMenu_GetSelectedValue(private.duration_dropdown)
|
local duration = UIDropDownMenu_GetSelectedValue(private.duration_dropdown)
|
||||||
local key = selected_item.key
|
local key = selected_item.key
|
||||||
|
|
||||||
@@ -578,15 +528,11 @@ function private.post_auctions()
|
|||||||
unit_start_price,
|
unit_start_price,
|
||||||
unit_buyout_price,
|
unit_buyout_price,
|
||||||
stack_count,
|
stack_count,
|
||||||
private.post_all_checkbox:GetChecked() and not selected_item.max_charges,
|
function(posted)
|
||||||
function(posted, partial)
|
|
||||||
local new_auction_record
|
local new_auction_record
|
||||||
for i = 1, posted do
|
for i = 1, posted do
|
||||||
new_auction_record = private.record_auction(key, stack_size, unit_start_price, unit_buyout_price, duration_code, UnitName('player'))
|
new_auction_record = private.record_auction(key, stack_size, unit_start_price, unit_buyout_price, duration_code, UnitName('player'))
|
||||||
end
|
end
|
||||||
if partial then
|
|
||||||
new_auction_record = private.record_auction(key, partial, unit_start_price, unit_buyout_price, duration_code, UnitName('player'))
|
|
||||||
end
|
|
||||||
|
|
||||||
private.update_inventory_records()
|
private.update_inventory_records()
|
||||||
selected_item = nil
|
selected_item = nil
|
||||||
@@ -619,7 +565,7 @@ function private.validate_parameters()
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if private.stack_count_slider:GetValue() == 0 and (selected_item.max_charges or not private.post_all_checkbox:GetChecked()) then
|
if private.stack_count_slider:GetValue() == 0 then
|
||||||
private.post_button:Disable()
|
private.post_button:Disable()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@@ -637,43 +583,19 @@ function private.update_item_configuration()
|
|||||||
AuxSellParametersItemName:SetTextColor(unpack(Aux.gui.config.label_color.enabled))
|
AuxSellParametersItemName:SetTextColor(unpack(Aux.gui.config.label_color.enabled))
|
||||||
AuxSellParametersItemName:SetText('No item selected')
|
AuxSellParametersItemName:SetText('No item selected')
|
||||||
|
|
||||||
private.mode_dropdown:Hide()
|
|
||||||
private.unit_start_price:Hide()
|
private.unit_start_price:Hide()
|
||||||
private.unit_buyout_price:Hide()
|
private.unit_buyout_price:Hide()
|
||||||
|
|
||||||
private.stack_size_slider:Hide()
|
private.stack_size_slider:Hide()
|
||||||
private.post_all_checkbox:Hide()
|
|
||||||
private.stack_count_slider:Hide()
|
private.stack_count_slider:Hide()
|
||||||
private.deposit:Hide()
|
private.deposit:Hide()
|
||||||
private.duration_dropdown:Hide()
|
private.duration_dropdown:Hide()
|
||||||
private.historical_value_button:Hide()
|
private.historical_value_button:Hide()
|
||||||
private.hide_checkbox:Hide()
|
private.hide_checkbox:Hide()
|
||||||
else
|
else
|
||||||
private.mode_dropdown:Show()
|
private.unit_start_price:Show()
|
||||||
private.unit_start_price:ClearAllPoints()
|
private.unit_buyout_price:Show()
|
||||||
private.unit_buyout_price:ClearAllPoints()
|
|
||||||
if aux_post_mode == BUYOUT_MODE then
|
|
||||||
private.unit_start_price:Hide()
|
|
||||||
private.unit_buyout_price:SetPoint('TOPRIGHT', -65, -100)
|
|
||||||
private.unit_buyout_price:Show()
|
|
||||||
elseif aux_post_mode == BID_MODE then
|
|
||||||
private.unit_buyout_price:Hide()
|
|
||||||
private.unit_start_price:SetPoint('TOPRIGHT', -65, -100)
|
|
||||||
private.unit_start_price:Show()
|
|
||||||
elseif aux_post_mode == FULL_MODE then
|
|
||||||
private.unit_start_price:SetPoint('TOPRIGHT', -65, -89)
|
|
||||||
private.unit_start_price:Show()
|
|
||||||
private.unit_buyout_price:SetPoint('TOPRIGHT', private.unit_start_price, 'BOTTOMRIGHT', 0, -15)
|
|
||||||
private.unit_buyout_price:Show()
|
|
||||||
end
|
|
||||||
|
|
||||||
private.stack_size_slider:Show()
|
private.stack_size_slider:Show()
|
||||||
private.post_all_checkbox:Show()
|
private.stack_count_slider:Show()
|
||||||
if private.post_all_checkbox:GetChecked() then
|
|
||||||
private.stack_count_slider:Hide()
|
|
||||||
else
|
|
||||||
private.stack_count_slider:Show()
|
|
||||||
end
|
|
||||||
private.deposit:Show()
|
private.deposit:Show()
|
||||||
private.duration_dropdown:Show()
|
private.duration_dropdown:Show()
|
||||||
private.historical_value_button:Show()
|
private.historical_value_button:Show()
|
||||||
@@ -696,16 +618,8 @@ function private.update_item_configuration()
|
|||||||
local deposit_factor = Aux.neutral and 0.25 or 0.05
|
local deposit_factor = Aux.neutral and 0.25 or 0.05
|
||||||
local stack_size = private.stack_size_slider:GetValue()
|
local stack_size = private.stack_size_slider:GetValue()
|
||||||
local stack_count
|
local stack_count
|
||||||
if private.post_all_checkbox:GetChecked() and not selected_item.max_charges then
|
stack_count = private.stack_count_slider:GetValue()
|
||||||
stack_count = floor(selected_item.aux_quantity / stack_size)
|
|
||||||
else
|
|
||||||
stack_count = private.stack_count_slider:GetValue()
|
|
||||||
end
|
|
||||||
local deposit = floor(selected_item.unit_vendor_price * deposit_factor * (selected_item.max_charges and 1 or stack_size)) * stack_count * UIDropDownMenu_GetSelectedValue(private.duration_dropdown) / 120
|
local deposit = floor(selected_item.unit_vendor_price * deposit_factor * (selected_item.max_charges and 1 or stack_size)) * stack_count * UIDropDownMenu_GetSelectedValue(private.duration_dropdown) / 120
|
||||||
if private.post_all_checkbox:GetChecked() and not selected_item.max_charges then
|
|
||||||
local partial_stack = mod(selected_item.aux_quantity, stack_size)
|
|
||||||
deposit = deposit + floor(selected_item.unit_vendor_price * deposit_factor * partial_stack) * UIDropDownMenu_GetSelectedValue(private.duration_dropdown) / 120
|
|
||||||
end
|
|
||||||
|
|
||||||
private.deposit:SetText('Deposit: '..Aux.money.to_string(deposit, nil, nil, nil, Aux.gui.inline_color({255, 254, 250, 1})))
|
private.deposit:SetText('Deposit: '..Aux.money.to_string(deposit, nil, nil, nil, Aux.gui.inline_color({255, 254, 250, 1})))
|
||||||
end
|
end
|
||||||
@@ -783,11 +697,7 @@ function private.set_item(item)
|
|||||||
UIDropDownMenu_Initialize(private.duration_dropdown, private.initialize_duration_dropdown) -- TODO, wtf, why is this needed
|
UIDropDownMenu_Initialize(private.duration_dropdown, private.initialize_duration_dropdown) -- TODO, wtf, why is this needed
|
||||||
UIDropDownMenu_SetSelectedValue(private.duration_dropdown, settings.duration)
|
UIDropDownMenu_SetSelectedValue(private.duration_dropdown, settings.duration)
|
||||||
|
|
||||||
UIDropDownMenu_Initialize(private.mode_dropdown, private.initialize_mode_dropdown)
|
|
||||||
UIDropDownMenu_SetSelectedValue(private.mode_dropdown, aux_post_mode)
|
|
||||||
|
|
||||||
private.hide_checkbox:SetChecked(settings.hidden)
|
private.hide_checkbox:SetChecked(settings.hidden)
|
||||||
private.post_all_checkbox:SetChecked(settings.post_all)
|
|
||||||
|
|
||||||
private.stack_size_slider:SetMinMaxValues(1, selected_item.max_charges or selected_item.max_stack)
|
private.stack_size_slider:SetMinMaxValues(1, selected_item.max_charges or selected_item.max_stack)
|
||||||
private.stack_size_slider:SetValue(settings.stack_size)
|
private.stack_size_slider:SetValue(settings.stack_size)
|
||||||
@@ -898,7 +808,6 @@ function private.refresh_entries()
|
|||||||
end,
|
end,
|
||||||
on_complete = function()
|
on_complete = function()
|
||||||
existing_auctions[item_key] = existing_auctions[item_key] or {}
|
existing_auctions[item_key] = existing_auctions[item_key] or {}
|
||||||
private.update_historical_value_button()
|
|
||||||
refresh = true
|
refresh = true
|
||||||
private.status_bar:update_status(100, 100)
|
private.status_bar:update_status(100, 100)
|
||||||
private.status_bar:set_text('Done Scanning')
|
private.status_bar:set_text('Done Scanning')
|
||||||
@@ -980,29 +889,3 @@ function private.initialize_duration_dropdown()
|
|||||||
func = on_click,
|
func = on_click,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
function private.initialize_mode_dropdown()
|
|
||||||
local function on_click()
|
|
||||||
UIDropDownMenu_SetSelectedValue(private.mode_dropdown, this.value)
|
|
||||||
aux_post_mode = this.value
|
|
||||||
refresh = true
|
|
||||||
end
|
|
||||||
|
|
||||||
UIDropDownMenu_AddButton{
|
|
||||||
text = 'Buyout',
|
|
||||||
value = BUYOUT_MODE,
|
|
||||||
func = on_click,
|
|
||||||
}
|
|
||||||
|
|
||||||
UIDropDownMenu_AddButton{
|
|
||||||
text = 'Bid',
|
|
||||||
value = BID_MODE,
|
|
||||||
func = on_click,
|
|
||||||
}
|
|
||||||
|
|
||||||
UIDropDownMenu_AddButton{
|
|
||||||
text = 'Full',
|
|
||||||
value = FULL_MODE,
|
|
||||||
func = on_click,
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|||||||
+2
-2
@@ -28,7 +28,7 @@
|
|||||||
</Anchors>
|
</Anchors>
|
||||||
</Frame>
|
</Frame>
|
||||||
<frame name="AuxSellParameters" inherits="AuxFrameBoxTemplate">
|
<frame name="AuxSellParameters" inherits="AuxFrameBoxTemplate">
|
||||||
<Size><AbsDimension y="197"/></Size>
|
<Size><AbsDimension y="177"/></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>
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
</frames>
|
</frames>
|
||||||
</frame>
|
</frame>
|
||||||
<Frame name="AuxSellAuctions" inherits="AuxFrameBoxTemplate">
|
<Frame name="AuxSellAuctions" inherits="AuxFrameBoxTemplate">
|
||||||
<Size><AbsDimension y="197"/></Size>
|
<Size><AbsDimension y="217"/></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>
|
||||||
|
|||||||
Reference in New Issue
Block a user