added fake ismouseover to listings

This commit is contained in:
Manuel Simon Hirsig
2016-02-08 13:35:27 +01:00
parent d7a310a7c0
commit ed40fe78cd
4 changed files with 26 additions and 16 deletions
+10 -9
View File
@@ -67,13 +67,13 @@ function private.new_item_record()
return { daily_bid_values = {}, daily_buyout_values = {}, bids_of_today = Aux.util.set(), buyouts_of_today = Aux.util.set() }
end
function private.price_class(price)
return Aux.round(math.log(price) / math.log(1.1))
end
function private.price_class_price(class)
return 1.1^class
end
--function private.price_class(price)
-- return Aux.round(math.log(price) / math.log(1.1))
--end
--
--function private.price_class_price(class)
-- return 1.1^class
--end
function public.process_auction(auction_info)
@@ -127,6 +127,7 @@ function private.daily_bid_value(item_key)
if getn(prices) == 0 then
return
end
sort(prices, function(a,b) return b < a end)
local acc = 0
@@ -140,12 +141,12 @@ function private.daily_bid_value(item_key)
end
function private.daily_buyout_value(item_key)
local data = private.load_data()
local prices = data.item_records[item_key].buyouts_of_today:values()
if getn(prices) == 0 then
return
end
sort(prices)
local acc = 0
@@ -173,7 +174,7 @@ function private.median(list)
return (sorted_list[floor(middle)] + sorted_list[ceil(middle)]) / 2
end
function public.push_data()
function private.push_data()
for item_key, record in pairs(data.item_records) do
+6 -1
View File
@@ -38,6 +38,7 @@ end
local defaultColScripts = {
OnEnter = function()
this.row.mouseover = true
if not this.row.data then return end
if not this.st.highlightDisabled then
this.row.highlight:Show()
@@ -50,6 +51,7 @@ local defaultColScripts = {
end,
OnLeave = function()
this.row.mouseover = false
if not this.row.data then return end
if this.st.selectionDisabled or not this.st.selected or this.st.selected ~= GetTableIndex(this.st.rowData, this.row.data) then
this.row.highlight:Hide()
@@ -116,7 +118,10 @@ local methods = {
if not data then break end
st.rows[i].data = data
if (st.selected == GetTableIndex(st.rowData, data) and not st.selectionDisabled) or (st.highlighted and st.highlighted == GetTableIndex(st.rowData, data)) then
if (st.selected == GetTableIndex(st.rowData, data) and not st.selectionDisabled)
or (st.highlighted and st.highlighted == GetTableIndex(st.rowData, data))
or st.rows[i].mouseover
then
st.rows[i].highlight:Show()
else
st.rows[i].highlight:Hide()
+2 -2
View File
@@ -13,9 +13,9 @@ function SlashCmdList.AUX(parameter)
Aux.log('Item cache deleted; falling back to the default.')
elseif parameter == 'market bid' then
aux_market_value_type = 'bid'
Aux.log('Set Market Value to bid based.')
Aux.log('Set market value to bid based.')
elseif parameter == 'market buyout' then
aux_market_value_type = 'buyout'
Aux.log('Set Market Value to buyout based.')
Aux.log('Set market value to buyout based.')
end
end
+8 -4
View File
@@ -1,10 +1,14 @@
local m = {}
Aux.test = m
function m.test_history()
for i=1,5000 do
for j=1, 100 do
Aux.history.process_auction({item_key = i..':0', buyout_price = j, high_bid = j, aux_quantity=1})
do
local id = 0
function m.test_history()
for i=1,500 do
for j=1, 100 do
Aux.history.process_auction({item_key = id..':0', buyout_price = j, high_bid = j, aux_quantity=1})
end
id = id + 1
end
end
end