Add files via upload

reupload in right folder
This commit is contained in:
geojak
2022-04-02 14:54:03 +02:00
committed by GitHub
parent eab57d72e7
commit 3dc0f22908
16 changed files with 298 additions and 23 deletions
+60 -3
View File
@@ -248,6 +248,58 @@ function post_auctions()
end
end
function M.post_auctions_bind()
if selected_item then
local unit_start_price = get_unit_start_price()
local unit_buyout_price = get_unit_buyout_price()
local stack_size = stack_size_slider:GetValue()
local stack_count
stack_count = stack_count_slider:GetValue()
local duration = UIDropDownMenu_GetSelectedValue(duration_dropdown)
local key = selected_item.key
local duration_code
if duration == DURATION_2 then
duration_code = 2
elseif duration == DURATION_8 then
duration_code = 3
elseif duration == DURATION_24 then
duration_code = 4
end
post.start(
key,
stack_size,
duration,
unit_start_price,
unit_buyout_price,
stack_count,
function(posted)
if not frame:IsShown() then
return
end
for i = 1, posted do
record_auction(key, stack_size, unit_start_price * stack_size, unit_buyout_price, duration_code, UnitName'player')
end
update_inventory_records()
local same
for _, record in inventory_records do
if record.key == key then
same = record
break
end
end
if same then
update_item(same)
else
selected_item = nil
end
refresh = true
end
)
end
end
function validate_parameters()
if not selected_item then
post_button:Disable()
@@ -258,7 +310,7 @@ function validate_parameters()
return
end
if get_unit_start_price() == 0 then
post_button:Disable()
post_button:Enable()
return
end
if stack_count_slider:GetValue() == 0 then
@@ -379,18 +431,23 @@ function update_item(item)
UIDropDownMenu_SetSelectedValue(duration_dropdown, settings.duration)
hide_checkbox:SetChecked(settings.hidden)
local ii = 1
if selected_item.max_charges then
for i = selected_item.max_charges, 1, -1 do
if selected_item.availability[i] > 0 then
stack_size_slider:SetMinMaxValues(1, i)
ii=i
break
end
end
else
ii = min(selected_item.max_stack, selected_item.aux_quantity)
stack_size_slider:SetMinMaxValues(1, min(selected_item.max_stack, selected_item.aux_quantity))
end
stack_size_slider:SetValue(aux.huge)
stack_size_slider:SetValue(math.random(1,ii))
--stack_size_slider:SetValue(aux.huge)
--stack_size_slider:SetValue(1)
quantity_update(true)
unit_start_price_input:SetText(money.to_string(settings.start_price, true, nil, nil, true))