Allow for theme to be toggleable in-game
Refactored UI code to run after variables are loaded so that this information can be retrieved before the UI is constructed
This commit is contained in:
+12
-7
@@ -2,8 +2,7 @@ module 'aux'
|
|||||||
|
|
||||||
local T = require 'T'
|
local T = require 'T'
|
||||||
local post = require 'aux.tabs.post'
|
local post = require 'aux.tabs.post'
|
||||||
|
local gui = require 'aux.gui'
|
||||||
M.USE_BLIZZARD_THEME = true
|
|
||||||
|
|
||||||
M.print = T.vararg-function(arg)
|
M.print = T.vararg-function(arg)
|
||||||
DEFAULT_CHAT_FRAME:AddMessage(LIGHTYELLOW_FONT_COLOR_CODE .. '<aux> ' .. join(map(arg, tostring), ' '))
|
DEFAULT_CHAT_FRAME:AddMessage(LIGHTYELLOW_FONT_COLOR_CODE .. '<aux> ' .. join(map(arg, tostring), ' '))
|
||||||
@@ -24,12 +23,15 @@ local set_handler = {}
|
|||||||
M.handle = setmetatable({}, {__metatable=false, __newindex=function(_, k, v) set_handler[k](v) end})
|
M.handle = setmetatable({}, {__metatable=false, __newindex=function(_, k, v) set_handler[k](v) end})
|
||||||
|
|
||||||
do
|
do
|
||||||
local handlers, handlers2 = {}, {}
|
local handlers_INIT_UI, handlers_LOAD, handlers_LOAD2 = {}, {}, {}
|
||||||
|
function set_handler.INIT_UI(f)
|
||||||
|
tinsert(handlers_INIT_UI, f)
|
||||||
|
end
|
||||||
function set_handler.LOAD(f)
|
function set_handler.LOAD(f)
|
||||||
tinsert(handlers, f)
|
tinsert(handlers_LOAD, f)
|
||||||
end
|
end
|
||||||
function set_handler.LOAD2(f)
|
function set_handler.LOAD2(f)
|
||||||
tinsert(handlers2, f)
|
tinsert(handlers_LOAD2, f)
|
||||||
end
|
end
|
||||||
event_frame:SetScript('OnEvent', function()
|
event_frame:SetScript('OnEvent', function()
|
||||||
if event == 'ADDON_LOADED' then
|
if event == 'ADDON_LOADED' then
|
||||||
@@ -37,9 +39,11 @@ do
|
|||||||
auction_ui_loaded()
|
auction_ui_loaded()
|
||||||
end
|
end
|
||||||
elseif event == 'VARIABLES_LOADED' then
|
elseif event == 'VARIABLES_LOADED' then
|
||||||
for _, f in handlers do f() end
|
gui.set_global_theme(aux and aux.account.theme)
|
||||||
|
for _, f in handlers_INIT_UI do f() end
|
||||||
|
for _, f in handlers_LOAD do f() end
|
||||||
elseif event == 'PLAYER_LOGIN' then
|
elseif event == 'PLAYER_LOGIN' then
|
||||||
for _, f in handlers2 do f() end
|
for _, f in handlers_LOAD2 do f() end
|
||||||
print('loaded - /aux')
|
print('loaded - /aux')
|
||||||
else
|
else
|
||||||
_M[event]()
|
_M[event]()
|
||||||
@@ -68,6 +72,7 @@ function handle.LOAD()
|
|||||||
merchant_buy = {},
|
merchant_buy = {},
|
||||||
merchant_sell = {},
|
merchant_sell = {},
|
||||||
sharing = true,
|
sharing = true,
|
||||||
|
theme = 'blizzard',
|
||||||
})
|
})
|
||||||
do
|
do
|
||||||
local key = format('%s|%s', GetCVar'realmName', UnitName'player')
|
local key = format('%s|%s', GetCVar'realmName', UnitName'player')
|
||||||
|
|||||||
@@ -4,11 +4,16 @@ local T = require 'T'
|
|||||||
local aux = require 'aux'
|
local aux = require 'aux'
|
||||||
local info = require 'aux.util.info'
|
local info = require 'aux.util.info'
|
||||||
local post = require 'aux.tabs.post'
|
local post = require 'aux.tabs.post'
|
||||||
|
local gui = require 'aux.gui'
|
||||||
|
|
||||||
function status(enabled)
|
function status(enabled)
|
||||||
return (enabled and aux.color.green'on' or aux.color.red'off')
|
return (enabled and aux.color.green'on' or aux.color.red'off')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function warn_reload()
|
||||||
|
aux.print(aux.color.orange('A relog or reload is required for this change to take effect.'))
|
||||||
|
end
|
||||||
|
|
||||||
_G.SLASH_AUX1 = '/aux'
|
_G.SLASH_AUX1 = '/aux'
|
||||||
function SlashCmdList.AUX(command)
|
function SlashCmdList.AUX(command)
|
||||||
if not command then return end
|
if not command then return end
|
||||||
@@ -27,6 +32,7 @@ function SlashCmdList.AUX(command)
|
|||||||
elseif arguments[1] == 'post' and arguments[2] == 'bid' then
|
elseif arguments[1] == 'post' and arguments[2] == 'bid' then
|
||||||
aux.account_data.post_bid = not aux.account_data.post_bid
|
aux.account_data.post_bid = not aux.account_data.post_bid
|
||||||
aux.print('post bid ' .. status(aux.account_data.post_bid))
|
aux.print('post bid ' .. status(aux.account_data.post_bid))
|
||||||
|
warn_reload()
|
||||||
elseif arguments[1] == 'post' and arguments[2] == 'duration' and T.map('6', post.DURATION_2, '24', post.DURATION_8, '72', post.DURATION_24)[arguments[3]] then
|
elseif arguments[1] == 'post' and arguments[2] == 'duration' and T.map('6', post.DURATION_2, '24', post.DURATION_8, '72', post.DURATION_24)[arguments[3]] then
|
||||||
aux.account_data.post_duration = T.map('6', post.DURATION_2, '24', post.DURATION_8, '72', post.DURATION_24)[arguments[3]]
|
aux.account_data.post_duration = T.map('6', post.DURATION_2, '24', post.DURATION_8, '72', post.DURATION_24)[arguments[3]]
|
||||||
aux.print('post duration ' .. aux.color.blue(aux.account_data.post_duration / 60 * 3 .. 'h'))
|
aux.print('post duration ' .. aux.color.blue(aux.account_data.post_duration / 60 * 3 .. 'h'))
|
||||||
@@ -61,6 +67,10 @@ function SlashCmdList.AUX(command)
|
|||||||
elseif arguments[1] == 'sharing' then
|
elseif arguments[1] == 'sharing' then
|
||||||
aux.account_data.sharing = not aux.account_data.sharing
|
aux.account_data.sharing = not aux.account_data.sharing
|
||||||
aux.print('sharing ' .. status(aux.account_data.sharing))
|
aux.print('sharing ' .. status(aux.account_data.sharing))
|
||||||
|
elseif arguments[1] == 'theme' and (arguments[2] == 'default' or arguments[2] == 'blizzard') then
|
||||||
|
aux.account_data.theme = arguments[2]
|
||||||
|
aux.print('theme ' .. aux.color.blue(aux.account_data.theme))
|
||||||
|
warn_reload()
|
||||||
elseif arguments[1] == 'show' and arguments[2] == 'hidden' then
|
elseif arguments[1] == 'show' and arguments[2] == 'hidden' then
|
||||||
aux.account_data.showhidden = not aux.account_data.showhidden
|
aux.account_data.showhidden = not aux.account_data.showhidden
|
||||||
aux.print('show hidden ' .. status(aux.account_data.showhidden))
|
aux.print('show hidden ' .. status(aux.account_data.showhidden))
|
||||||
@@ -81,6 +91,8 @@ function SlashCmdList.AUX(command)
|
|||||||
aux.print('- clear item cache')
|
aux.print('- clear item cache')
|
||||||
aux.print('- populate wdb')
|
aux.print('- populate wdb')
|
||||||
aux.print('- sharing [' .. status(aux.account_data.sharing) .. ']')
|
aux.print('- sharing [' .. status(aux.account_data.sharing) .. ']')
|
||||||
|
aux.print('- theme [' .. aux.color[gui.is_blizzard() and 'red' or 'green']('default') .. ' | ' ..
|
||||||
|
aux.color[gui.is_blizzard() and 'green' or 'red']('blizzard') .. ']')
|
||||||
aux.print('- show hidden [' .. status(aux.account_data.showhidden) .. ']')
|
aux.print('- show hidden [' .. status(aux.account_data.showhidden) .. ']')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -8,7 +8,8 @@ function handle.LOAD()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
do
|
function handle.INIT_UI()
|
||||||
|
do
|
||||||
local frame = CreateFrame('Frame', 'aux_frame', UIParent)
|
local frame = CreateFrame('Frame', 'aux_frame', UIParent)
|
||||||
tinsert(UISpecialFrames, 'aux_frame')
|
tinsert(UISpecialFrames, 'aux_frame')
|
||||||
if not gui.is_blizzard() then
|
if not gui.is_blizzard() then
|
||||||
@@ -38,13 +39,13 @@ do
|
|||||||
frame.content:SetPoint('BOTTOMRIGHT', -4, 35)
|
frame.content:SetPoint('BOTTOMRIGHT', -4, 35)
|
||||||
frame:Hide()
|
frame:Hide()
|
||||||
M.frame = frame
|
M.frame = frame
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
tabs = gui.tabs(frame, 'DOWN')
|
tabs = gui.tabs(frame, 'DOWN')
|
||||||
tabs._on_select = on_tab_click
|
tabs._on_select = on_tab_click
|
||||||
function M.set_tab(id) tabs:select(id) end
|
function M.set_tab(id) tabs:select(id) end
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn = gui.button(frame)
|
local btn = gui.button(frame)
|
||||||
btn:SetPoint('BOTTOMRIGHT', -5, 5)
|
btn:SetPoint('BOTTOMRIGHT', -5, 5)
|
||||||
gui.set_size(btn, 60, 24)
|
gui.set_size(btn, 60, 24)
|
||||||
@@ -52,8 +53,8 @@ do
|
|||||||
btn:SetScript('OnClick', function() frame:Hide() end)
|
btn:SetScript('OnClick', function() frame:Hide() end)
|
||||||
btn:SetFrameLevel(btn:GetFrameLevel() + 2)
|
btn:SetFrameLevel(btn:GetFrameLevel() + 2)
|
||||||
close_button = btn
|
close_button = btn
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn = gui.button(frame, gui.font_size.small)
|
local btn = gui.button(frame, gui.font_size.small)
|
||||||
btn:SetPoint('RIGHT', close_button, 'LEFT' , -5, 0)
|
btn:SetPoint('RIGHT', close_button, 'LEFT' , -5, 0)
|
||||||
gui.set_size(btn, gui.is_blizzard() and 80 or 60, 24)
|
gui.set_size(btn, gui.is_blizzard() and 80 or 60, 24)
|
||||||
@@ -62,4 +63,5 @@ do
|
|||||||
btn:SetScript('OnClick',function()
|
btn:SetScript('OnClick',function()
|
||||||
if AuctionFrame:IsVisible() then HideUIPanel(AuctionFrame) else ShowUIPanel(AuctionFrame) end
|
if AuctionFrame:IsVisible() then HideUIPanel(AuctionFrame) else ShowUIPanel(AuctionFrame) end
|
||||||
end)
|
end)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
+7
-1
@@ -107,8 +107,14 @@ do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local using_blizzard_theme = false
|
||||||
|
|
||||||
|
function M.set_global_theme(theme)
|
||||||
|
using_blizzard_theme = theme == 'blizzard'
|
||||||
|
end
|
||||||
|
|
||||||
function M.is_blizzard()
|
function M.is_blizzard()
|
||||||
return aux.USE_BLIZZARD_THEME
|
return using_blizzard_theme
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.set_size(frame, width, height)
|
function M.set_size(frame, width, height)
|
||||||
|
|||||||
+22
-20
@@ -6,20 +6,21 @@ local gui = require 'aux.gui'
|
|||||||
local auction_listing = require 'aux.gui.auction_listing'
|
local auction_listing = require 'aux.gui.auction_listing'
|
||||||
local search_tab = require 'aux.tabs.search'
|
local search_tab = require 'aux.tabs.search'
|
||||||
|
|
||||||
frame = CreateFrame('Frame', nil, aux.frame)
|
function aux.handle.INIT_UI()
|
||||||
frame:SetAllPoints()
|
frame = CreateFrame('Frame', nil, aux.frame)
|
||||||
frame:SetScript('OnUpdate', on_update)
|
frame:SetAllPoints()
|
||||||
frame:Hide()
|
frame:SetScript('OnUpdate', on_update)
|
||||||
|
frame:Hide()
|
||||||
|
|
||||||
frame.listing = gui.panel(frame)
|
frame.listing = gui.panel(frame)
|
||||||
frame.listing:SetPoint('TOP', frame, 'TOP', 0, -8)
|
frame.listing:SetPoint('TOP', frame, 'TOP', 0, -8)
|
||||||
frame.listing:SetPoint('BOTTOMLEFT', aux.frame.content, 'BOTTOMLEFT', 0, 0)
|
frame.listing:SetPoint('BOTTOMLEFT', aux.frame.content, 'BOTTOMLEFT', 0, 0)
|
||||||
frame.listing:SetPoint('BOTTOMRIGHT', aux.frame.content, 'BOTTOMRIGHT', 0, 0)
|
frame.listing:SetPoint('BOTTOMRIGHT', aux.frame.content, 'BOTTOMRIGHT', 0, 0)
|
||||||
|
|
||||||
listing = auction_listing.new(frame.listing, 20, auction_listing.auctions_columns)
|
listing = auction_listing.new(frame.listing, 20, auction_listing.auctions_columns)
|
||||||
listing:SetSort(1, 2, 3, 4, 5, 6, 7, 8)
|
listing:SetSort(1, 2, 3, 4, 5, 6, 7, 8)
|
||||||
listing:Reset()
|
listing:Reset()
|
||||||
listing:SetHandler('OnClick', function(row, button)
|
listing:SetHandler('OnClick', function(row, button)
|
||||||
if IsAltKeyDown() then
|
if IsAltKeyDown() then
|
||||||
if listing:GetSelection().record == row.record then
|
if listing:GetSelection().record == row.record then
|
||||||
if IsAltKeyDown() and listing:GetSelection().record == row.record then
|
if IsAltKeyDown() and listing:GetSelection().record == row.record then
|
||||||
@@ -31,32 +32,33 @@ listing:SetHandler('OnClick', function(row, button)
|
|||||||
search_tab.set_filter(strlower(info.item(this.record.item_id).name) .. '/exact')
|
search_tab.set_filter(strlower(info.item(this.record.item_id).name) .. '/exact')
|
||||||
search_tab.execute(nil, false)
|
search_tab.execute(nil, false)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
listing:SetHandler('OnSelectionChanged', function(rt, datum)
|
listing:SetHandler('OnSelectionChanged', function(rt, datum)
|
||||||
if not datum then return end
|
if not datum then return end
|
||||||
find_auction(datum.record)
|
find_auction(datum.record)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
do
|
do
|
||||||
status_bar = gui.status_bar(frame)
|
status_bar = gui.status_bar(frame)
|
||||||
status_bar:SetWidth(265)
|
status_bar:SetWidth(265)
|
||||||
status_bar:SetHeight(25)
|
status_bar:SetHeight(25)
|
||||||
status_bar:SetPoint('TOPLEFT', aux.frame.content, 'BOTTOMLEFT', 0, -6)
|
status_bar:SetPoint('TOPLEFT', aux.frame.content, 'BOTTOMLEFT', 0, -6)
|
||||||
status_bar:update_status(1, 1)
|
status_bar:update_status(1, 1)
|
||||||
status_bar:set_text('')
|
status_bar:set_text('')
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn = gui.button(frame)
|
local btn = gui.button(frame)
|
||||||
btn:SetPoint('TOPLEFT', status_bar, 'TOPRIGHT', 5, 0)
|
btn:SetPoint('TOPLEFT', status_bar, 'TOPRIGHT', 5, 0)
|
||||||
btn:SetText('Cancel')
|
btn:SetText('Cancel')
|
||||||
btn:Disable()
|
btn:Disable()
|
||||||
cancel_button = btn
|
cancel_button = btn
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn = gui.button(frame)
|
local btn = gui.button(frame)
|
||||||
btn:SetPoint('TOPLEFT', cancel_button, 'TOPRIGHT', 5, 0)
|
btn:SetPoint('TOPLEFT', cancel_button, 'TOPRIGHT', 5, 0)
|
||||||
btn:SetText('Refresh')
|
btn:SetText('Refresh')
|
||||||
btn:SetScript('OnClick', function()
|
btn:SetScript('OnClick', function()
|
||||||
scan_auctions()
|
scan_auctions()
|
||||||
end)
|
end)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
+24
-22
@@ -6,20 +6,21 @@ local gui = require 'aux.gui'
|
|||||||
local auction_listing = require 'aux.gui.auction_listing'
|
local auction_listing = require 'aux.gui.auction_listing'
|
||||||
local search_tab = require 'aux.tabs.search'
|
local search_tab = require 'aux.tabs.search'
|
||||||
|
|
||||||
frame = CreateFrame('Frame', nil, aux.frame)
|
function aux.handle.INIT_UI()
|
||||||
frame:SetAllPoints()
|
frame = CreateFrame('Frame', nil, aux.frame)
|
||||||
frame:SetScript('OnUpdate', on_update)
|
frame:SetAllPoints()
|
||||||
frame:Hide()
|
frame:SetScript('OnUpdate', on_update)
|
||||||
|
frame:Hide()
|
||||||
|
|
||||||
frame.listing = gui.panel(frame)
|
frame.listing = gui.panel(frame)
|
||||||
frame.listing:SetPoint('TOP', frame, 'TOP', 0, -8)
|
frame.listing:SetPoint('TOP', frame, 'TOP', 0, -8)
|
||||||
frame.listing:SetPoint('BOTTOMLEFT', aux.frame.content, 'BOTTOMLEFT', 0, 0)
|
frame.listing:SetPoint('BOTTOMLEFT', aux.frame.content, 'BOTTOMLEFT', 0, 0)
|
||||||
frame.listing:SetPoint('BOTTOMRIGHT', aux.frame.content, 'BOTTOMRIGHT', 0, 0)
|
frame.listing:SetPoint('BOTTOMRIGHT', aux.frame.content, 'BOTTOMRIGHT', 0, 0)
|
||||||
|
|
||||||
listing = auction_listing.new(frame.listing, 20, auction_listing.bids_columns)
|
listing = auction_listing.new(frame.listing, 20, auction_listing.bids_columns)
|
||||||
listing:SetSort(1, 2, 3, 4, 5, 6, 7, 8)
|
listing:SetSort(1, 2, 3, 4, 5, 6, 7, 8)
|
||||||
listing:Reset()
|
listing:Reset()
|
||||||
listing:SetHandler('OnClick', function(row, button)
|
listing:SetHandler('OnClick', function(row, button)
|
||||||
if IsAltKeyDown() then
|
if IsAltKeyDown() then
|
||||||
if listing:GetSelection().record == row.record then
|
if listing:GetSelection().record == row.record then
|
||||||
if button == 'LeftButton' then
|
if button == 'LeftButton' then
|
||||||
@@ -33,39 +34,40 @@ listing:SetHandler('OnClick', function(row, button)
|
|||||||
search_tab.set_filter(strlower(info.item(this.record.item_id).name) .. '/exact')
|
search_tab.set_filter(strlower(info.item(this.record.item_id).name) .. '/exact')
|
||||||
search_tab.execute(nil, false)
|
search_tab.execute(nil, false)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
listing:SetHandler('OnSelectionChanged', function(rt, datum)
|
listing:SetHandler('OnSelectionChanged', function(rt, datum)
|
||||||
if not datum then return end
|
if not datum then return end
|
||||||
find_auction(datum.record)
|
find_auction(datum.record)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
do
|
do
|
||||||
status_bar = gui.status_bar(frame)
|
status_bar = gui.status_bar(frame)
|
||||||
status_bar:SetWidth(265)
|
status_bar:SetWidth(265)
|
||||||
status_bar:SetHeight(25)
|
status_bar:SetHeight(25)
|
||||||
status_bar:SetPoint('TOPLEFT', aux.frame.content, 'BOTTOMLEFT', 0, -6)
|
status_bar:SetPoint('TOPLEFT', aux.frame.content, 'BOTTOMLEFT', 0, -6)
|
||||||
status_bar:update_status(1, 0)
|
status_bar:update_status(1, 0)
|
||||||
status_bar:set_text('')
|
status_bar:set_text('')
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn = gui.button(frame)
|
local btn = gui.button(frame)
|
||||||
btn:SetPoint('TOPLEFT', status_bar, 'TOPRIGHT', 5, 0)
|
btn:SetPoint('TOPLEFT', status_bar, 'TOPRIGHT', 5, 0)
|
||||||
btn:SetText('Bid')
|
btn:SetText('Bid')
|
||||||
btn:Disable()
|
btn:Disable()
|
||||||
bid_button = btn
|
bid_button = btn
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn = gui.button(frame)
|
local btn = gui.button(frame)
|
||||||
btn:SetPoint('TOPLEFT', bid_button, 'TOPRIGHT', 5, 0)
|
btn:SetPoint('TOPLEFT', bid_button, 'TOPRIGHT', 5, 0)
|
||||||
btn:SetText('Buyout')
|
btn:SetText('Buyout')
|
||||||
btn:Disable()
|
btn:Disable()
|
||||||
buyout_button = btn
|
buyout_button = btn
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn = gui.button(frame)
|
local btn = gui.button(frame)
|
||||||
btn:SetPoint('TOPLEFT', buyout_button, 'TOPRIGHT', 5, 0)
|
btn:SetPoint('TOPLEFT', buyout_button, 'TOPRIGHT', 5, 0)
|
||||||
btn:SetText('Refresh')
|
btn:SetText('Refresh')
|
||||||
btn:SetScript('OnClick', function()
|
btn:SetScript('OnClick', function()
|
||||||
scan_bids()
|
scan_bids()
|
||||||
end)
|
end)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
+74
-72
@@ -8,38 +8,39 @@ local listing = require 'aux.gui.listing'
|
|||||||
local item_listing = require 'aux.gui.item_listing'
|
local item_listing = require 'aux.gui.item_listing'
|
||||||
local search_tab = require 'aux.tabs.search'
|
local search_tab = require 'aux.tabs.search'
|
||||||
|
|
||||||
local THEME_PADDING = gui.is_blizzard() and 6.5 or 2.5
|
function aux.handle.INIT_UI()
|
||||||
|
local THEME_PADDING = gui.is_blizzard() and 6.5 or 2.5
|
||||||
|
|
||||||
frame = CreateFrame('Frame', nil, aux.frame)
|
frame = CreateFrame('Frame', nil, aux.frame)
|
||||||
frame:SetAllPoints()
|
frame:SetAllPoints()
|
||||||
frame:SetScript('OnUpdate', on_update)
|
frame:SetScript('OnUpdate', on_update)
|
||||||
frame:Hide()
|
frame:Hide()
|
||||||
|
|
||||||
frame.content = CreateFrame('Frame', nil, frame)
|
frame.content = CreateFrame('Frame', nil, frame)
|
||||||
frame.content:SetPoint('TOP', frame, 'TOP', 0, -8)
|
frame.content:SetPoint('TOP', frame, 'TOP', 0, -8)
|
||||||
frame.content:SetPoint('BOTTOMLEFT', aux.frame.content, 'BOTTOMLEFT', 0, 0)
|
frame.content:SetPoint('BOTTOMLEFT', aux.frame.content, 'BOTTOMLEFT', 0, 0)
|
||||||
frame.content:SetPoint('BOTTOMRIGHT', aux.frame.content, 'BOTTOMRIGHT', 0, 0)
|
frame.content:SetPoint('BOTTOMRIGHT', aux.frame.content, 'BOTTOMRIGHT', 0, 0)
|
||||||
|
|
||||||
frame.inventory = gui.panel(frame.content)
|
frame.inventory = gui.panel(frame.content)
|
||||||
frame.inventory:SetWidth(212)
|
frame.inventory:SetWidth(212)
|
||||||
frame.inventory:SetPoint('TOPLEFT', 0, 0)
|
frame.inventory:SetPoint('TOPLEFT', 0, 0)
|
||||||
frame.inventory:SetPoint('BOTTOMLEFT', 0, 0)
|
frame.inventory:SetPoint('BOTTOMLEFT', 0, 0)
|
||||||
|
|
||||||
frame.parameters = gui.panel(frame.content)
|
frame.parameters = gui.panel(frame.content)
|
||||||
frame.parameters:SetHeight(173)
|
frame.parameters:SetHeight(173)
|
||||||
frame.parameters:SetPoint('TOPLEFT', frame.inventory, 'TOPRIGHT', THEME_PADDING, 0)
|
frame.parameters:SetPoint('TOPLEFT', frame.inventory, 'TOPRIGHT', THEME_PADDING, 0)
|
||||||
frame.parameters:SetPoint('TOPRIGHT', 0, 0)
|
frame.parameters:SetPoint('TOPRIGHT', 0, 0)
|
||||||
|
|
||||||
frame.bid_listing = gui.panel(frame.content)
|
frame.bid_listing = gui.panel(frame.content)
|
||||||
frame.bid_listing:SetHeight(228)
|
frame.bid_listing:SetHeight(228)
|
||||||
frame.bid_listing:SetWidth(271.5)
|
frame.bid_listing:SetWidth(271.5)
|
||||||
frame.bid_listing:SetPoint('BOTTOMLEFT', frame.inventory, 'BOTTOMRIGHT', THEME_PADDING, 0)
|
frame.bid_listing:SetPoint('BOTTOMLEFT', frame.inventory, 'BOTTOMRIGHT', THEME_PADDING, 0)
|
||||||
|
|
||||||
frame.buyout_listing = gui.panel(frame.content)
|
frame.buyout_listing = gui.panel(frame.content)
|
||||||
frame.buyout_listing:SetPoint('TOPLEFT', frame.parameters, 'BOTTOMLEFT', 0, -THEME_PADDING)
|
frame.buyout_listing:SetPoint('TOPLEFT', frame.parameters, 'BOTTOMLEFT', 0, -THEME_PADDING)
|
||||||
frame.buyout_listing:SetPoint('BOTTOMRIGHT', 0, 0)
|
frame.buyout_listing:SetPoint('BOTTOMRIGHT', 0, 0)
|
||||||
|
|
||||||
do
|
do
|
||||||
local checkbox = gui.checkbox(frame.inventory)
|
local checkbox = gui.checkbox(frame.inventory)
|
||||||
checkbox:SetPoint('TOPLEFT', 49, -15)
|
checkbox:SetPoint('TOPLEFT', 49, -15)
|
||||||
checkbox:SetScript('OnClick', function()
|
checkbox:SetScript('OnClick', function()
|
||||||
@@ -49,11 +50,11 @@ do
|
|||||||
label:SetPoint('LEFT', checkbox, 'RIGHT', 4, 1)
|
label:SetPoint('LEFT', checkbox, 'RIGHT', 4, 1)
|
||||||
label:SetText('Show hidden items')
|
label:SetText('Show hidden items')
|
||||||
show_hidden_checkbox = checkbox
|
show_hidden_checkbox = checkbox
|
||||||
end
|
end
|
||||||
|
|
||||||
gui.horizontal_line(frame.inventory, -45)
|
gui.horizontal_line(frame.inventory, -45)
|
||||||
|
|
||||||
do
|
do
|
||||||
local f = CreateFrame('Frame', nil, frame.inventory)
|
local f = CreateFrame('Frame', nil, frame.inventory)
|
||||||
f:SetPoint('TOPLEFT', 0, -51)
|
f:SetPoint('TOPLEFT', 0, -51)
|
||||||
f:SetPoint('BOTTOMRIGHT', 0, 0)
|
f:SetPoint('BOTTOMRIGHT', 0, 0)
|
||||||
@@ -72,79 +73,79 @@ do
|
|||||||
return item_record == selected_item
|
return item_record == selected_item
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
bid_listing = listing.new(frame.bid_listing)
|
bid_listing = listing.new(frame.bid_listing)
|
||||||
bid_listing:SetColInfo{
|
bid_listing:SetColInfo{
|
||||||
{name='Auctions', width=.17, align='CENTER'},
|
{name='Auctions', width=.17, align='CENTER'},
|
||||||
{name='Time\nLeft', width=.11, align='CENTER'},
|
{name='Time\nLeft', width=.11, align='CENTER'},
|
||||||
{name='Stack\nSize', width=.11, align='CENTER'},
|
{name='Stack\nSize', width=.11, align='CENTER'},
|
||||||
{name='Auction Bid\n(per item)', width=.4, align='RIGHT'},
|
{name='Auction Bid\n(per item)', width=.4, align='RIGHT'},
|
||||||
{name='% Hist.\nValue', width=.21, align='CENTER'},
|
{name='% Hist.\nValue', width=.21, align='CENTER'},
|
||||||
}
|
}
|
||||||
bid_listing:SetSelection(function(data)
|
bid_listing:SetSelection(function(data)
|
||||||
return data.record == get_bid_selection() or data.record.historical_value and get_bid_selection() and get_bid_selection().historical_value
|
return data.record == get_bid_selection() or data.record.historical_value and get_bid_selection() and get_bid_selection().historical_value
|
||||||
end)
|
end)
|
||||||
bid_listing:SetHandler('OnClick', function(table, row_data, column, button)
|
bid_listing:SetHandler('OnClick', function(table, row_data, column, button)
|
||||||
if button == 'RightButton' and row_data.record == get_bid_selection() or row_data.record.historical_value and get_bid_selection() and get_bid_selection().historical_value then
|
if button == 'RightButton' and row_data.record == get_bid_selection() or row_data.record.historical_value and get_bid_selection() and get_bid_selection().historical_value then
|
||||||
set_bid_selection()
|
set_bid_selection()
|
||||||
else
|
else
|
||||||
set_bid_selection(row_data.record)
|
set_bid_selection(row_data.record)
|
||||||
end
|
end
|
||||||
refresh = true
|
refresh = true
|
||||||
end)
|
end)
|
||||||
bid_listing:SetHandler('OnDoubleClick', function(table, row_data, column, button)
|
bid_listing:SetHandler('OnDoubleClick', function(table, row_data, column, button)
|
||||||
stack_size_slider:SetValue(row_data.record.stack_size)
|
stack_size_slider:SetValue(row_data.record.stack_size)
|
||||||
refresh = true
|
refresh = true
|
||||||
end)
|
end)
|
||||||
|
|
||||||
buyout_listing = listing.new(frame.buyout_listing)
|
buyout_listing = listing.new(frame.buyout_listing)
|
||||||
buyout_listing:SetColInfo{
|
buyout_listing:SetColInfo{
|
||||||
{name='Auctions', width=.17, align='CENTER'},
|
{name='Auctions', width=.17, align='CENTER'},
|
||||||
{name='Time\nLeft', width=.11, align='CENTER'},
|
{name='Time\nLeft', width=.11, align='CENTER'},
|
||||||
{name='Stack\nSize', width=.12, align='CENTER'},
|
{name='Stack\nSize', width=.12, align='CENTER'},
|
||||||
{name='Auction Buyout\n(per item)', width=.4, align='RIGHT'},
|
{name='Auction Buyout\n(per item)', width=.4, align='RIGHT'},
|
||||||
{name='% Hist.\nValue', width=.20, align='CENTER'},
|
{name='% Hist.\nValue', width=.20, align='CENTER'},
|
||||||
}
|
}
|
||||||
buyout_listing:SetSelection(function(data)
|
buyout_listing:SetSelection(function(data)
|
||||||
return data.record == get_buyout_selection() or data.record.historical_value and get_buyout_selection() and get_buyout_selection().historical_value
|
return data.record == get_buyout_selection() or data.record.historical_value and get_buyout_selection() and get_buyout_selection().historical_value
|
||||||
end)
|
end)
|
||||||
buyout_listing:SetHandler('OnClick', function(table, row_data, column, button)
|
buyout_listing:SetHandler('OnClick', function(table, row_data, column, button)
|
||||||
if button == 'RightButton' and row_data.record == get_buyout_selection() or row_data.record.historical_value and get_buyout_selection() and get_buyout_selection().historical_value then
|
if button == 'RightButton' and row_data.record == get_buyout_selection() or row_data.record.historical_value and get_buyout_selection() and get_buyout_selection().historical_value then
|
||||||
set_buyout_selection()
|
set_buyout_selection()
|
||||||
else
|
else
|
||||||
set_buyout_selection(row_data.record)
|
set_buyout_selection(row_data.record)
|
||||||
end
|
end
|
||||||
refresh = true
|
refresh = true
|
||||||
end)
|
end)
|
||||||
buyout_listing:SetHandler('OnDoubleClick', function(table, row_data, column, button)
|
buyout_listing:SetHandler('OnDoubleClick', function(table, row_data, column, button)
|
||||||
stack_size_slider:SetValue(row_data.record.stack_size)
|
stack_size_slider:SetValue(row_data.record.stack_size)
|
||||||
refresh = true
|
refresh = true
|
||||||
end)
|
end)
|
||||||
|
|
||||||
do
|
do
|
||||||
status_bar = gui.status_bar(frame)
|
status_bar = gui.status_bar(frame)
|
||||||
status_bar:SetWidth(265)
|
status_bar:SetWidth(265)
|
||||||
status_bar:SetHeight(25)
|
status_bar:SetHeight(25)
|
||||||
status_bar:SetPoint('TOPLEFT', aux.frame.content, 'BOTTOMLEFT', 0, -6)
|
status_bar:SetPoint('TOPLEFT', aux.frame.content, 'BOTTOMLEFT', 0, -6)
|
||||||
status_bar:update_status(1, 1)
|
status_bar:update_status(1, 1)
|
||||||
status_bar:set_text('')
|
status_bar:set_text('')
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn = gui.button(frame.parameters)
|
local btn = gui.button(frame.parameters)
|
||||||
btn:SetPoint('TOPLEFT', status_bar, 'TOPRIGHT', 5, 0)
|
btn:SetPoint('TOPLEFT', status_bar, 'TOPRIGHT', 5, 0)
|
||||||
btn:SetText('Post')
|
btn:SetText('Post')
|
||||||
btn:SetScript('OnClick', post_auctions)
|
btn:SetScript('OnClick', post_auctions)
|
||||||
post_button = btn
|
post_button = btn
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn = gui.button(frame.parameters)
|
local btn = gui.button(frame.parameters)
|
||||||
btn:SetPoint('TOPLEFT', post_button, 'TOPRIGHT', 5, 0)
|
btn:SetPoint('TOPLEFT', post_button, 'TOPRIGHT', 5, 0)
|
||||||
btn:SetText('Refresh')
|
btn:SetText('Refresh')
|
||||||
btn:SetScript('OnClick', refresh_button_click)
|
btn:SetScript('OnClick', refresh_button_click)
|
||||||
refresh_button = btn
|
refresh_button = btn
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
item = gui.item(frame.parameters)
|
item = gui.item(frame.parameters)
|
||||||
item:SetPoint('TOPLEFT', 10, -6)
|
item:SetPoint('TOPLEFT', 10, -6)
|
||||||
item.button:SetScript('OnEnter', function()
|
item.button:SetScript('OnEnter', function()
|
||||||
@@ -155,8 +156,8 @@ do
|
|||||||
item.button:SetScript('OnLeave', function()
|
item.button:SetScript('OnLeave', function()
|
||||||
GameTooltip:Hide()
|
GameTooltip:Hide()
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local slider = gui.slider(frame.parameters)
|
local slider = gui.slider(frame.parameters)
|
||||||
slider:SetValueStep(1)
|
slider:SetValueStep(1)
|
||||||
slider:SetPoint('TOPLEFT', 13, -73)
|
slider:SetPoint('TOPLEFT', 13, -73)
|
||||||
@@ -185,8 +186,8 @@ do
|
|||||||
slider.editbox:SetMaxLetters(3)
|
slider.editbox:SetMaxLetters(3)
|
||||||
slider.label:SetText('Stack Size')
|
slider.label:SetText('Stack Size')
|
||||||
stack_size_slider = slider
|
stack_size_slider = slider
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local slider = gui.slider(frame.parameters)
|
local slider = gui.slider(frame.parameters)
|
||||||
slider:SetValueStep(1)
|
slider:SetValueStep(1)
|
||||||
slider:SetPoint('TOPLEFT', stack_size_slider, 'BOTTOMLEFT', 0, gui.is_blizzard() and -25 or -32)
|
slider:SetPoint('TOPLEFT', stack_size_slider, 'BOTTOMLEFT', 0, gui.is_blizzard() and -25 or -32)
|
||||||
@@ -208,8 +209,8 @@ do
|
|||||||
slider.editbox:SetNumeric(true)
|
slider.editbox:SetNumeric(true)
|
||||||
slider.label:SetText('Stack Count')
|
slider.label:SetText('Stack Count')
|
||||||
stack_count_slider = slider
|
stack_count_slider = slider
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local dropdown = gui.dropdown(frame.parameters)
|
local dropdown = gui.dropdown(frame.parameters)
|
||||||
dropdown:SetPoint('TOPLEFT', stack_count_slider, 'BOTTOMLEFT', 0, gui.is_blizzard() and -10 or -22)
|
dropdown:SetPoint('TOPLEFT', stack_count_slider, 'BOTTOMLEFT', 0, gui.is_blizzard() and -10 or -22)
|
||||||
dropdown:SetWidth(90)
|
dropdown:SetWidth(90)
|
||||||
@@ -221,8 +222,8 @@ do
|
|||||||
UIDropDownMenu_Initialize(this, initialize_duration_dropdown)
|
UIDropDownMenu_Initialize(this, initialize_duration_dropdown)
|
||||||
end)
|
end)
|
||||||
duration_dropdown = dropdown
|
duration_dropdown = dropdown
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local checkbox = gui.checkbox(frame.parameters)
|
local checkbox = gui.checkbox(frame.parameters)
|
||||||
checkbox:SetPoint('TOPRIGHT', -83, -6)
|
checkbox:SetPoint('TOPRIGHT', -83, -6)
|
||||||
checkbox:SetScript('OnClick', function()
|
checkbox:SetScript('OnClick', function()
|
||||||
@@ -235,8 +236,8 @@ do
|
|||||||
label:SetPoint('LEFT', checkbox, 'RIGHT', 4, 1)
|
label:SetPoint('LEFT', checkbox, 'RIGHT', 4, 1)
|
||||||
label:SetText('Hide this item')
|
label:SetText('Hide this item')
|
||||||
hide_checkbox = checkbox
|
hide_checkbox = checkbox
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local editbox = gui.editbox(frame.parameters)
|
local editbox = gui.editbox(frame.parameters)
|
||||||
editbox:SetPoint('TOPRIGHT', -71, -60)
|
editbox:SetPoint('TOPRIGHT', -71, -60)
|
||||||
editbox:SetWidth(180)
|
editbox:SetWidth(180)
|
||||||
@@ -270,8 +271,8 @@ do
|
|||||||
start_price_percentage = label
|
start_price_percentage = label
|
||||||
end
|
end
|
||||||
unit_start_price_input = editbox
|
unit_start_price_input = editbox
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local editbox = gui.editbox(frame.parameters)
|
local editbox = gui.editbox(frame.parameters)
|
||||||
editbox:SetPoint('TOPRIGHT', unit_start_price_input, 'BOTTOMRIGHT', 0, -19)
|
editbox:SetPoint('TOPRIGHT', unit_start_price_input, 'BOTTOMRIGHT', 0, -19)
|
||||||
editbox:SetWidth(180)
|
editbox:SetWidth(180)
|
||||||
@@ -305,19 +306,19 @@ do
|
|||||||
buyout_price_percentage = label
|
buyout_price_percentage = label
|
||||||
end
|
end
|
||||||
unit_buyout_price_input = editbox
|
unit_buyout_price_input = editbox
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local label = gui.label(frame.parameters, gui.font_size.medium)
|
local label = gui.label(frame.parameters, gui.font_size.medium)
|
||||||
label:SetPoint('TOPLEFT', unit_buyout_price_input, 'BOTTOMLEFT', -180, -24)
|
label:SetPoint('TOPLEFT', unit_buyout_price_input, 'BOTTOMLEFT', -180, -24)
|
||||||
deposit = label
|
deposit = label
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local label = gui.label(frame.parameters, gui.font_size.medium)
|
local label = gui.label(frame.parameters, gui.font_size.medium)
|
||||||
label:SetPoint('TOPLEFT', unit_buyout_price_input, 'BOTTOMLEFT', 0, -24)
|
label:SetPoint('TOPLEFT', unit_buyout_price_input, 'BOTTOMLEFT', 0, -24)
|
||||||
vendor_price_label = label
|
vendor_price_label = label
|
||||||
end
|
end
|
||||||
|
|
||||||
function aux.handle.LOAD()
|
function aux.handle.LOAD()
|
||||||
if aux.account_data.post_bid then
|
if aux.account_data.post_bid then
|
||||||
frame.bid_listing:SetPoint('TOPLEFT', frame.parameters, 'BOTTOMLEFT', 0, -THEME_PADDING)
|
frame.bid_listing:SetPoint('TOPLEFT', frame.parameters, 'BOTTOMLEFT', 0, -THEME_PADDING)
|
||||||
frame.bid_listing:SetPoint('BOTTOMLEFT', frame.inventory, 'BOTTOMRIGHT', THEME_PADDING, 0)
|
frame.bid_listing:SetPoint('BOTTOMLEFT', frame.inventory, 'BOTTOMRIGHT', THEME_PADDING, 0)
|
||||||
@@ -336,4 +337,5 @@ function aux.handle.LOAD()
|
|||||||
{name='% Hist. Value', width=.15, align='CENTER'},
|
{name='% Hist. Value', width=.15, align='CENTER'},
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
+96
-94
@@ -10,33 +10,34 @@ local gui = require 'aux.gui'
|
|||||||
local listing = require 'aux.gui.listing'
|
local listing = require 'aux.gui.listing'
|
||||||
local auction_listing = require 'aux.gui.auction_listing'
|
local auction_listing = require 'aux.gui.auction_listing'
|
||||||
|
|
||||||
local FILTER_SPACING = 28.5
|
function aux.handle.INIT_UI()
|
||||||
local THEME_PADDING = gui.is_blizzard() and 4 or 0
|
local FILTER_SPACING = 28.5
|
||||||
|
local THEME_PADDING = gui.is_blizzard() and 4 or 0
|
||||||
|
|
||||||
frame = CreateFrame('Frame', nil, aux.frame)
|
frame = CreateFrame('Frame', nil, aux.frame)
|
||||||
frame:SetAllPoints()
|
frame:SetAllPoints()
|
||||||
frame:SetScript('OnUpdate', on_update)
|
frame:SetScript('OnUpdate', on_update)
|
||||||
frame:Hide()
|
frame:Hide()
|
||||||
|
|
||||||
frame.filter = gui.panel(frame)
|
frame.filter = gui.panel(frame)
|
||||||
frame.filter:SetAllPoints(aux.frame.content)
|
frame.filter:SetAllPoints(aux.frame.content)
|
||||||
|
|
||||||
frame.results = gui.panel(frame)
|
frame.results = gui.panel(frame)
|
||||||
frame.results:SetAllPoints(aux.frame.content)
|
frame.results:SetAllPoints(aux.frame.content)
|
||||||
|
|
||||||
frame.saved = CreateFrame('Frame', nil, frame)
|
frame.saved = CreateFrame('Frame', nil, frame)
|
||||||
frame.saved:SetAllPoints(aux.frame.content)
|
frame.saved:SetAllPoints(aux.frame.content)
|
||||||
|
|
||||||
frame.saved.favorite = gui.panel(frame.saved)
|
frame.saved.favorite = gui.panel(frame.saved)
|
||||||
frame.saved.favorite:SetWidth(393 - THEME_PADDING)
|
frame.saved.favorite:SetWidth(393 - THEME_PADDING)
|
||||||
frame.saved.favorite:SetPoint('TOPLEFT', 0, 0)
|
frame.saved.favorite:SetPoint('TOPLEFT', 0, 0)
|
||||||
frame.saved.favorite:SetPoint('BOTTOMLEFT', 0, 0)
|
frame.saved.favorite:SetPoint('BOTTOMLEFT', 0, 0)
|
||||||
|
|
||||||
frame.saved.recent = gui.panel(frame.saved)
|
frame.saved.recent = gui.panel(frame.saved)
|
||||||
frame.saved.recent:SetWidth(364.5)
|
frame.saved.recent:SetWidth(364.5)
|
||||||
frame.saved.recent:SetPoint('TOPRIGHT', 0, 0)
|
frame.saved.recent:SetPoint('TOPRIGHT', 0, 0)
|
||||||
frame.saved.recent:SetPoint('BOTTOMRIGHT', 0, 0)
|
frame.saved.recent:SetPoint('BOTTOMRIGHT', 0, 0)
|
||||||
do
|
do
|
||||||
local btn = gui.button(frame, 25)
|
local btn = gui.button(frame, 25)
|
||||||
btn:SetPoint('TOPLEFT', 5, -8)
|
btn:SetPoint('TOPLEFT', 5, -8)
|
||||||
btn:SetWidth(30)
|
btn:SetWidth(30)
|
||||||
@@ -44,8 +45,8 @@ do
|
|||||||
btn:SetText('<')
|
btn:SetText('<')
|
||||||
btn:SetScript('OnClick', previous_search)
|
btn:SetScript('OnClick', previous_search)
|
||||||
previous_button = btn
|
previous_button = btn
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn = gui.button(frame, 25)
|
local btn = gui.button(frame, 25)
|
||||||
btn:SetPoint('LEFT', previous_button, 'RIGHT', 4, 0)
|
btn:SetPoint('LEFT', previous_button, 'RIGHT', 4, 0)
|
||||||
btn:SetWidth(30)
|
btn:SetWidth(30)
|
||||||
@@ -53,8 +54,8 @@ do
|
|||||||
btn:SetText('>')
|
btn:SetText('>')
|
||||||
btn:SetScript('OnClick', next_search)
|
btn:SetScript('OnClick', next_search)
|
||||||
next_button = btn
|
next_button = btn
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn = gui.button(frame, gui.font_size.small)
|
local btn = gui.button(frame, gui.font_size.small)
|
||||||
btn:SetHeight(25)
|
btn:SetHeight(25)
|
||||||
btn:SetWidth(60)
|
btn:SetWidth(60)
|
||||||
@@ -63,8 +64,8 @@ do
|
|||||||
update_real_time(true)
|
update_real_time(true)
|
||||||
end)
|
end)
|
||||||
range_button = btn
|
range_button = btn
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn = gui.button(frame, gui.font_size.small)
|
local btn = gui.button(frame, gui.font_size.small)
|
||||||
btn:SetHeight(25)
|
btn:SetHeight(25)
|
||||||
btn:SetWidth(gui.is_blizzard() and 70 or 60)
|
btn:SetWidth(gui.is_blizzard() and 70 or 60)
|
||||||
@@ -74,8 +75,8 @@ do
|
|||||||
update_real_time(false)
|
update_real_time(false)
|
||||||
end)
|
end)
|
||||||
real_time_button = btn
|
real_time_button = btn
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local function change()
|
local function change()
|
||||||
local page = tonumber(this:GetText())
|
local page = tonumber(this:GetText())
|
||||||
local valid_input = page and tostring(max(1, page)) or ''
|
local valid_input = page and tostring(max(1, page)) or ''
|
||||||
@@ -121,8 +122,8 @@ do
|
|||||||
editbox.change = change
|
editbox.change = change
|
||||||
last_page_input = editbox
|
last_page_input = editbox
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn = gui.button(frame)
|
local btn = gui.button(frame)
|
||||||
btn:SetHeight(25)
|
btn:SetHeight(25)
|
||||||
btn:SetPoint('TOPRIGHT', -5, -8)
|
btn:SetPoint('TOPRIGHT', -5, -8)
|
||||||
@@ -135,8 +136,8 @@ do
|
|||||||
execute()
|
execute()
|
||||||
end)
|
end)
|
||||||
start_button = btn
|
start_button = btn
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn = gui.button(frame)
|
local btn = gui.button(frame)
|
||||||
btn:SetHeight(25)
|
btn:SetHeight(25)
|
||||||
btn:SetPoint('TOPRIGHT', -5, -8)
|
btn:SetPoint('TOPRIGHT', -5, -8)
|
||||||
@@ -145,8 +146,8 @@ do
|
|||||||
scan.abort(search_scan_id)
|
scan.abort(search_scan_id)
|
||||||
end)
|
end)
|
||||||
stop_button = btn
|
stop_button = btn
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn = gui.button(frame)
|
local btn = gui.button(frame)
|
||||||
btn:SetHeight(25)
|
btn:SetHeight(25)
|
||||||
btn:SetPoint('RIGHT', start_button, 'LEFT', -4, 0)
|
btn:SetPoint('RIGHT', start_button, 'LEFT', -4, 0)
|
||||||
@@ -156,8 +157,8 @@ do
|
|||||||
execute(true)
|
execute(true)
|
||||||
end)
|
end)
|
||||||
resume_button = btn
|
resume_button = btn
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local editbox = gui.editbox(frame)
|
local editbox = gui.editbox(frame)
|
||||||
editbox:EnableMouse(1)
|
editbox:EnableMouse(1)
|
||||||
editbox.formatter = function(str)
|
editbox.formatter = function(str)
|
||||||
@@ -179,11 +180,11 @@ do
|
|||||||
end)
|
end)
|
||||||
editbox.enter = execute
|
editbox.enter = execute
|
||||||
search_box = editbox
|
search_box = editbox
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
gui.horizontal_line(frame, -40)
|
gui.horizontal_line(frame, -40)
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn = gui.button(frame, gui.font_size.large)
|
local btn = gui.button(frame, gui.font_size.large)
|
||||||
btn:SetPoint('BOTTOMLEFT', aux.frame.content, 'TOPLEFT', 10, 8)
|
btn:SetPoint('BOTTOMLEFT', aux.frame.content, 'TOPLEFT', 10, 8)
|
||||||
btn:SetWidth(243)
|
btn:SetWidth(243)
|
||||||
@@ -191,8 +192,8 @@ do
|
|||||||
btn:SetText('Search Results')
|
btn:SetText('Search Results')
|
||||||
btn:SetScript('OnClick', function() set_subtab(RESULTS) end)
|
btn:SetScript('OnClick', function() set_subtab(RESULTS) end)
|
||||||
search_results_button = btn
|
search_results_button = btn
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn = gui.button(frame, gui.font_size.large)
|
local btn = gui.button(frame, gui.font_size.large)
|
||||||
btn:SetPoint('TOPLEFT', search_results_button, 'TOPRIGHT', 5, 0)
|
btn:SetPoint('TOPLEFT', search_results_button, 'TOPRIGHT', 5, 0)
|
||||||
btn:SetWidth(243)
|
btn:SetWidth(243)
|
||||||
@@ -200,8 +201,8 @@ do
|
|||||||
btn:SetText('Saved Searches')
|
btn:SetText('Saved Searches')
|
||||||
btn:SetScript('OnClick', function() set_subtab(SAVED) end)
|
btn:SetScript('OnClick', function() set_subtab(SAVED) end)
|
||||||
saved_searches_button = btn
|
saved_searches_button = btn
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn = gui.button(frame, gui.font_size.large)
|
local btn = gui.button(frame, gui.font_size.large)
|
||||||
btn:SetPoint('TOPLEFT', saved_searches_button, 'TOPRIGHT', 5, 0)
|
btn:SetPoint('TOPLEFT', saved_searches_button, 'TOPRIGHT', 5, 0)
|
||||||
btn:SetWidth(243)
|
btn:SetWidth(243)
|
||||||
@@ -209,29 +210,29 @@ do
|
|||||||
btn:SetText('Filter Builder')
|
btn:SetText('Filter Builder')
|
||||||
btn:SetScript('OnClick', function() set_subtab(FILTER) end)
|
btn:SetScript('OnClick', function() set_subtab(FILTER) end)
|
||||||
new_filter_button = btn
|
new_filter_button = btn
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local frame = CreateFrame('Frame', nil, frame)
|
local frame = CreateFrame('Frame', nil, frame)
|
||||||
frame:SetWidth(265)
|
frame:SetWidth(265)
|
||||||
frame:SetHeight(25)
|
frame:SetHeight(25)
|
||||||
frame:SetPoint('TOPLEFT', aux.frame.content, 'BOTTOMLEFT', 0, -6)
|
frame:SetPoint('TOPLEFT', aux.frame.content, 'BOTTOMLEFT', 0, -6)
|
||||||
status_bar_frame = frame
|
status_bar_frame = frame
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn = gui.button(frame.results)
|
local btn = gui.button(frame.results)
|
||||||
btn:SetPoint('TOPLEFT', status_bar_frame, 'TOPRIGHT', 5, 0)
|
btn:SetPoint('TOPLEFT', status_bar_frame, 'TOPRIGHT', 5, 0)
|
||||||
btn:SetText('Bid')
|
btn:SetText('Bid')
|
||||||
btn:Disable()
|
btn:Disable()
|
||||||
bid_button = btn
|
bid_button = btn
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn = gui.button(frame.results)
|
local btn = gui.button(frame.results)
|
||||||
btn:SetPoint('TOPLEFT', bid_button, 'TOPRIGHT', 5, 0)
|
btn:SetPoint('TOPLEFT', bid_button, 'TOPRIGHT', 5, 0)
|
||||||
btn:SetText('Buyout')
|
btn:SetText('Buyout')
|
||||||
btn:Disable()
|
btn:Disable()
|
||||||
buyout_button = btn
|
buyout_button = btn
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn = gui.button(frame.results)
|
local btn = gui.button(frame.results)
|
||||||
btn:SetPoint('TOPLEFT', buyout_button, 'TOPRIGHT', 5, 0)
|
btn:SetPoint('TOPLEFT', buyout_button, 'TOPRIGHT', 5, 0)
|
||||||
btn:SetText('Clear')
|
btn:SetText('Clear')
|
||||||
@@ -239,16 +240,16 @@ do
|
|||||||
while tremove(current_search().records) do end
|
while tremove(current_search().records) do end
|
||||||
current_search().table:SetDatabase()
|
current_search().table:SetDatabase()
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn = gui.button(frame.saved)
|
local btn = gui.button(frame.saved)
|
||||||
btn:SetPoint('TOPLEFT', status_bar_frame, 'TOPRIGHT', 5, 0)
|
btn:SetPoint('TOPLEFT', status_bar_frame, 'TOPRIGHT', 5, 0)
|
||||||
btn:SetText('Favorite')
|
btn:SetText('Favorite')
|
||||||
btn:SetScript('OnClick', function()
|
btn:SetScript('OnClick', function()
|
||||||
add_favorite(search_box:GetText())
|
add_favorite(search_box:GetText())
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn1 = gui.button(frame.filter)
|
local btn1 = gui.button(frame.filter)
|
||||||
btn1:SetPoint('TOPLEFT', status_bar_frame, 'TOPRIGHT', 5, 0)
|
btn1:SetPoint('TOPLEFT', status_bar_frame, 'TOPRIGHT', 5, 0)
|
||||||
btn1:SetText('Search')
|
btn1:SetText('Search')
|
||||||
@@ -266,8 +267,8 @@ do
|
|||||||
btn3:SetPoint('LEFT', btn2, 'RIGHT', 5, 0)
|
btn3:SetPoint('LEFT', btn2, 'RIGHT', 5, 0)
|
||||||
btn3:SetText('Import')
|
btn3:SetText('Import')
|
||||||
btn3:SetScript('OnClick', import_filter_string)
|
btn3:SetScript('OnClick', import_filter_string)
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local editbox = gui.editbox(frame.filter)
|
local editbox = gui.editbox(frame.filter)
|
||||||
editbox.complete_item = completion.complete(function() return aux.account_data.auctionable_items end)
|
editbox.complete_item = completion.complete(function() return aux.account_data.auctionable_items end)
|
||||||
editbox:SetPoint('TOPLEFT', 14, -FILTER_SPACING)
|
editbox:SetPoint('TOPLEFT', 14, -FILTER_SPACING)
|
||||||
@@ -293,8 +294,8 @@ do
|
|||||||
label:SetPoint('BOTTOMLEFT', editbox, 'TOPLEFT', -2, 1)
|
label:SetPoint('BOTTOMLEFT', editbox, 'TOPLEFT', -2, 1)
|
||||||
label:SetText('Name')
|
label:SetText('Name')
|
||||||
name_input = editbox
|
name_input = editbox
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local checkbox = gui.checkbox(frame.filter)
|
local checkbox = gui.checkbox(frame.filter)
|
||||||
checkbox:SetPoint('TOPLEFT', name_input, 'TOPRIGHT', 16, 0)
|
checkbox:SetPoint('TOPLEFT', name_input, 'TOPRIGHT', 16, 0)
|
||||||
checkbox:SetScript('OnClick', update_form)
|
checkbox:SetScript('OnClick', update_form)
|
||||||
@@ -302,8 +303,8 @@ do
|
|||||||
label:SetPoint('BOTTOMLEFT', checkbox, 'TOPLEFT', -2, 1)
|
label:SetPoint('BOTTOMLEFT', checkbox, 'TOPLEFT', -2, 1)
|
||||||
label:SetText('Exact')
|
label:SetText('Exact')
|
||||||
exact_checkbox = checkbox
|
exact_checkbox = checkbox
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local editbox = gui.editbox(frame.filter)
|
local editbox = gui.editbox(frame.filter)
|
||||||
editbox:SetPoint('TOPLEFT', name_input, 'BOTTOMLEFT', 0, -FILTER_SPACING)
|
editbox:SetPoint('TOPLEFT', name_input, 'BOTTOMLEFT', 0, -FILTER_SPACING)
|
||||||
editbox:SetWidth(gui.is_blizzard() and 123 or 125)
|
editbox:SetWidth(gui.is_blizzard() and 123 or 125)
|
||||||
@@ -328,8 +329,8 @@ do
|
|||||||
label:SetPoint('BOTTOMLEFT', editbox, 'TOPLEFT', -2, 1)
|
label:SetPoint('BOTTOMLEFT', editbox, 'TOPLEFT', -2, 1)
|
||||||
label:SetText('Level Range')
|
label:SetText('Level Range')
|
||||||
min_level_input = editbox
|
min_level_input = editbox
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local editbox = gui.editbox(frame.filter)
|
local editbox = gui.editbox(frame.filter)
|
||||||
editbox:SetPoint('TOPLEFT', min_level_input, 'TOPRIGHT', gui.is_blizzard() and 14 or 10, 0)
|
editbox:SetPoint('TOPLEFT', min_level_input, 'TOPRIGHT', gui.is_blizzard() and 14 or 10, 0)
|
||||||
editbox:SetWidth(gui.is_blizzard() and 123 or 125)
|
editbox:SetWidth(gui.is_blizzard() and 123 or 125)
|
||||||
@@ -354,8 +355,8 @@ do
|
|||||||
label:SetPoint('RIGHT', editbox, 'LEFT', gui.is_blizzard() and -7 or -3, 0)
|
label:SetPoint('RIGHT', editbox, 'LEFT', gui.is_blizzard() and -7 or -3, 0)
|
||||||
label:SetText('-')
|
label:SetText('-')
|
||||||
max_level_input = editbox
|
max_level_input = editbox
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local checkbox = gui.checkbox(frame.filter)
|
local checkbox = gui.checkbox(frame.filter)
|
||||||
checkbox:SetPoint('TOPLEFT', max_level_input, 'TOPRIGHT', 16, 0)
|
checkbox:SetPoint('TOPLEFT', max_level_input, 'TOPRIGHT', 16, 0)
|
||||||
checkbox:SetScript('OnClick', update_form)
|
checkbox:SetScript('OnClick', update_form)
|
||||||
@@ -363,8 +364,8 @@ do
|
|||||||
label:SetPoint('BOTTOMLEFT', checkbox, 'TOPLEFT', -2, 1)
|
label:SetPoint('BOTTOMLEFT', checkbox, 'TOPLEFT', -2, 1)
|
||||||
label:SetText('Usable')
|
label:SetText('Usable')
|
||||||
usable_checkbox = checkbox
|
usable_checkbox = checkbox
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local dropdown = gui.dropdown(frame.filter)
|
local dropdown = gui.dropdown(frame.filter)
|
||||||
class_dropdown = dropdown
|
class_dropdown = dropdown
|
||||||
dropdown:SetPoint('TOPLEFT', min_level_input, 'BOTTOMLEFT', 0, 5 - FILTER_SPACING)
|
dropdown:SetPoint('TOPLEFT', min_level_input, 'BOTTOMLEFT', 0, 5 - FILTER_SPACING)
|
||||||
@@ -376,8 +377,8 @@ do
|
|||||||
dropdown:SetScript('OnShow', function()
|
dropdown:SetScript('OnShow', function()
|
||||||
UIDropDownMenu_Initialize(this, initialize_class_dropdown)
|
UIDropDownMenu_Initialize(this, initialize_class_dropdown)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local dropdown = gui.dropdown(frame.filter)
|
local dropdown = gui.dropdown(frame.filter)
|
||||||
subclass_dropdown = dropdown
|
subclass_dropdown = dropdown
|
||||||
dropdown:SetPoint('TOPLEFT', class_dropdown, 'BOTTOMLEFT', 0, 10 - FILTER_SPACING)
|
dropdown:SetPoint('TOPLEFT', class_dropdown, 'BOTTOMLEFT', 0, 10 - FILTER_SPACING)
|
||||||
@@ -389,8 +390,8 @@ do
|
|||||||
dropdown:SetScript('OnShow', function()
|
dropdown:SetScript('OnShow', function()
|
||||||
UIDropDownMenu_Initialize(this, initialize_subclass_dropdown)
|
UIDropDownMenu_Initialize(this, initialize_subclass_dropdown)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local dropdown = gui.dropdown(frame.filter)
|
local dropdown = gui.dropdown(frame.filter)
|
||||||
slot_dropdown = dropdown
|
slot_dropdown = dropdown
|
||||||
dropdown:SetPoint('TOPLEFT', subclass_dropdown, 'BOTTOMLEFT', 0, 10 - FILTER_SPACING)
|
dropdown:SetPoint('TOPLEFT', subclass_dropdown, 'BOTTOMLEFT', 0, 10 - FILTER_SPACING)
|
||||||
@@ -402,8 +403,8 @@ do
|
|||||||
dropdown:SetScript('OnShow', function()
|
dropdown:SetScript('OnShow', function()
|
||||||
UIDropDownMenu_Initialize(this, initialize_slot_dropdown)
|
UIDropDownMenu_Initialize(this, initialize_slot_dropdown)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local dropdown = gui.dropdown(frame.filter)
|
local dropdown = gui.dropdown(frame.filter)
|
||||||
quality_dropdown = dropdown
|
quality_dropdown = dropdown
|
||||||
dropdown:SetPoint('TOPLEFT', slot_dropdown, 'BOTTOMLEFT', 0, 10 - FILTER_SPACING)
|
dropdown:SetPoint('TOPLEFT', slot_dropdown, 'BOTTOMLEFT', 0, 10 - FILTER_SPACING)
|
||||||
@@ -415,9 +416,9 @@ do
|
|||||||
dropdown:SetScript('OnShow', function()
|
dropdown:SetScript('OnShow', function()
|
||||||
UIDropDownMenu_Initialize(this, initialize_quality_dropdown)
|
UIDropDownMenu_Initialize(this, initialize_quality_dropdown)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
gui.vertical_line(frame.filter, 332)
|
gui.vertical_line(frame.filter, 332)
|
||||||
do
|
do
|
||||||
local dropdown = gui.dropdown(frame.filter)
|
local dropdown = gui.dropdown(frame.filter)
|
||||||
if gui.is_blizzard() then
|
if gui.is_blizzard() then
|
||||||
local button = _G[dropdown:GetName() .. 'Button']
|
local button = _G[dropdown:GetName() .. 'Button']
|
||||||
@@ -441,8 +442,8 @@ do
|
|||||||
label:SetPoint('RIGHT', dropdown, 'LEFT', -15, 0)
|
label:SetPoint('RIGHT', dropdown, 'LEFT', -15, 0)
|
||||||
label:SetText('Component')
|
label:SetText('Component')
|
||||||
filter_dropdown = dropdown
|
filter_dropdown = dropdown
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local input = gui.editbox(frame.filter)
|
local input = gui.editbox(frame.filter)
|
||||||
input:SetPoint('CENTER', filter_dropdown, 'CENTER', 0, 0)
|
input:SetPoint('CENTER', filter_dropdown, 'CENTER', 0, 0)
|
||||||
input:SetWidth(150)
|
input:SetWidth(150)
|
||||||
@@ -468,8 +469,8 @@ do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
filter_input = input
|
filter_input = input
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local input = gui.editbox(frame.filter)
|
local input = gui.editbox(frame.filter)
|
||||||
input:SetPoint('LEFT', filter_dropdown, 'RIGHT', 10, 0)
|
input:SetPoint('LEFT', filter_dropdown, 'RIGHT', 10, 0)
|
||||||
input:SetWidth(150)
|
input:SetWidth(150)
|
||||||
@@ -480,8 +481,8 @@ do
|
|||||||
input.enter = add_form_component
|
input.enter = add_form_component
|
||||||
input:Hide()
|
input:Hide()
|
||||||
filter_parameter_input = input
|
filter_parameter_input = input
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local scroll_frame = CreateFrame('ScrollFrame', nil, frame.filter)
|
local scroll_frame = CreateFrame('ScrollFrame', nil, frame.filter)
|
||||||
scroll_frame:SetWidth(395)
|
scroll_frame:SetWidth(395)
|
||||||
scroll_frame:SetHeight(270)
|
scroll_frame:SetHeight(270)
|
||||||
@@ -522,11 +523,11 @@ do
|
|||||||
scroll_child:SetScript('OnHyperlinkClick', data_link_click)
|
scroll_child:SetScript('OnHyperlinkClick', data_link_click)
|
||||||
scroll_child.measure = scroll_child:CreateFontString()
|
scroll_child.measure = scroll_child:CreateFontString()
|
||||||
filter_display = scroll_child
|
filter_display = scroll_child
|
||||||
end
|
end
|
||||||
|
|
||||||
status_bars = {}
|
status_bars = {}
|
||||||
tables = {}
|
tables = {}
|
||||||
for _ = 1, 5 do
|
for _ = 1, 5 do
|
||||||
local status_bar = gui.status_bar(frame)
|
local status_bar = gui.status_bar(frame)
|
||||||
status_bar:SetAllPoints(status_bar_frame)
|
status_bar:SetAllPoints(status_bar_frame)
|
||||||
status_bar:Hide()
|
status_bar:Hide()
|
||||||
@@ -556,16 +557,17 @@ for _ = 1, 5 do
|
|||||||
end)
|
end)
|
||||||
table:Hide()
|
table:Hide()
|
||||||
tinsert(tables, table)
|
tinsert(tables, table)
|
||||||
end
|
end
|
||||||
|
|
||||||
favorite_searches_listing = listing.new(frame.saved.favorite)
|
favorite_searches_listing = listing.new(frame.saved.favorite)
|
||||||
favorite_searches_listing:SetColInfo{{name='Auto', width=.07, align='CENTER'}, {name='Favorite Searches', width=.93}}
|
favorite_searches_listing:SetColInfo{{name='Auto', width=.07, align='CENTER'}, {name='Favorite Searches', width=.93}}
|
||||||
|
|
||||||
recent_searches_listing = listing.new(frame.saved.recent)
|
recent_searches_listing = listing.new(frame.saved.recent)
|
||||||
recent_searches_listing:SetColInfo{{name='Recent Searches', width=1}}
|
recent_searches_listing:SetColInfo{{name='Recent Searches', width=1}}
|
||||||
|
|
||||||
for listing in T.temp-T.set(favorite_searches_listing, recent_searches_listing) do
|
for listing in T.temp-T.set(favorite_searches_listing, recent_searches_listing) do
|
||||||
for k, v in handlers do
|
for k, v in handlers do
|
||||||
listing:SetHandler(k, v)
|
listing:SetHandler(k, v)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
Reference in New Issue
Block a user