make random stack sizes optional

in my last pull request i changed the defaul behaviour of aux to max stack sizes to random stack sizes.
this pull reqeust chagnes this back and adds the /aux post stack command to toggle stacks off and get random post sizes instead
This commit is contained in:
geojak
2022-04-26 17:56:32 +02:00
committed by GitHub
parent 0ab1cd8f62
commit ede00f203b
4 changed files with 26 additions and 14 deletions
+1
View File
@@ -59,6 +59,7 @@ function handle.LOAD()
crafting_cost = true,
post_bid = false,
post_duration = post.DURATION_24,
post_stack = true,
items = {},
item_ids = {},
auctionable_items = {},
+4
View File
@@ -21,6 +21,9 @@ function SlashCmdList.AUX(command)
elseif arguments[1] == 'ignore' and arguments[2] == 'owner' then
aux.account_data.ignore_owner = not aux.account_data.ignore_owner
aux.print('ignore owner ' .. status(aux.account_data.ignore_owner))
elseif arguments[1] == 'post' and arguments[2] == 'stack' then
aux.account_data.post_stack = not aux.account_data.post_stack
aux.print('post stack ' .. status(aux.account_data.post_stack))
elseif arguments[1] == 'post' and arguments[2] == 'bid' then
aux.account_data.post_bid = not aux.account_data.post_bid
aux.print('post bid ' .. status(aux.account_data.post_bid))
@@ -61,6 +64,7 @@ function SlashCmdList.AUX(command)
aux.print('- ignore owner [' .. status(aux.account_data.ignore_owner) .. ']')
aux.print('- post bid [' .. status(aux.account_data.post_bid) .. ']')
aux.print('- post duration [' .. aux.color.blue(aux.account_data.post_duration / 60 .. 'h') .. ']')
aux.print('- post stack [' .. status(aux.account_data.post_stack) .. ']')
aux.print('- crafting cost [' .. status(aux.account_data.crafting_cost) .. ']')
aux.print('- tooltip value [' .. status(tooltip_settings.value) .. ']')
aux.print('- tooltip daily [' .. status(tooltip_settings.daily) .. ']')
+6 -4
View File
@@ -155,10 +155,12 @@ function game_tooltip_hooks:SetInboxItem(index)
local name, _, quantity = GetInboxItem(index)
local id = name and info.item_id(name)
if id then
local _, itemstring, quality = GetItemInfo(id)
local hex = aux.select(4, GetItemQualityColor(tonumber(quality)))
local link = hex .. '|H' .. itemstring .. '|h[' .. name .. ']|h' .. FONT_COLOR_CODE_CLOSE
extend_tooltip(GameTooltip, link, quantity)
local _, itemstring, quality = (id)
if quality and itemstring then
local hex = aux.select(4, GetItemQualityColor(tonumber(quality)))
local link = hex .. '|H' .. itemstring .. '|h[' .. name .. ']|h' .. FONT_COLOR_CODE_CLOSE
extend_tooltip(GameTooltip, link, quantity)
end
end
end
+15 -10
View File
@@ -431,23 +431,28 @@ 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.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
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(math.random(1,ii))
--stack_size_slider:SetValue(aux.huge)
--stack_size_slider:SetValue(1)
stack_size_slider:SetMinMaxValues(1, min(selected_item.max_stack, selected_item.aux_quantity))
end
if not aux.account_data.post_stack then
stack_size_slider:SetValue(math.random(1,ii))
else
stack_size_slider:SetValue(aux.huge)
--stack_size_slider:SetValue(1)
end
quantity_update(true)
unit_start_price_input:SetText(money.to_string(settings.start_price, true, nil, nil, true))