green_t refactoring

This commit is contained in:
Manuel Simon Hirsig
2016-08-31 04:09:34 +02:00
parent 02952ba91a
commit 27e592bead
10 changed files with 65 additions and 65 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ function LOAD()
hook(name, GameTooltip, function(...) temp=arg
inside_hook = true
game_tooltip_money = 0
local ret = {orig[GameTooltip][name](unpack(arg))}
local ret = temp-ret(orig[GameTooltip][name](unpack(arg)))
inside_hook = false
f(unpack(arg))
return unpack(ret)
+7 -7
View File
@@ -996,10 +996,10 @@ function public.CreateAuctionResultsTable(parent, config)
local numRows = 16
rt.ROW_HEIGHT = (parent:GetHeight() - HEAD_HEIGHT - HEAD_SPACE) / numRows
rt.scrollDisabled = nil
rt.expanded = {}
rt.handlers = {}
rt.sorts = {}
rt.records = {}
rt.expanded = t
rt.handlers = t
rt.sorts = t
rt.records = t
rt.rowInfo = {numDisplayRows=0}
for name, func in methods do
@@ -1045,7 +1045,7 @@ function public.CreateAuctionResultsTable(parent, config)
_G[scrollBar:GetName()..'ScrollDownButton']:Hide()
-- create the header cells
rt.headCells = {}
rt.headCells = t
for i, column_config in rt.config do
local cell = CreateFrame('Button', nil, rt.contentFrame)
cell:SetHeight(HEAD_HEIGHT)
@@ -1088,7 +1088,7 @@ function public.CreateAuctionResultsTable(parent, config)
end
-- create the rows
rt.rows = {}
rt.rows = t
for i = 1, numRows do
local row = CreateFrame('Frame', nil, rt.contentFrame)
row:SetHeight(rt.ROW_HEIGHT)
@@ -1106,7 +1106,7 @@ function public.CreateAuctionResultsTable(parent, config)
row.highlight = highlight
row.rt = rt
row.cells = {}
row.cells = t
for j=1, getn(rt.config) do
local cell = CreateFrame('Button', nil, row)
local text = cell:CreateFontString()
+2 -2
View File
@@ -14,7 +14,7 @@ function LOAD()
aux_background:SetAllPoints(DropDownList1Backdrop)
blizzard_backdrop = DropDownList1Backdrop:GetBackdrop()
hook('ToggleDropDownMenu', function(...) temp=arg
local ret = {orig.ToggleDropDownMenu(unpack(arg)) }
local ret = temp-ret(orig.ToggleDropDownMenu(unpack(arg)))
local dropdown = _G[arg[4] or ''] or this:GetParent()
if strfind(dropdown:GetName() or '', '^aux_frame%d+$') then
set_aux_dropdown_style(dropdown)
@@ -290,7 +290,7 @@ do
local self = {
_frame = parent,
_orientation = orientation,
_tabs = {},
_tabs = t,
}
return setmetatable(self, mt)
end
+5 -5
View File
@@ -445,11 +445,11 @@ function public.CreateScrollingTable(parent)
-- setup default values
st.isTSMScrollingTable = true
st.sizes = {}
st.headCols = {}
st.rows = {}
st.handlers = {}
st.sortInfo = {enabled=nil}
st.sizes = t
st.headCols = t
st.rows = t
st.handlers = t
st.sortInfo = t
st.colInfo = DEFAULT_COL_INFO
return st
+2 -2
View File
@@ -1,6 +1,6 @@
aux 'auctions_tab' local scan = aux.scan
auction_records = {}
auction_records = t
function LOAD()
create_frames()
@@ -29,7 +29,7 @@ function public.scan_auctions()
update_listing()
scan.start{
type = 'owner',
queries = {{ blizzard_query = {} }},
queries = {{blizzard_query = t}},
on_page_loaded = function(page, total_pages)
status_bar:update_status(100 * (page - 1) / total_pages, 0)
status_bar:set_text(format('Scanning (Page %d / %d)', page, total_pages))
+3 -3
View File
@@ -1,6 +1,6 @@
aux 'bids_tab' local scan = aux.scan
auction_records = {}
auction_records = t
function LOAD()
create_frames()
@@ -29,7 +29,7 @@ function public.scan_bids()
update_listing()
scan.start{
type = 'bidder',
queries = {{ blizzard_query = {} }},
queries = {{blizzard_query=t}},
on_page_loaded = function(page, total_pages)
status_bar:update_status(100 * (page - 1) / total_pages, 0)
status_bar:set_text(format('Scanning (Page %d / %d)', page, total_pages))
@@ -58,7 +58,7 @@ end
do
local scan_id = 0
local IDLE, SEARCHING, FOUND = {}, {}, {}
local IDLE, SEARCHING, FOUND = 1, 2, 3
local state = IDLE
local found_index
+1 -1
View File
@@ -517,7 +517,7 @@ function create_frames()
if filter_util.filters[text] and filter_util.filters[text].input_type ~= '' then
local _, _, suggestions = filter_util.parse_filter_string(text..'/')
filter_parameter_input:SetNumeric(filter_util.filters[text].input_type == 'number')
filter_parameter_input.complete = completion.complete(function() return suggestions or {} end)
filter_parameter_input.complete = completion.complete(function() return suggestions or O end)
filter_parameter_input:Show()
else
filter_parameter_input:Hide()
+1 -1
View File
@@ -346,7 +346,7 @@ function public.execute(resume, real_time)
end
new_recent_search(filter_string, join(map(copy(queries), function(filter) return filter.prettified end), ';'))
else
current_search.records = {}
current_search.records = t
current_search.table:SetDatabase(current_search.records)
if current_search.real_time ~= real_time then
current_search.table:Reset()
+4 -4
View File
@@ -1,10 +1,10 @@
aux 'search_tab'
_G.aux_favorite_searches = {}
_G.aux_recent_searches = {}
_G.aux_favorite_searches = t
_G.aux_recent_searches = t
function update_search_listings()
local favorite_search_rows = {}
local favorite_search_rows = t
for i, favorite_search in _G.aux_favorite_searches do
local name = strsub(favorite_search.prettified, 1, 250)
tinsert(favorite_search_rows, {
@@ -15,7 +15,7 @@ function update_search_listings()
end
favorite_searches_listing:SetData(favorite_search_rows)
local recent_search_rows = {}
local recent_search_rows = t
for i, recent_search in _G.aux_recent_searches do
local name = strsub(recent_search.prettified, 1, 250)
tinsert(recent_search_rows, {
+39 -39
View File
@@ -111,49 +111,49 @@ function public.auction(index, query_type)
local blizzard_bid = high_bid > 0 and high_bid or start_price
local bid_price = high_bid > 0 and (high_bid + min_increment) or start_price
return {
item_id = item_id,
suffix_id = suffix_id,
unique_id = unique_id,
enchant_id = enchant_id,
return T(
'item_id', item_id,
'suffix_id', suffix_id,
'unique_id', unique_id,
'enchant_id', enchant_id,
link = link,
itemstring = item_info.itemstring,
item_key = item_id..':'..suffix_id,
search_signature = join(temp-{item_id, suffix_id, enchant_id, start_price, buyout_price, bid_price, aux_quantity, duration, query_type == 'owner' and high_bidder or (high_bidder and 1 or 0), _G.aux_ignore_owner and (is_player(owner) and 0 or 1) or (owner or '?')}, ':'),
sniping_signature = join(temp-{item_id, suffix_id, enchant_id, start_price, buyout_price, aux_quantity, _G.aux_ignore_owner and (is_player(owner, true) and 0 or 1) or (owner or '?')}, ':'),
'link', link,
'itemstring', item_info.itemstring,
'item_key', item_id..':'..suffix_id,
'search_signature', join(temp-{item_id, suffix_id, enchant_id, start_price, buyout_price, bid_price, aux_quantity, duration, query_type == 'owner' and high_bidder or (high_bidder and 1 or 0), _G.aux_ignore_owner and (is_player(owner) and 0 or 1) or (owner or '?')}, ':'),
'sniping_signature', join(temp-{item_id, suffix_id, enchant_id, start_price, buyout_price, aux_quantity, _G.aux_ignore_owner and (is_player(owner, true) and 0 or 1) or (owner or '?')}, ':'),
name = name,
texture = texture,
level = item_info.level,
type = item_info.type,
subtype = item_info.subtype,
slot = item_info.slot,
quality = quality,
max_stack = item_info.max_stack,
'name', name,
'texture', texture,
'level', item_info.level,
'type', item_info.type,
'subtype', item_info.subtype,
'slot', item_info.slot,
'quality', quality,
'max_stack', item_info.max_stack,
count = count,
start_price = start_price,
high_bid = high_bid,
min_increment = min_increment,
blizzard_bid = blizzard_bid,
bid_price = bid_price,
buyout_price = buyout_price,
unit_blizzard_bid = blizzard_bid / aux_quantity,
unit_bid_price = bid_price / aux_quantity,
unit_buyout_price = buyout_price / aux_quantity,
high_bidder = high_bidder,
owner = owner,
sale_status = sale_status,
duration = duration,
usable = usable,
'count', count,
'start_price', start_price,
'high_bid', high_bid,
'min_increment', min_increment,
'blizzard_bid', blizzard_bid,
'bid_price', bid_price,
'buyout_price', buyout_price,
'unit_blizzard_bid', blizzard_bid / aux_quantity,
'unit_bid_price', bid_price / aux_quantity,
'unit_buyout_price', buyout_price / aux_quantity,
'high_bidder', high_bidder,
'owner', owner,
'sale_status', sale_status,
'duration', duration,
'usable', usable,
tooltip = tooltip,
tooltip_money = tooltip_money,
max_charges = max_charges,
charges = charges,
aux_quantity = aux_quantity,
}
'tooltip', tooltip,
'tooltip_money', tooltip_money,
'max_charges', max_charges,
'charges', charges,
'aux_quantity', aux_quantity
)
end
end